Bootloader in an embedded system is the first code to run when the system is powered on. Bootloader typically is stored in BIOS or flash memory. It performs low level hardware initiailization and then pass control to the linux kernel.
Some architecture and bootloader (e.g. Power with U-Boot) can boot the vmlinuex directly (after converting ELF to binary form). In this case, the image is called uImage (a compressed vmlinux in U-Boot header). In other architecture, an intermediate step is required to set the right context for vmlinux before control is handed over.
Sunday, July 10, 2011
vmlinux
IT is the Linux monolithic kernel in ELF format. This is binary and contains no unresolved references.
/arch/arm/kernel/head.o is the an architecture specific (ARM in this case) that perform low level kernel intialization. This is executed first when the kernel is loaed and passed control to by the bootloader.
init_task.o set up the initial thread and task structures that the kernel requires.
The largest object module making up kernels are filesystem code, network code, built-in drivers code and the kernel (which contains scheduler, process and thread management, timer and other core functions).
The /arch/ARM/kernel contains specific architecture functionalities such as low-level context switching, hardware level interrupt, processor exception handling etc.
/arch/arm/kernel/head.o is the an architecture specific (ARM in this case) that perform low level kernel intialization. This is executed first when the kernel is loaed and passed control to by the bootloader.
init_task.o set up the initial thread and task structures that the kernel requires.
The largest object module making up kernels are filesystem code, network code, built-in drivers code and the kernel (which contains scheduler, process and thread management, timer and other core functions).
The /arch/ARM/kernel contains specific architecture functionalities such as low-level context switching, hardware level interrupt, processor exception handling etc.
Flash Memory
Flash memory can be written to and erased under software control. Speed is considerably slower than hard disk. Flash memory is divided into relatively large erasable units (blocks). In a NOR flash memory chip, data can be changed from a binary 1 to 0directly to the cell address, one bit or word at a time. However, to change from 0 to 1, an entire erase block must be erased using a sequence of control instructions to the flash chip.
Flash memory erase block can be uniform in size or variable. The smaller block can store the bootloader and the kernel or data are kept in larger block. This is commonly called boot block or boot section chip.
To modify data stored in Flash memory array, the block in which the modified data resides must be completely erased. As the block size for Flash is much larger than typical hard disk (512 or 1K bytes), the wrtie time of Flash can be many times of hard disk.
Another limitation for Flash is there is write lifetime. Write may fails after the lifetime (100K) is exceeded.
NAND Flash is newer technology. It has smaller block. While NOR flash uses parallel address and data lines. NAND flash use proprietary serial interface. Lifetime for NAND fash is also significantly higher.
Flash memory erase block can be uniform in size or variable. The smaller block can store the bootloader and the kernel or data are kept in larger block. This is commonly called boot block or boot section chip.
To modify data stored in Flash memory array, the block in which the modified data resides must be completely erased. As the block size for Flash is much larger than typical hard disk (512 or 1K bytes), the wrtie time of Flash can be many times of hard disk.
Another limitation for Flash is there is write lifetime. Write may fails after the lifetime (100K) is exceeded.
NAND Flash is newer technology. It has smaller block. While NOR flash uses parallel address and data lines. NAND flash use proprietary serial interface. Lifetime for NAND fash is also significantly higher.
Sunday, April 10, 2011
Drawing 3D
Perspective, or angles between the lines lends the illusion of depth. With perspective, 3D object can be depicted in 2D screen.
When one covers one eye and looks, the world still appears as in 3D because perspective alone is enough to create the 3D effect. Another obvious clue is nearby objects appear larger than the distant ones. This perspective effect is called foreshortening.
To enhance 3D effect in drawing on 2D, another technique is to remove hidden lines and surfaces from the object on screen. Applying different color to different side of object simulates the effects of light. Adding shadow further enhances the illusion.
Texture mapping takes an image, such as a photo and applies it on the surface of an object to give it a realistic looks. For example, applying wood texture onto a cube to make it looks like a box. The process of stretching and compressing texels (texture elements) is called filtering.
Fog adds haziness to objects in a scene depending on the distance where objects are.
Blending is the combination of colors or objects on the screen, similar to superimposing 2 images. By varying the amount of each object with the scene, one can make the effect of transparency. Blending can create the illusion of reflection.
Antialiasing blends the lines with the background color to eliminate the jagged edges.
When one covers one eye and looks, the world still appears as in 3D because perspective alone is enough to create the 3D effect. Another obvious clue is nearby objects appear larger than the distant ones. This perspective effect is called foreshortening.
To enhance 3D effect in drawing on 2D, another technique is to remove hidden lines and surfaces from the object on screen. Applying different color to different side of object simulates the effects of light. Adding shadow further enhances the illusion.
Texture mapping takes an image, such as a photo and applies it on the surface of an object to give it a realistic looks. For example, applying wood texture onto a cube to make it looks like a box. The process of stretching and compressing texels (texture elements) is called filtering.
Fog adds haziness to objects in a scene depending on the distance where objects are.
Blending is the combination of colors or objects on the screen, similar to superimposing 2 images. By varying the amount of each object with the scene, one can make the effect of transparency. Blending can create the illusion of reflection.
Antialiasing blends the lines with the background color to eliminate the jagged edges.
Saturday, April 2, 2011
CISC and RISC
If RISC is faster, why was CISC predominant in the past? Back then, computer had very little storage. An instruction that could roll up several steps of complex operation, such as a do-loop, into a single instruction was an advantage, because memory was precious. In addition, instruction fetch was piecemail and sequential. Reducing the number of instruction saved time.
As it turned out, assembly langauage progreammers used the complicated machine instructions but compilers generally did not. It was difficult enough for compiler to recognize when a complicated instruction could be used, but the real problem was code optimizations. Verbatim translation of source constructs isn't very efficient. An optimizing compiler works by simplifying and eliminating redundant computations, After optimization, opportunities to use the complicated instructions tended to disappear.
On the other hand, there were several pushes for the development of RISC.
(1) The number of transistors that could fit on a single chip was increasing.
(2) Techiques like pipelining was difficult to be implemented for variable length instruction common in CISC design.
(3) As compilers improved, the resulting code generated for RISC out-performed equivalent complicated multi-cycle instructions in CISC.
As it turned out, assembly langauage progreammers used the complicated machine instructions but compilers generally did not. It was difficult enough for compiler to recognize when a complicated instruction could be used, but the real problem was code optimizations. Verbatim translation of source constructs isn't very efficient. An optimizing compiler works by simplifying and eliminating redundant computations, After optimization, opportunities to use the complicated instructions tended to disappear.
On the other hand, there were several pushes for the development of RISC.
(1) The number of transistors that could fit on a single chip was increasing.
(2) Techiques like pipelining was difficult to be implemented for variable length instruction common in CISC design.
(3) As compilers improved, the resulting code generated for RISC out-performed equivalent complicated multi-cycle instructions in CISC.
DRAM and SRAM
DRAM are charge-based devices, where each bit is represented by a electrical charge stored in a very small capacitor. The charge can be leaked away in a short amount of time, so the system has to continuously refreshed to prevent the data from being lost. The act oreading also discharges te bit, requiring refresh. It is not possible to read the memory bit in DRAM while refresh takes place.
SRAM is based on gates and each bit stored in four to six connected transistors. SRAM retains the data as long as there is power, without the need to refresh.
Access time is the amount of time takes to read or write a memory location. Memory cycle time describe how often you can repeat reference to the same memory chip.
Fast page mode DRAM saves time by allowing a mode in which the entire address doesn't have to be re-clocked into the chip for each memory operation. Instead, there is an assumption that the memory will be accessed sequentially and only the low-order buts of the address are clocked in for successive reads or writes.
EDO RAM is a modification to output buffering on page mode RAM that allows it to operate roughly twice as fast for operation other than refresh.
Synchronous DRAM is sychnorized using an external clock that allows the cache and DRAM to coordinate their operations. Also SDRAM can pipeline the retrieval of multiple memory bits to improve overall throughput.
Cached DRAM contains a SRAM cache on the same chip as the DRAM. This improves performance to close to SRAM.
SRAM is based on gates and each bit stored in four to six connected transistors. SRAM retains the data as long as there is power, without the need to refresh.
Access time is the amount of time takes to read or write a memory location. Memory cycle time describe how often you can repeat reference to the same memory chip.
Fast page mode DRAM saves time by allowing a mode in which the entire address doesn't have to be re-clocked into the chip for each memory operation. Instead, there is an assumption that the memory will be accessed sequentially and only the low-order buts of the address are clocked in for successive reads or writes.
EDO RAM is a modification to output buffering on page mode RAM that allows it to operate roughly twice as fast for operation other than refresh.
Synchronous DRAM is sychnorized using an external clock that allows the cache and DRAM to coordinate their operations. Also SDRAM can pipeline the retrieval of multiple memory bits to improve overall throughput.
Cached DRAM contains a SRAM cache on the same chip as the DRAM. This improves performance to close to SRAM.
Saturday, March 12, 2011
Form
Divide music into parts and convential muscial theory gives alphabet labels to the miscial parts within a composition.
1-part form: A
e.g. Happy Birthday - is the most primitive song structure sometimes refered as the air or ballad form. The melody is repeated with slight variation.
2-part form: AB
Binary form contain 2 contrasting sections functioning as statement and counterstatement. e.g. Greensleeves in AABB
Song form: ABA
3-part or tertiary form. One of the simpliest way to write in song form is to vary and repeat the melody e.g. Twinkle twinkle little star. Another variation of song form is AABA with B bridging the stretched A.
Arch form: ABCBA
Classical form
- sonata - common in period from mid 1700 to early 20 century. Sonata are based on song form (ABA). The first part is the exposition which presents the main theme of the song as well as 2 or 3 minor themes. The second part (or B part) is called development often sounds belonging to another musical piece, usually in different ey and even different time Signature. The 3rdpart is to return to the theme and called recapitulation.
Sonata has its roots in language - in this case, the sonnet. In sonnet (like those Shakespeare wrote), the first quatrain (4-line verse) consists of 2 set of rhyming pairs (A part), whereas the second verse consists of 2 comptelely dofferent set of rhyming pairs (B part). The 3rd verse retruns to the rhyming A section.
- rondo (ABACA) or ABACADA. The A seciton is called refrain ties the pieces together. B, C and D are called episodes can be in any key or time signature. Rondo also has its roots in poetry. In 13th century France, the rondeau was a popular form of street poetry which often set to music
- Concerto - contrasts between having a large ensemble playing a section of music and a solo/smaller group playing the same or similar section.
- Symphony - performed by an orchestra. It combines several different muscial forms into one piece of music harmoniously. There are traditionally 4 movements in a symphony
(a) Sonata Allegro
(b) Slower movement
(c) Minuet or scherzo
(d) combination of sonata and rondo, a thematic repeat of the first movement.
- Fugue - first form that fully utiliuze the left hand of the pianist. The treble clef and the bass lef take turns carrying the melody.
- Divertimento - a light and short form of instrumental chamber music has several short movement chiefly for entertainment value.
- Minimalism - extremem simplication of rhythms, patten and harmonies. Prolonged chordal or melodic repetitions and often in trancelike effect - AAAA....
- Through composed - no repetitious of themes
Popular forms
- blues - AABA patternof I, IV and V
- rock - 32 bar compounded blue. One plays the first 32 bars, go to the second bridge and repeat the first 32 bars again e.g. every breath you take
- verse-chorus form: Intro ABAVBCB
Intro us usually instrumental and set the mood, or short spoken piece
A (verse) being the story of the song
B (chorus) is the hook of the osng, both lyrically and musically, should be the most memorable, anthemic part of the song. Often the title too
A (verse) is the part 2 of the story
B (chorus) reinforce the hook to make it memorable
C (bridge) can be instrumental or lyrical and is differnt sounding than the verse or chorus
B (end, chorus) repeat chorus to fade or just stop at the I chord (candence) after one time through
1-part form: A
e.g. Happy Birthday - is the most primitive song structure sometimes refered as the air or ballad form. The melody is repeated with slight variation.
2-part form: AB
Binary form contain 2 contrasting sections functioning as statement and counterstatement. e.g. Greensleeves in AABB
Song form: ABA
3-part or tertiary form. One of the simpliest way to write in song form is to vary and repeat the melody e.g. Twinkle twinkle little star. Another variation of song form is AABA with B bridging the stretched A.
Arch form: ABCBA
Classical form
- sonata - common in period from mid 1700 to early 20 century. Sonata are based on song form (ABA). The first part is the exposition which presents the main theme of the song as well as 2 or 3 minor themes. The second part (or B part) is called development often sounds belonging to another musical piece, usually in different ey and even different time Signature. The 3rdpart is to return to the theme and called recapitulation.
Sonata has its roots in language - in this case, the sonnet. In sonnet (like those Shakespeare wrote), the first quatrain (4-line verse) consists of 2 set of rhyming pairs (A part), whereas the second verse consists of 2 comptelely dofferent set of rhyming pairs (B part). The 3rd verse retruns to the rhyming A section.
- rondo (ABACA) or ABACADA. The A seciton is called refrain ties the pieces together. B, C and D are called episodes can be in any key or time signature. Rondo also has its roots in poetry. In 13th century France, the rondeau was a popular form of street poetry which often set to music
- Concerto - contrasts between having a large ensemble playing a section of music and a solo/smaller group playing the same or similar section.
- Symphony - performed by an orchestra. It combines several different muscial forms into one piece of music harmoniously. There are traditionally 4 movements in a symphony
(a) Sonata Allegro
(b) Slower movement
(c) Minuet or scherzo
(d) combination of sonata and rondo, a thematic repeat of the first movement.
- Fugue - first form that fully utiliuze the left hand of the pianist. The treble clef and the bass lef take turns carrying the melody.
- Divertimento - a light and short form of instrumental chamber music has several short movement chiefly for entertainment value.
- Minimalism - extremem simplication of rhythms, patten and harmonies. Prolonged chordal or melodic repetitions and often in trancelike effect - AAAA....
- Through composed - no repetitious of themes
Popular forms
- blues - AABA patternof I, IV and V
- rock - 32 bar compounded blue. One plays the first 32 bars, go to the second bridge and repeat the first 32 bars again e.g. every breath you take
- verse-chorus form: Intro ABAVBCB
Intro us usually instrumental and set the mood, or short spoken piece
A (verse) being the story of the song
B (chorus) is the hook of the osng, both lyrically and musically, should be the most memorable, anthemic part of the song. Often the title too
A (verse) is the part 2 of the story
B (chorus) reinforce the hook to make it memorable
C (bridge) can be instrumental or lyrical and is differnt sounding than the verse or chorus
B (end, chorus) repeat chorus to fade or just stop at the I chord (candence) after one time through
Subscribe to:
Posts (Atom)