1) Power on the Raspberry Pi to start
After the Raspberry Pi is powered on, the first boot program in the SoC is executed first, and its role is to mount the FAT32 partition on the SD card to load the next stage of the bootloader . This part of the program is solidified in SoC ROM and cannot be modified by the user.
4B adds an EEPROM inside the chip to avoid risks (due to the 4B hardware upgrade, the startup process is more complicated, if all the codes are written into ROM, it will increase the complexity and introduce possible BUG), 4B is powered on to run the SPI connection bootloader code in EEPROM.
2) Raspberry Pi executes bootloader
bootcode.bin
At this stage, the Raspberry Pi will load the ( ) file on the SD card bootloader
as the second-stage boot program. bootloader
will start the GPU and load the third-stage launcher start.elf
.
Note that it is not used on 4B bootcode.bin
as it is EEPROM
replaced by the boot code onboard.
3) Raspberry Pi boot kernel
start.elf
Read the file storing the system configuration config.txt
, set the CPU operating parameters and memory allocation according to its content, then load the user code into the memory, and start the CPU;
After the CPU starts, load the kernel to start.
The system will first search for the file specified config.txt
in the parameter kernel=xxx
as the next object to accept the control of the system. The Raspberry Pi defaults to the file as the linux kernel. We can replace it with a uboot
new one bootloader
and then start the linux kernel.
If config.txt
no kernel
parameter is specified, the default is to search for kernel8.img
, kernel8-32.img
, kernel7.img
, kernel.img
respectively, corresponding to ARMv8-aarch64
, ARMv8-aarch32
, ARMv7
and previous versions.