I found this cool tutorial for building an OS from scratch for the Raspberry Pi. Unfortunately, to my dismay, it seems like it hasn't been updated for the 2. Is there any chance it would still work? Otherwise, are there any similar tutorials for the 2 or other good starting points for building OSs from scratch in general?


1 Answer 1


It should be mostly fine; instead of compiling for ARMv6 you are compiling for ARMv7. With regard to the first few lessons involving the LEDs, on the Pi 2 these are the same as the + models, which is slightly different than the earlier ones which those lessons look to target. I think the only significance that will have is that there are fewer LEDs -- but they're only using one or two, and the ACT light may well have the same control address. If not, it is easy to ask specifically about that here...someone knows.

With regard to the graphics lessons, the GPU on all the pi's is the same.

In other words, there may be some hex numbers to change and you'll have to find out their proper values, but otherwise it will all be the same. Part of learning stuff like this is learning how to do research effectively. When you need to ask other people for information, particularly if it is relatively esoteric (this is), make sure you include as much in the way of relevant details as you can but no irrelevant ones, that you ask in the right place, etc. Always worth at least a glance through is Eric Raymond's How To Ask Questions The Smart Way (this is not to imply anything about your current question, which is fine). I cannot emphasize enough that you cannot be smart enough when it comes to asking questions as it can make the difference between finding out what you need to know and not.

other good starting points for building OSs from scratch in general?

Not something I've ever done but I am aware of the OSDev.org wiki.

  • 2
    There should just be a couple of changes to be borne in mind. 1) The activity LED was gpio 16 but is gpio 47 on the Pi2. Because of the way the Pi's gpios work a different set of registers needs to be manipulated on the Pi2 for gpio 47. 2) the peripherals base address has changed from 0x20000000 to 0x3F000000.
    – joan
    Apr 10, 2015 at 14:48
  • This is exactly what I needed. Thanks for the help, I'll take the tips about asking questions to heart. Apr 11, 2015 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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