Adolfo Ochagavía

The high-level OS challenge

Since I got into programming, I’ve regularly seen operating-systems tutorials and implementation guides pass by. They always leave a lingering desire behind them, an echo of the well-known siren song: “when are you going to create your toy operating system?” Inevitably, time passes and the desire fades, till the next tutorial shows up and the cycle repeats.

Today I’m breaking the cycle. I’m setting a challenge for myself, and I’m publishing it for the sake of the many curious souls who’d welcome a starting point for their OS adventures. Are you one of them? Jump aboard, fellow traveler!

What does “high-level” mean in this context?

Writing an operating system from scratch involves a lot of low-level drudgery. Getting your operating system to boot in the first place is quite an achievement (and that’s just the beginning1). I already do enough low-level stuff for work, so I want to focus on other things I’d otherwise not learn about.

In this challenge, therefore, I’m aiming to use off-the-shelf software as a basis. The challenge is to build on top of an existing kernel! “But then you aren’t really creating an operating system”, someone might say. I concede that reusing a kernel lets us skip a lot of work, but don’t worry… There’s still plenty to do!

The challenge

Here’s the goal: to create an operating system the average laptop is able to boot (e.g., from a USB stick). The capabilities of the OS should be very limited, of course, because otherwise it would take forever to program. The following set of functionality sounds doable:

The features mentioned above can be tackled in multiple ways, to leave room for creativity. For instance, I have purposefully left out anything related to file systems. Note that all software that runs after boot (including the shell), is meant to be self-written.

Some random thoughts and a plan

It will be a long journey down the rabbit hole, so let me take note of my current mental model and ideas to have a good start:

Let’s get to work!

Now, dear reader, are you ready to create your toy operating system? I’ll spend some time in the upcoming weeks trying to get this all working. I’ll definitely blog about it when I’m done, so stay tuned if you want to hear how things panned out. Also, if you solve the challenge yourself, please let me know about it!


  1. If you are interested in the details, check out Philipp Oppermann’s excellent series on writing an OS in Rust. ↩︎

  2. This free book is a true classic, in case you’d like to know what a kernel ought to do for you. ↩︎