Programming a 64-bit Operating System

IanOS is an experimental 64-bit operating system written from scratch as a learning experience. The source code is available online and the creator of the OS has made some detailed documentation available to go with the source code. This is an excellent resource for anyone who wants to venture into writing a 64-bit OS. The author makes his intention about this OS clear “I never had any intention of producing a true OS. There are plenty of those about and it would be a very foolish, or vain, person who thought that they could compete with the likes of FreeBSD and Linux. But my interest in computers isn’t practical; I just find programming them, particularly at this level, to be a supremely satisfying intellectual pursuit”.

Writing an operating system from ground up is no small feat. It involves understanding the CPU architecture, structure of a boot sector, memory management, device driver etc. When a newbie decides to learn how to write a hobby OS, the usual advice from the bearded OS gurus is “Poke around Linux kernel”. But the inherent problem with that approach is the lack of proper documentation and the overwhelming size of the project.

IanOS is a 64-bit operating system, that was created for the sole purpose of understanding the initial steps of creating an OS. The disclaimer on the project page reads:

only by a very wide stretch of the imagination could my system be described as an ‘operating system’, but it does boot, multi-tasks simple programs, and even has rudimentary keyboard and IDE hard disk device drivers”

The project page has clear instructions on how to get started. The author recommends a list of tools that he used while developing this OS and some links to the required documentation.

Tools:

  • Host OS – Any flavor of Linux
  • Emulator/Debugger – AMD’s SimNow, qemu
  • Compilers – gcc
  • Editors – Hex editor and an IDE
  • Disk image – mtools

The documentation page is constantly growing and has very specific information about the source code. This definitely makes it easy to follow the code and understand the different sections. It is a perfect place for anyone who is waiting to get started on writing a OS or simply to understand the low-level intricacies of an operating system.

Another great resource for understanding the OS internals and Computer Architecture is Gustavo Duarte’s articles on System Internals. These are some well-written series of articles that explain in detail the Memory Management, CPU Cache, CPU Privileges, Kernel Boot Process and other OS relevant subjects.

11 Comments

    • 2009-02-16 6:44 pm
      • 2009-02-16 7:35 pm
        • 2009-02-17 12:18 am
  1. 2009-02-14 9:59 am
    • 2009-02-14 1:04 pm
    • 2009-02-14 3:04 pm
      • 2009-02-14 3:26 pm
    • 2009-02-14 5:48 pm
  2. 2009-02-14 3:55 pm
    • 2009-02-15 3:28 pm