I have a raspberry mini computer and I am wondering how that thing does whole the boot process. I can compile my own kernel and init ramdisk with my own scripts and build my own minimal linux system on PC, but for that I need to use some bootloader. Raspberry doesn't seem to support bootloaders at all.

It seems to somehow boot up using its GPU which reads some partition on SD card (probably that one with bootable flag) that needs to be formatted in FAT32, then it reads some files from there, which are provided, for example by raspbian.

But how would I boot up my own kernel, with my own customizations that I compiled myself? Where should I copy the kernel image / initrd (ram disk) so that raspberry find it and boot from it? I am basically looking for some very detailed technical documentation that describes the boot process on raspberry or just some explanation of this.

1 Answer
1

When the Raspberry Pi is first turned on, the ARM core is off, and
the GPU core is on. At this point the SDRAM is disabled.

The GPU starts executing the first stage bootloader, which is stored
in ROM on the SoC. The first stage bootloader reads the SD card, and
loads the second stage bootloader (bootcode.bin) into the L2 cache,
and runs it.

bootcode.bin enables SDRAM, and reads the third stage bootloader
(loader.bin) from the SD card into RAM, and runs it. [ More recent versions do not use a third stage bootloader. ]

[ If applicable ]loader.bin reads the GPU firmware (start.elf).

start.elf reads config.txt, cmdline.txt and kernel.img

loader.bin doesn't do much. It can handle .elf files, and so is needed
to load start.elf at the top of memory (ARM uses SDRAM from address
zero). There is a plan to add elf loading support to bootcode.bin,
which would make loader.bin unnecessary, but it's a low priority (I
guess it might save you 100ms on boot). [ This change has since taken place. ]

Is that content of these bin files all proprietary software?
– PetrNov 2 '13 at 17:25

3

@Petr Here is the Github for the Raspberry Pi firmware, I'll edit it into my answer.
– syb0rgNov 2 '13 at 17:28

1

On the Raspberry Pi FAQ's, it says "You have to boot from SD but a USB HD can “take over” after the initial boot. You cannot boot without an SD card."
– syb0rgNov 2 '13 at 17:32

1

Is that parition, which is read first, any partition with B flag or it must be first partition? What if I made it too large and I wanted to create another one on end of SD card which would be smaller
– PetrNov 3 '13 at 12:32

1

@Petr You should ask that as another question!
– syb0rgNov 3 '13 at 14:57