Introduction
But what is an operating system?
You can think of an operating system as a link between hardware and software (sometimes placed under the category of firmware, which includes other stuff like drivers, etc.). It handles the start-up of the computer, and (among other things) manages memory and processes that will run on the computer.
Operating systems also provide some way for the user to interact with the system, usually either by using a Command-Line Interface (CLI) or a Graphical User Interface (GUI). A GUI is what most people prefer to interact with, where you see text and images drawn to the screen and you can interact with them using a mouse. A CLI, on the other hand, is a text-based interface (often associated with the olden times). Give the computer a command to run, it runs it, and writes back to you with the results. Tom Scott once described it as “like having a text message conversation with your computer”… yikes!
Why build an operating system?
Like many other programming projects, the question of why build one is a bit hard to answer. Why build a game engine? Why build an IDE? Why? Whether you’re looking to gain a better understanding of how your computer works, or you’re looking for the satisfaction of working on a large project, it’s up to you to decide why you want to build your operating system. Ultimately, if you set a clear goal for yourself, you are much more likely to continue having motivation to keep chugging away at it.
If you’re in this because you think it’ll be an easy project… turn away now. The truth is: OS development is hard. But I don’t say this to discourage you from it, it’s extremely rewarding as well. Having more experience with C/C++ and Assembly will certainly be helpful, but not having it isn’t a deal-breaker if you’re willing to put in the time to learn along the way.
What you’ll find in this tutorial
This tutorial will guide you through building up a bootloader and kernel from scratch. It will provide all the code needed to do so, with checkpoints along the way (so you have a reference if you’re following along).
However, if you’re looking for the most detailed explanations of why some things are, this is not the place. I strive to detail as much as I can (to ensure that it’s possible for you to have a basic-intermediate understanding of what’s going on), but there comes a point where it’s just an overload of information. Making the sacrifice in detail (believe me, there’s still plenty of detail here) allows this guide to be a better reference for other parts of the development of an Operating System.
If you are looking for that extra bit of detail to supplement this guide, the OSDev Wiki is what you’re looking for.