Sooooooooooo… For a long time now I’ve wanted to write an operating system. I started a couple times but the furthest I’ve gotten was just booting into an infinite loop that displayed some text at a static location on the screen. No processes, no entry, no nothing.
Enter the Raspberry Pi
A few years ago (or at least what seems like it) the Raspberry Pi (I’m going to refer to it as the RPi) was announced. If you want to know the details, they have it on the RPi site. A generalized explanation of it is that it was created as a cheap computer to use for education to combat the shrinking number of students with Computer Science degrees. Since I’m obsessed with tech toys/gadgets I knew I would get one once they were released.
The RPi has since been released and is sold out pretty much everywhere that sells them. I finally ordered one a few weeks ago when I decided to stop putting it off until someone actually had one in stock. Thankfully it was shipped quickly and arrived yesterday.
RPi OS Development
Before my RPi arrived I’d seen an article about OS development focusing around the RPi. Reading through the article sort of… reinvigorated my interest in working on an OS. I realized at that point that the RPi was the perfect target for my OS. It’s a very minimal, ARM-based system that doesn’t have much more than the bare minimum required to actually run. It doesn’t even have a real-time clock built-in.
As I was reading up on various topics relating to RPi OS development I realized that the things I was learning about may be just as interesting to someone else as they were to me. I decided to document what I learn in the hopes that someone reading this will find it as a helpful, all-in-one location to get started. It’ll also be a nice reference to show me where I originally found some information if I ever need to re-read it.
The posts are going to be very informal (I dislike formalities and find them to be annoying) and may not make complete sense at times. I like to watch TV and I’m usually doing multiple things at the same time so my writing isn’t very focused. :) I’ll do my best to proof read my posts before I actually publish them, though. If anything is confusing, though, please feel free to get in contact with me and let me know so I can clarify things.
So What Did I Learn Tonight?
I’ve decided that I’m going to use clang as my primary compiler for the project and that’s been presenting a bit of a problem. Many of the OS development resources I’ve found focus on GCC, so I need to find some way to “port” all the command line options to clang. A lot of them are similar so it’s not as much of an issue, but the biggest problem I’m seeing right now is that the linker on my Mac doesn’t support linker scripts (for defining where each section goes in memory).
I’ve also been learning more about a lot of acronyms that I’ve heard of but never really cared about before: GPIO, I2C and JTAG. It seems like GPIO are just the pins you can use to interact with external hardware. I2C I haven’t really looked into, but I think it’s another protocol (or whatever you’d call it) to interact with external hardware. The last, JTAG, seems to be a way to debug things at the hardware level. It’s really hard to debug an operating system since you can’t run it on the same system you’re actually doing development on (unless you’re using something like QEMU), so JTAG provides a way to communicate with the hardware at a level lower than you normally would. Once I figure out how to get things building with clang I’ll be trying to figure out JTAG next. From what I’ve read it sounds like you can also send binary files over JTAG for the device to execute, providing a faster way to try out new versions instead of needing to copy the files over to an SD card, plugging it in and booting up the RPi.
Here are some sites i found tonight that provide some good information that I’m going to go back and re-read: