33

I am wanting to learn about the BIOS on a Raspberry Pi motherboard. What is the BIOS called? Does it have a specific name or is it just called a BIOS on a Raspberry Pi?

1
  • 2
    BIOS stores some software to control your PC before it boots(example-setup hard drive, memory etc). The Pi does not use a "BIOS" like in a PC. It just initializes the Broadcom chip (CPU, Cache, GPU) using firmware written for that chip and passes straight to the Operating system. The OS then detects hardware and ram reported by Broadcom. This makes booting really fast but only Broadcom knows how to debug or "set" properties on the fly.
    – Piotr Kula
    Commented Jul 18, 2013 at 12:33

2 Answers 2

35

The firmware is closed-source proprietary code programmed into the SoC (System on a Chip) processor, which cannot be modified. Upon power-up the firmware will initiate a bootloader on the SD card. I do not believe that any other services are provided through the SoC firmware, so it is not really a "BIOS" (Basic Input/Output System) per se. After this point everything else comes from the SD card.

According to the software section of the wiki, the boot order is as follows:

  1. First stage bootloader - This is used to mount the FAT32 boot partition on the SD card so that the second stage bootloader can be accessed. It is programmed into the SoC itself during manufacture of the RPi and cannot be reprogrammed by a user.
  2. Second stage bootloader (bootcode.bin) - This is used to retrieve the GPU firmware from the SD card, program the firmware, then start the GPU.
  3. GPU firmware (start.elf) - Once loaded, this allows the GPU to start up the CPU. An additional file, fixup.dat, is used to configure the SDRAM partition between the GPU and the CPU. At this point, the CPU is release from reset and execution is transferred over.
  4. User code - This can be one of any number of binaries. By default, it is the Linux kernel (usually named kernel.img), but it can also be another bootloader (e.g. U-Boot), or a bare-bones application.
2
  • 9
    I would only add that 1st stage bootloader is burned on small ROM inside of SoC. As mentioned, it's only responsibility is loading bootcode.bin from SD card. This is the reason why it is impossible to boot RaspberryPi from medium other than SD card. Commented Jul 17, 2013 at 18:38
  • @TevoD, nice answer! I love the thorough details. Commented Jul 17, 2013 at 19:26
19

@TevoD is almost right in what he wrote in his answer - RaspberryPi is using closed source firmware binary as a bootloader. The current version can be found here. The two files that makes the firmware are bootcode.bin (2nd stage bootloader) and start.elf (GPU "firmware"). What is interesting and quite unique to RaspberryPi is that it starts from GPU (graphics chip) and this is where bootloader actually runs. GPU then starts ARM CPU and runs Linux kernel.

After Linux is started, code on GPU is not unloaded, however. Instead it runs it's own simple OS, called VCOS (Video Core Operating System). Linux kernel communicates with its services using special mailbox protocol and using interrupts (GPU can produce ARM interrupts). You can read some information about mailbox protocol used for framebuffer here. GPU is responsible not only for graphic things - it also controls clocks and produces audio, for example. In this regard, GPU firmware can be considered something similar to BIOS from normal PC computers. You can find more information on this reading RaspberryPi Linux kernel drivers.

You can also find some more information in this answer.

1
  • Good point. I was considering the BIOS question to be explicitly referring to onboard firmware, not the SD Card, and added the boot order for a more complete answer. Yours certainly takes it on from there. +1
    – Tevo D
    Commented Jul 17, 2013 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.