usermcmuffin
Posts: 1
Joined: Thu Jun 13, 2013 6:53 pm

how does the raspberry pi boot?

Thu Jun 13, 2013 6:59 pm

I've seen that there is in fact no BIOS on the raspberry pi. So the question begs, how does it actually load from the DS card?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23065
Joined: Sat Jul 30, 2011 7:41 pm

Re: how does the raspberry pi boot?

Thu Jun 13, 2013 7:24 pm

IIRC, tIny bootloader on the SoC, runs bootcode.bin on root of SD card, which in turns sets up the SoC then loads and runs the GPU binary start.elf, once that's running it then boot linux.

I think this is all covered in the Wiki.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 1:47 pm

Which wiki?
Antikythera

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 1:55 pm


W. H. Heydt
Posts: 10575
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 5:02 pm

It's kind of like IPL coding on an IBM S/360. The processor just barely knows how to get things started and the initial data brought in takes over from there.

(For our younger--i.e. under 60--readers, on a S/360, you set the dials on the front panel to the channel & device address of the boot device and pressed the "IPL" button. The system would then read 24 bytes from the beginning--think disk drive for the usual boot process--selected device, using the first 8 bytes as a channel command word, which usually chained to the second 8 bytes as another CCW. At the end of the channel program, the third 8 byte unit would be loaded as the program status word, which would--if done right--set the pointer to the next instruction to the code that had been loaded. Aren't you sorry you asked? Aren't you annoyed that I still remember all that 40 years later?)

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

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 5:06 pm

W. H. Heydt wrote:It's kind of like IPL coding on an IBM S/360. The processor just barely knows how to get things started and the initial data brought in takes over from there.

(For our younger--i.e. under 60--readers, on a S/360, you set the dials on the front panel to the channel & device address of the boot device and pressed the "IPL" button. The system would then read 24 bytes from the beginning--think disk drive for the usual boot process--selected device, using the first 8 bytes as a channel command word, which usually chained to the second 8 bytes as another CCW. At the end of the channel program, the third 8 byte unit would be loaded as the program status word, which would--if done right--set the pointer to the next instruction to the code that had been loaded. Aren't you sorry you asked? Aren't you annoyed that I still remember all that 40 years later?)
IPL being "Initial Program Load" of course.

I've never used an S/360, or any other IBM mainframe, but have used a few Honeywell (now Bull) systems quite a few years back (yay for 36 bit processors!)

User avatar
Burngate
Posts: 5930
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 5:16 pm

solar3000 wrote:Which wiki?
The Wiki is hidden so that only Linux gurus can find it.
Having been shown where it is, you are now officially a Linux guru.
Congratulations

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12010
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 5:40 pm

In the past there was a link in the top menu to the wiki, but it seems the RPF has "issues" with the wiki, so the link has been removed. Its still in the FAQ though, and in some of the "how to get started" texts in the forum.

I suppose the wiki link will come back when the "issues" are resolved.

By the way, a fun fact of the boot code is that it runs on the GPU, not on the ARM. The reason for that is that at first this broadcom SoC didn't have an ARM cpu!

I heard it actually was Gert van Loo who was one of the people that was involved in putting an ARM CPU on the chip, so that it not only could be used as a graphics processor, as it was designed, but also had a (weak) applications CPU. But because the ARM was an "afterthought" the chip still boots code for the GPU!

Thanks to this last minute change its now possible to run Linux (and RiscOS) on this SoC!

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 6:55 pm

Burngate wrote:
solar3000 wrote:Which wiki?
The Wiki is hidden so that only Linux gurus can find it.
Having been shown where it is, you are now officially a Linux guru.
Congratulations

I've never seen it. I've seen elinux, but not that page.
I've only been Pied about a month. So forgive me master.
Antikythera

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 6:56 pm

mahjongg wrote: but it seems the RPF has "issues" with the wiki, so the link has been removed.
Ooo, that sounds ominous - technical or controversial?

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 7:05 pm


thanks.
that was excellent.

