Floppy Disk

The floppy disk drive is an antiquated bit of hardware which is rarely found on any modern computer shipping today. This begs the question of why we’d even care about it when writing our own hobby operating system.

Well, here are some good reasons:

For starters, it’s easy to create and use bootable floppy images which makes testing much easier, particularly in virtual machine hosts and emulators. You can, of course, do this with hard disk images too but it’s a little more involved and, if you’re anything like me, you’ll be writing, fixing and rebooting frequently! :) Also, I have one or two old machines lying around with floppy drives and these mean I’m able to get my young kernel loaded and tested on real hardware quickly.

Secondly, writing a floppy disk driver and supporting floppy I/O is significantly easier than jumping straight to a hard disk support which, by the way, can also mean driving the bus it’s attached to. You can use port-based I/O to implement trivial IDE hard disk support but as soon as you start with ATA, PCI, bus mastering, DMA etc. then you’ll get that “firehose at a teacup” sensation!

Writing support for floppy I/O is a nice, relatively gentle introduction to this whole space. It will introduce you to some basic I/O concepts, some DMA, interrupt handling and so on. This will be a useful “trainer” for the world of hard disks.

Finally, both floppies and hard disks have file systems on them. This means you’ll need to start writing file system code to find and access data on disks. Floppies are a nice, simple and small device to test your basic file system code with.

Personally I found it convenient to implement floppy support but ultimately, it’s entirely up to you. If you don’t want to work with floppies, you don’t need to. If you do decide to write floppy support into your OS, then hopefully the articles below will be useful (I don’t even bother with anything older than the ubiquitous 3.5″ 1.44 MB floppy). Have fun!

Jimmo’s articles in the “floppy disk” category

Useful links and resources