About

I decided I wanted to write an embedded OS with security as the focus. I also thought it would be cool to target the Raspberry Pi 3 Model B (henceforth called "3B") since it's cheap, powerful, and fairly well supported. Having decided my goal and the platform, the biggest decision I had remaining was what language I should use. I like C, but it's difficult to avoid shooting yourself in the foot with C. I considered writing some preprocessing hooks to handle things like range constraint checking and the like but decided to look around to see what was currently available. D was the first thing that came to mind but I wasn't necessarily sold (the compiler variants didn't make me that happy with it). I also found some other "pseudo Cs" that were interesting but not what I was looking for. I also considered Ada (I have a strong background in Ada) but really wanted something that felt closer to the hardware. And then I happened to see someone make a facetious comment on slashdot about Rust and wondered, "What's Rust?" The info at rust-lang.org jived with my needs, it was an active project, there was a reasonable manual and tutorial - sounded like a good candidate. I chewed through the guessing game tutorial and then let that gestate for a bit while I did other things.

At the same time that I was trying to pick a language, I was also working on getting Das U-Boot running on my 3B. That's still a work in progress, but it did give me the opportunity to dig into the resources available for the new 3B. Much has changed in the hardware and Broadcom isn't exactly speedy nor open with their SoC documentation. Fortunately, @swarren has not only been working on u-boot for the 3B, but also some other "bare metal" odds and ends. The one that I really needed was this: a dead-simple demo of serial I/O on the 3B (the 64/ folder contains the code I used). Once I got that working, I felt like I was ready to jump back into the Rust part of things. But, honestly, I didn't know enough about Rust to know where to go next. That's where Philipp Oppermann's Write an OS in Rust came in.

@phil-opp has been writing an absolutely fantastic blog detailing his steps in bringing up an OS from first principles on an X86_64 PC (he's using QEMU, but it works just as well on VirtualBox or actual hardware). I found his blog riveting and educational. It was like binge-watching Netflix or reading a novel that I couldn't put down. When I had gotten current with his blog (it's an ongoing project), I felt ready to apply those lessons to the 3B.

So, in homage to Philipp's blog, and as a way to give back what was so freely given to me by him (prompted by a comment he made on the rust subreddit), I'll be blogging my experience in porting his OS to the 3B. I like the format of his blog, so I'll be following a similar layout and all of the blog and the ported code will be here on github.io and github.com.