I'm going to try to put as much of the SD card contents on a file server as possible.
Not sure if its a good idea. but it can't hurt. except perhaps an SD card or two.
Antikythera

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12010
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 9:33 pm

bob_binz wrote:
mahjongg wrote: but it seems the RPF has "issues" with the wiki, so the link has been removed.
Ooo, that sounds ominous - technical or controversial?
I can really only speculate, but there was some talk about switching to a dedicated wiki, as the current one is shared between many other devices, which gives problems with "going to the home page", and with searching. Also as simply another wiki editor instead of the wiki's moderator the foundation had insufficient control over the wiki. and the original moderator has vanished it seems.

Also, lately we have seen a spate of controversial edits where commercial enterprises have abused the wiki as a way to get people to go to their commercial sites to buy PI related wares. Nobody objected, (by reverting the edits, on a continuous base) and for lack of moderation rights it wasn't possible for the RPF to put a more radical stop to it.

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

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 9:35 pm

solar3000 wrote:I'm going to try to put as much of the SD card contents on a file server as possible.
Not sure if its a good idea. but it can't hurt. except perhaps an SD card or two.
You can put almost all of the SD card contents on a Linux file server. I don't think you can do that much if you have a Windows type file server.

Search for "raspberry pi NFS root filesystem" should give you some pointers.

I have done this, but found that using a USB connected hard disk was much faster than my slow file server.

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: how does the raspberry pi boot?

Fri Jun 14, 2013 9:37 pm

mahjongg wrote:
bob_binz wrote:
mahjongg wrote: but it seems the RPF has "issues" with the wiki, so the link has been removed.
Ooo, that sounds ominous - technical or controversial?
I can really only speculate, but there was some talk about switching to a dedicated wiki, as the current one is shared between many other devices, which gives problems with "going to the home page", and with searching. Also as simply another wiki editor instead of the wiki's moderator the foundation had insufficient control over the wiki. and the original moderator has vanished it seems.

Also, lately we have seen a spate of controversial edits where commercial enterprises have abused the wiki as a way to get people to go to their commercial sites to buy PI related wares. Nobody objected, (by reverting the edits, on a continuous base) and for lack of moderation rights it wasn't possible for the RPF to put a more radical stop to it.

Hmm, interesting. Thanks for the info mahjongg

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: how does the raspberry pi boot?

Sun Jun 16, 2013 1:40 am

rpdom wrote:
solar3000 wrote:I'm going to try to put as much of the SD card contents on a file server as possible.
Not sure if its a good idea. but it can't hurt. except perhaps an SD card or two.
You can put almost all of the SD card contents on a Linux file server. I don't think you can do that much if you have a Windows type file server.

Search for "raspberry pi NFS root filesystem" should give you some pointers.

I have done this, but found that using a USB connected hard disk was much faster than my slow file server.

I already have samba running. what do you think? what do you think of this setup that is?
Last edited by solar3000 on Sun Jun 16, 2013 11:49 am, edited 1 time in total.
Antikythera

W. H. Heydt
Posts: 10575
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: how does the raspberry pi boot?

Sun Jun 16, 2013 4:17 am

rpdom wrote: IPL being "Initial Program Load" of course.
Correct...and not to be confused with Initial Microcode Program Load (IMPL) from the System/370. IBM came up with the 8" floppy disk to store the data needed for IMPL.

unclejed613
Posts: 55
Joined: Sun Jan 15, 2012 10:49 pm

Re: how does the raspberry pi boot?

Sun Jun 16, 2013 6:22 pm

when i was young (about 10 i think) my uncle gave me a book on IBM programming. it was part of a course he took. it was a course on machine code for one of the more common IBM machines of the day (this was about 1968), but i don't remember which machine... that was my first exposure to programming. i don't remember if i made it through the whole book and the quiz excercises, but i had a fairly good grasp of it... i thought EBCDIC was a bit clunky though.... when ASCII became the norm years later, i saw how much easier it was to work with.... i could however "read" a hollerith card.... which at the time was used for phone bills and everything else.... i remember "reading" my mother's phone bills from the punch card that came in the mail.....

