Ktux

A 32-bit simplistic OS written from scratch in C and x86 assembly for learning purposes.



This was an attempt to write an OS from scratch in order to learn more about the x86 architecture and how operating systems function at a base level. There was never any intention for it to be anything resembling a full-fledged usable OS. It was simply a learning tool, a toy to play with. The planning for it followed a similar principle: little to no effort was focused on that. Just enough code was written to demonstrate a working prototype, then attention was shifted to another aspect that needed attention.

That being said, there were some high-level goals I wanted to accomplish with Ktux, specifically around features to leverage of the x86 instruction set:

  • Full 32-bit protected mode
  • Preemptive interrupt-driven multitasking kernel
  • Paging and virtual memory
  • Dynamic loadable modules
  • Disk IO support

The first 3 of these ended up getting implemented in some fashion, the remaining 2 less so. There is also the basic framework for processes (kernel threads really) with a scheduler, some rudimentary console IO support and the beginnings of a syscall handler. Ktux does also handle the full boot process from the BIOS via a FAT12 virtual disk image. At one time during it’s development in the early 2000’s, I was testing and successfully booting from a floppy drive.

Eventually I got to the point where I had felt I learned enough about the basics to have a solid grasp on how the x86 architecture functions in protected mode, and how to use that to create the foundation for an operating system. Not much further efforts have been put in since then, but it was a fun and very educational exercise to say the least!

Leave a Reply

Your email address will not be published. Required fields are marked *