How to write an Operating System

From ArticleWorld


Writing an operating system is one of the most challenging and interesting tasks a programmer will do in his career. An operating system is a very complex piece of software, and you will need some good programming skills in order to write one.

How to start

You will obviously need a good understanding of how operating systems work. Start by trying, experimenting and hacking small parts of existing operating systems. Do not limit yourself to a single platform: even old operating systems, written in the 1970s for mini-computers like the PDP-11, or more recent one, but targeted at other platforms (like PPC or ARM) can give you some valuable experience.

The next step is to actually study how an operating system is constructed and what makes it "tick". Books like Tannenbaum's classics will offer you a good start, but they're not necessarily a definitive guide. A lot is written on operating systems-related topics, and you should check online (and offline) resources.

Once you have a general picture of what your operating system will be like (single-tasking or multi-tasking? Multi-user or not? If multitasking, pre-emptive or cooperative? etc), write specifications and some initial documentation. The project is so large that writing these is highly important.

What you will absolutely need

You will need to have some excellent programming skills. While you can safely do without much ASM these days (chances are every significant and non-innovative part of an operating system that requires assembly programming on the x86 platform has already been covered), writing an operating system without knowing a higher-level programming language is virtually impossible. C seems like the definitive option today, although languages like C++, Pascal and even Java are catching up.

You will also need a fairly good amount of patience. Writing an operating system as a single-man effort requires a lot of motivation.

Besides this, you will need the "usual" tools: compilers and assemblers come first. Hardware to test your system on is also required (you can use an emulator like Bochs, QEmu or VMWare for this), along with device drivers, relevant hardware for writing them and so on.