kernelthread.com

A Hanoi Operating System for the x86

The Hanoi Toy Operating System

This is an operating system implementation of Hanoi. It includes a simple bootstrap loader for the x86, and a very simple kernel. The system boots and presents a shell-like prompt. The shell prompts for a valid integer input, which is used by the kernel as the number of disks for solving the puzzle. The list of moves is thereafter printed.

There are a few user-friendly features, actually! You can type "?" for help. There is a clock in the top right corner (it was too tempting to put the timer interrupt to some use), and there is even a screen blanker (kicks in after a minute or so). TSRs are a kludge, but I put them in just for the heck of it ...

You may click here to see an "interesting" way to run HanoiOS.

The source archive contains a few assembly files and some common definition files. You will need Nasm to assemble them:

nasm -f bin boot.s nasm -f bin kernel.s

Thereafter, you can just cat the boot sector and the kernel onto a raw floppy device (assuming you are doing this on a Linux machine):

cat boot kernel > /dev/fd0

If you do not wish to compile the code yourself, or do not have access to Nasm, you can simply dump the file fd.img in the source archive to a floppy:

cat fd.img > /dev/fd0

And that's it. Ready to boot! Please note that it is not ruled out that some BIOS nuances may cause HanoiOS to behave weirdly, or not boot at all. No big deal there - this is not Linux!

hanoi-tos-x86.tar.gz

Download

hanoi-tos-x86.tar.gz