Page 1 of 1

Does anyone know what is inside the bootcode.bin, start.elf?

Posted: Mon Feb 10, 2020 6:41 pm
by liletian.us
Hi All

I understand that when boot-up, start.elf and bootcode.bin are needed. Just wondering what do we need a elf file and a bin file here?

What is the elf used for?

Also, does anyone know what is inside those two files and are there source files for those two files?

My last question is when if I get a chip from the chip company, looks like that the boot code has to come from the chip company and it has to support until the chip can begin to read from disk (Flash or hard disk), right?

Best regards,

Brian

Re: Does anyone know what is inside the bootcode.bin, start.elf?

Posted: Mon Feb 10, 2020 6:56 pm
by LdB
Its documented on the Raspberry pages

https://www.raspberrypi.org/documentati ... _folder.md
https://www.raspberrypi.org/documentati ... ootflow.md

basically bootload.bin is the bootstrap loader (except Pi4), start(x).elf is the GPU firmware.

Re: Does anyone know what is inside the bootcode.bin, start.elf?

Posted: Fri Feb 14, 2020 9:29 pm
by cleverca22
there are ~4-5 phases in the boot process for an rpi (depending on your distro)

phase 0: the mask rom in the VPU starts at power-up, and it will load bootcode.bin from one of many places (the rpi4 gets it exclusively from the SPI flash)
phase 1: the bootcode.bin file will then bring dram online, and load a start.elf file
phase 2: start.elf will initialize most of the hardware, and load the kernel (either linux itself, or u-boot in a zImage format)
phase 3: the kernel will boot (which might be u-boot, and loads the real linux in a phase 4)

start.elf then continues to run, and the linux and start.elf co-operate to complete certain tasks

the official bootcode.bin and start.elf files are all closed source, but i have been working on trying to make usable replacements for them, which work enough to boot linux on 1 core with usb