2.1 Boot Process
Overview
I've tried to list here a generalised overview of the boot process for the rpi / rpi2
Typically most rpi's use Noobs which makes this a little more complicated
TODO go through these
cmdline.txt options:
Firmware Versions
The differences in firmware versions:
- fixupx.dat, startx.elf enable potentially unstable/not-fully-tested/hacky functionality - extra video codecs
- fixupcd.dat, startcd.elf These are used when GPU memory is set to 16 MB, which disables some GPU features
- http://www.raspberrypi.org/forums/viewtopic.php?p=198420#p198420
Boot Process
Without Noobs Boot Process
First the way the boot works without Noobs
The general boot process for the Rpi is:
- A fixed block of code within the Soc is run on the GPU as the first stage bootloader this is fixed and inbuilt to the chip
- The second stage bootloader is loaded from bootcode.bin on the first partition typically mounted on /boot/
- The GPU Firmware start.elf / fixup.dat is loaded (fixup.date is used for the SDRAM partition)
- config.txt is parsed as a sort of list of bios / bootloader options
- The user code / linux kernel.img is then loaded and run
- cmdline.txt is parsed by the kernel for a list of options
Links:
- http://elinux.org/RPi_Software
- https://github.com/raspberrypi/noobs/wiki/Standalone-partitioning-explained
With Noobs Boot Process
Most RPI's when they are installed come with noobs on the sd card by default, this makes things a little more complicated
Links:
- https://github.com/raspberrypi/noobs/wiki/NOOBS-partitioning-explained
- https://github.com/raspberrypi/firmware/tree/master/boot
The typical partition layout is
- /dev/mmcblk0p0 - represents the entire sd card
- /dev/mmcblk0p1 - 1st Stage Boot partition, used by Noobs for the initial boot
- /dev/mmcblk0p2 - Extended Partition - contains logical partitions mmcblk0p5 / mmcblk0p6
- /dev/mmcblk0p3 - Settings used for Noobs (mounted /media/SETTINGS/)
/dev/mmcblk0p4 - Not Used
/dev/mmcblk0p5 - 2nd Stage Boot partition, used by the OS to store the kernel / boot files (mounted /boot/)
/dev/mmcblk0p6 - Main OS root partition where the operating system is installed (mounted /)
The general idea is Noobs never changes it's primary boot partition /dev/mmcblk0p1
This way the device should always be bootable, this partition is not mounted by default
The settings for Noobs as to which kernel / etc to boot is stored within /dev/mmcblk0p3
If the shift key is held down during boot then Noobs will interupt the boot process
and allow for the editing of the config.txt / cmdline.txt to edit the boot options
When Noobs decides to boot an OS it does so via the OS's /boot partition (/dev/mmcblk0p5)
it does a soft-reboot and loads the start.elf from that boot partition to start the boot process