W. H. Heydt
Posts: 10575
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: how does the raspberry pi boot?

Sun Jun 16, 2013 9:25 pm

unclejed613 wrote:when i was young (about 10 i think) my uncle gave me a book on IBM programming. it was part of a course he took. it was a course on machine code for one of the more common IBM machines of the day (this was about 1968), but i don't remember which machine... that was my first exposure to programming. i don't remember if i made it through the whole book and the quiz excercises, but i had a fairly good grasp of it... i thought EBCDIC was a bit clunky though.... when ASCII became the norm years later, i saw how much easier it was to work with.... i could however "read" a hollerith card.... which at the time was used for phone bills and everything else.... i remember "reading" my mother's phone bills from the punch card that came in the mail.....
Back in the day when one would note that "real programmers are buried face down, nine edge first."

EDCDIC makes sense, if you understand it. It is a true 8-bit code. ASCII is really a 7-bit code. One thing they have in common, though, is that the difference between the bit patterns for lower and uppcase letters a blank (x20 in ASCII, x40 in EBCDIC). A major difference is that ASCII numbers are low and EBCDIC numbers are high (Fn, for digit value n).

As for languages... Could have been just about anything at that time from JCL (either OS or DOS), ALC (aka BAL), COBOL, FORTRAN, or even Autocoder to be run under emulation.

plugwash
Forum Moderator
Forum Moderator
Posts: 3433
Joined: Wed Dec 28, 2011 11:45 pm

Re: how does the raspberry pi boot?

Sun Jun 16, 2013 9:35 pm

Afaic EBCIDIC was based on a code that assigned BCD numbers to characters. So all the main characters have codes that correspond to BCD numbers while the positions that don't correspond to BCD numbers are used for special stuff that was added laters (and often varied between different EBCDIC code pages). This is in contrast to ASCII based systems where the lower half of the code space was assigned to ASCII and the upper half was used for vendor specific extensions.

W. H. Heydt
Posts: 10575
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: how does the raspberry pi boot?

Mon Jun 17, 2013 3:05 am

plugwash wrote:Afaic EBCIDIC was based on a code that assigned BCD numbers to characters. So all the main characters have codes that correspond to BCD numbers while the positions that don't correspond to BCD numbers are used for special stuff that was added laters (and often varied between different EBCDIC code pages). This is in contrast to ASCII based systems where the lower half of the code space was assigned to ASCII and the upper half was used for vendor specific extensions.
There were pretty much three precursors for EBCDIC and the System/360. If you look at the 1401 (which not only gave some instruction background, but printers as well, like the 1403 and, eventually, the 1403N1), the 1620, and the coding on cards from tab machines. The low order nybble of the alpha characters follows the pattern of Hollerith card coding, and the high-order nybble is reminiscent of the zone punches in cards.

And...damn you...this discussion made me dig out my green card...

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

Re: how does the raspberry pi boot?

Mon Jun 17, 2013 5:48 am

I rarely had to deal with EBCDIC, usually using 7-bit (or 8-bit) ASCII on home computers and PCs, the odd system the ZX80 had, 6-bit BCD (GBCD) and 9-bit ASCII (where the 8th and 9th bits were always 0) on mainframes.

If I remember the ZX80 character set correctly, it started with the numbers "0" to "9" as characters 0x00 to 0x09, then letters with "A" being 0x0a. It made hex to decimal and back very easy when the character codes for "0" to "F" matched the numeric value.

W. H. Heydt
Posts: 10575
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: how does the raspberry pi boot?

Mon Jun 17, 2013 4:29 pm

W. H. Heydt wrote: And...damn you...this discussion made me dig out my green card...
...which has a handwritten note on it--in my handwriting--of my last name and a date: 9-3-71. That was probably so that if someone borrowed it, I'd get it back.

(As an aside...is doing a followup to ones own post like talking to yourself?)

Return to “General discussion”