kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

custom bootcode.bin loading ?

Fri Apr 10, 2015 3:53 pm

hi all
i want to code a custom bootcode.bin ;)
my first problem is how the firmware find it ?
does it have a reduced fs driver ?
does it begin to search at first sd card mem block ?
i'd like to avoid fs if possible
my PI2 is not delivered yet so if someone know it i will not have to test all possible process
thanks

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6081
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 4:18 pm

Why?

kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 4:36 pm

i want to do it to init my integrated execution environnement on demand

User avatar
rpdom
Posts: 15582
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 5:04 pm

Do you understand how a Pi boots?

The tiny boot ROM on the chip looks for a MS-DOS partition on the card. It then looks for bootcode.bin in that partition, loads and executes it. bootcode.bin effectively is the firmware.

Also, bootcode.bin is GPU code, not ARM code.

fruitoftheloom
Posts: 21079
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 5:06 pm

kriss wrote:hi all
i want to code a custom bootcode.bin ;)
my first problem is how the firmware find it ?
does it have a reduced fs driver ?
does it begin to search at first sd card mem block ?
i'd like to avoid fs if possible
my PI2 is not delivered yet so if someone know it i will not have to test all possible process
thanks
https://thekandyancode.wordpress.com/20 ... i-boots-up
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6081
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 5:07 pm

Also note that bootcode.bin isn't executed on the ARM, but on the VPU and comes up before anything is really initialized. You'll need to be a bit of a wizard to get anything useful to happen in your own bootcodee.bin. It's possible, but you wouldn't be asking if you were such a wizard. The reason I asked 'why' was to figure out which direction to point you in instead. It's still not clear what you're doing to figure out what the best approach is.

kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 5:33 pm

rpdom : for me a firmware is included in the hardware
bootcode.bin is more as a bios here
i asked for how it is found
i didn't ask for gpu opcodes tables ;)
sure i'm not a wizard shiftplusone but i know what i want
and if i have to become a wizard to have it i'll be a great one ;)
i'll found it by try if no answer is postable
thanks fruit ... and all here

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6081
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 7:50 pm


kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: custom bootcode.bin loading ?

Fri Apr 10, 2015 8:26 pm

thanks again shiftplusone
if i was able to do electronic i surely made a fake µsd card with dynamic data for easy retro-engineering ;)
sadly i have friedrich ataxia ...
anyway if one have some good else link(s) related to what i asked feel free to share here

kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: custom bootcode.bin loading ?

Wed May 13, 2015 5:05 pm

i look at bootcode.bin in hex editor and at offset 200 it begin to be else than 0000 ;)
so is that some padding or is it the gpu code that end at offset 200 ???

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: custom bootcode.bin loading ?

Wed May 13, 2015 7:03 pm

The beginning is just unused padding. Check mgottshlag's tools and the ACK!

Return to “Bare metal, Assembly language”