Operating systems development with the Raspberry Pi

Even though the Raspberry Pi has, from the very beginning, been touted as an educational computer, we’ve seen neither hide nor hare of coursework, lesson plans, or even computer sciencey tutorials using the Raspi. We’re guessing academia works at a much slower pace than the average hardware hacker, but [Alex Chadwick] at Cambridge University has managed to put together an online tutorial on developing an operating system from scratch for the Raspi.

The goal of this tutorial is to throw a budding Raspi tinkerer into the strange and confusing world of registers, hexadecimal, and ARMv6 assembly. After going through the necessary toolchain, [Alex]‘s tutorials cover blinking the ‘OK’ LED on the Raspberry Pi using only assembly.

The OS development guide goes on from there to include drawing graphics on the screen and even accepting input from a USB keyboard.

It’s important to point out what [Alex]‘s tutorial isn’t; even though this series of tutorials goes through manipulating the bare metal of the Raspberry Pi, don’t expect to be porting UNIX to the Raspi after going through these guides. That being said, after completing these tutorials, you’ll be in a fabulous position for building your own homebrew OS on the Raspberry Pi.

Comments

  1. awj says:

    why even bother with Rasp when you can use Siemens S7 PLCs that uses much nicer STL

    • eroomde says:

      This is a deeply confused question that rather suggests that you don’t really understand what you’re saying.

      There is a world of difference between these two things, it’s difficult to distill it into a blog reply. The best way to illustrate is to say that if you can reply to my message here on a machine built entirely with 7000 series logic, and you think it’s easier than using a pc, then I will concede the point to you. If not, you have your answer.

    • Matt says:

      why eat steak when you can have a pizza? Different folks, different strokes…

  2. csdominik says:

    Maybe the price, and full connectivity on board. :)

  3. BBotany says:

    It has this gem hidden in there: “I’m pleased to say I did get one [USB host driver] that works with no external help from the Operating System, and can talk to a mouse and keyboard. It is by no means complete, efficient, or correct, but it does work.” That is Fab to have around!

    And a lot more detail on what the Pi is doing at various operation points without RTFS (source) annoyances.

  4. Beat707 says:

    I love this. We are now one step closer to a low-latency audio solution on the RPi. :-)

  5. hardcorefs says:

    Most Universities do not publish their course work, purely because it costs money to develop it.
    They can then sell it on at a massive profit, in excess of $2,000usd per student.

  6. Galane says:

    “…fabulous position for building your own homebrew OS on the Raspberry Pi.”

    Or “bare metal” booter games the likes of which haven’t been seen since the days of the IBM PC, PC/XT and Amiga.

    The early IBMs were simple enough and even the clones were close enough to the IBM to be identical that it was possible to write a game that directly accessed all the hardware it needed.

    The Amiga had much of its OS in ROM which was documented well enough that individual programs could be written to make direct ROM and hardware calls, bypassing the need for the part of the OS normally loaded from floppy or hard disk.

  7. Isaac says:

    This is really cool. It’s something that I’ve always wanted to do… but be it Linux or FreeRTOS or something was always available that meant I didn’t have to…. I might just give it a go.

  8. max says:

    I thought operation systems were all about implementing a memory management scheme (using the MMU) and also amongst others thread scheduling I can’t find any of this in the University’s coursework.
    Shouldn’t this just be called “bare metal” programming for the raspberry pi?

    • jyio says:

      Then, I think you just learned that not all machines have MMU’s (i.e. many embedded platforms), not all operating systems require MMU’s (i.e. uClinux), and some operating systems do not multithread or multiprocess (i.e. DOS).

      But if you’re clever, you could implement these things on top of Baking Pi, and have an even better operating system. Good luck!

    • Gdogg says:

      True most OSs implement a memory management system (malloc, free, etc). That doesn’t mean they use the MMU. A lot of chips don’t have MMUs.

      OS is, at its most basic, a task scheduler (doesn’t even need to support multiple tasks), an application loader, and a basic abstraction of the hardware underneath.

  9. bogdanm78 says:

    This. Is. AWESOME. It opens the path for LOTS of potentially cool projects on RPi. Thank you very much for your work.

  10. Mental2k says:

    I’ve considered teaching myself enough to write a basic x86 OS for years. Never quite had the motivation, or found a set of tutorials anywhere near comprehensive enough. So I might give this a go +1!

  11. bloodbone says:

    Maybe it will awake the Demoscene.

  12. Rick says:

    http://www.themagpi.com/

    Read all five on-line (and pdf) published issues, and THEN say that there is nothing out there for the Pi!

    May they be overwhelmed by the HAD effect.

  13. I would love to write my own OS (preferable in C), but I cannot find how to use the network adaptor and the GPU.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,553 other followers