Develop an Operating System – Am I Crazy?

It is no small task to build an operating system. In fact, I often question my own sanity when contemplating the task before me. Why on Earth would I want to build my own operating system, and why would I try to do such a thing myself?

My interest in operating systems started in my junior year of college, when I took a course on operating systems as part of my Computer Science degree. From the start, I was totally into the internal workings of the kernel – schedulers, task management, memory management – it was really cool stuff. We wrote a couple simple programs in C++ that would handle different responsibilities, such as a round-robin scheduler, or a “memory manager” that was basically an implementation of a stack, etc. However, we never got to tie all the stuff together into an actual operating system. The course was more about the concepts than actually putting together an OS.

The next semester, I took a course in computer architecture, which took me down to the hardware level. I learned about CPUs and what was inside them, clock timing, system busses, RAM, everything. There was a lab that went along with this class, and while the class was cool, the lab was really cool. The lab was where we got to actually put our knowledge into practice.

In the lab, we would all be given breadboards, wires, and various CPUs or other logic chips. First, we would have to figure out how to wire things together to get the system that we wanted. Then we actually hooked the breadboard up to a running computer and wrote simple programs to run on our boards. The chips were 8086s, so we used 8086 assembly language to program the things. Up until this point, I’d worked only with high-level languages like C/C++ and Pascal, and assembly language just blew my mind. Now I needed to worry about the individual bits, and needed to be familiar with the processor itself to program it successfully. Others got frustrated, but I fell in love.

Once I graduated, I took a couple of courses in grad school, including an operating systems course. Once I was done with that, I continued to research and learn about operating systems on my own. It’s funny – when I was in school, I barely cracked open the textbooks. But once I graduated, I found myself buying textbooks on operating system design and construction and actually reading them for fun!

So why would I want to write one myself? Well, I think the idea of having total control of the hardware is pretty cool. When you’re writing an OS, it’s just your code going directly to the metal. And to be able to completely organize and manage the allocation of that hardware and those resources is just a really interesting problem to try to solve. I’ve never thought of myself as a control freak, but perhaps in this regard I am a little bit. The system is MIIINE, completely under my control – Mwuhahahah!

OK – I feel better now. 🙂

I think that the size and complexity of the problem is also part of the draw. If some day, years down the road, I get a solid kernel up and running, and applications (however simple) executing on my OS, I’ll feel a great sense of accomplishment. In my day job, I write business applications – and really, where’s the excitement in that? Building an operating system though, well, that’s for the hard-core developers. If I build my own OS, I’ll be part of a very small club. A true hacker.

Why try to do this myself? Well, it is going to be a hobby for me, a pet project. I’m going to write all the code myself because I want to learn all the gritty details. I love to learn, and I’m treating this project as a giant learning opportunity. If someday I get it to a point where there’s something bootable and somewhat stable, perhaps I will invite other programmers to join the fray.

But just because I’m planning to write the code myself doesn’t mean that I’m doing it alone. There’s a pretty good community of “os-devers” out there, and most are willing to lend a hand with advice or problem-solving or both. I kind of liken it to the phenomenon of NaNoWriMo – National Novel Writing Month. The point of NaNo is to write a 50,000-word novel in a month. A daunting task, no? Well, I participated in NaNo in 2005, and the best part about the project was the supportive community of fellow writers who were all toiling along beside me, sharing the same trials and tribulations. The OS Developer community is very much like that.

I plan on being an active participant in the OS Dev community. I’m not going to be afraid to ask questions, and I will answer other people’s questions when I can. And I’ll document the entire process on this blog, so that other people can learn from my mistakes and successes, and perhaps offer me guidance or encouragement when I need it.

So am I crazy? At this point, I would have to say – nope. I understand the monumental task before me, and I’m going into it with realistic expectations. I’m doing it because I enjoy the work, and the learning, and the challenge.

Am I a little intimidated? You betcha! I would be crazy if I wasn’t.

Am I excited? Again, you betcha! I’m totally looked forward to the adventure that developing M3 will be. I hope that you’ll stick around for the ride.