I. Introduction to bootloader
1. Definition:
A short program before the operating system runs
2. features:
Initialize hardware devices;
Call the operating system;
3. installation:
After resetting, the system starts execution from the address 0x00000000. When nandflash is started, at the address 0, the first 4 kb is Ram. After power-on, the system copies the content of the first 4 kb of nandflash to ram.
4. Porting:
Bootloader depends on the specific CPU architecture and the configuration of embedded board-level devices.
5. Start the process:
Stage 1:
A. Hardware Device initialization (mainly registers inside the CPU)
B. Prepare the ram space for the second stage of loading bootloader
C. Copy the second stage of bootloader to the ram space.
D. Set the stack: the stack used by stage C code
E. Jump to the C entry point of stage2
Stage 2:
A. initialize the hardware (onboard device) to be used in this phase)
B. Read the kernel image and root file system image from flash to ram.
C. Call the kernel
6. startup and Development Modes