TheOS

Operating systems books
TheOS was my attempt at writing a tiny, portable operating system (before I worked on the real thing at Microsoft). 

It was a 32-bit protected mode OS written in C and assembly language.

I’d been fascinated with OS design since my teens, having read many books and papers.  I was inspired by microkernel systems like QNX, MicroC/OS II and Amoeba. (I thought Linux had a very crude design; oh well.)

Writing a toy OS falls into the “Ultimately useless, but fun and educational” category.

Watching my laptop boot, then typing words on the screen and seeing them echo across a serial cable to another computer, was pretty neat.

TheOS - a 32bit protected mode hobby operating system.

I learned a lot writing TheOS:

  • x86 assembly language
  • boot loaders
  • handle-based resource management
  • interrupt service routines
  • timers, serial ports, disks, keyboards, displays
  • memory management
  • data structures

The fun thing about bringing up bare metal (besides making the lights blink) is that you get to do a little bit of everything. 

Need printf()?  Write it.  Need hash tables or a memory manager?  Write them. Finally, the chance to use a few chapters from The Art of Computer Programming.

I got as far as booting and launching a couple tasks, basic I/O (keyboard, display, serial port), and was writing the IPC code. I had to stop after joining Microsoft.