Page 1 of 1

how does the raspberry pi boot?

Posted: Thu Jun 13, 2013 6:59 pm
by usermcmuffin
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?

Re: how does the raspberry pi boot?

Posted: Thu Jun 13, 2013 7:24 pm
by jamesh
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.

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 1:47 pm
by solar3000
Which wiki?

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 1:55 pm
by bob_binz

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 5:02 pm
by W. H. Heydt
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?)

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 5:06 pm
by rpdom
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!)

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 5:16 pm
by Burngate
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

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 5:40 pm
by mahjongg
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!

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 6:55 pm
by solar3000
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.

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 6:56 pm
by bob_binz
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?

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 7:05 pm
by solar3000

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.

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 9:33 pm
by mahjongg
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.

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 9:35 pm
by rpdom
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.

Re: how does the raspberry pi boot?

Posted: Fri Jun 14, 2013 9:37 pm
by bob_binz
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

Re: how does the raspberry pi boot?

Posted: Sun Jun 16, 2013 1:40 am
by solar3000
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?

Re: how does the raspberry pi boot?

Posted: Sun Jun 16, 2013 4:17 am
by W. H. Heydt
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.

Re: how does the raspberry pi boot?

Posted: Sun Jun 16, 2013 6:22 pm
by unclejed613
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.....

Re: how does the raspberry pi boot?

Posted: Sun Jun 16, 2013 9:25 pm
by W. H. Heydt
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.

Re: how does the raspberry pi boot?

Posted: Sun Jun 16, 2013 9:35 pm
by plugwash
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.

Re: how does the raspberry pi boot?

Posted: Mon Jun 17, 2013 3:05 am
by W. H. Heydt
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...

Re: how does the raspberry pi boot?

Posted: Mon Jun 17, 2013 5:48 am
by rpdom
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.

Re: how does the raspberry pi boot?

Posted: Mon Jun 17, 2013 4:29 pm
by W. H. Heydt
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?)