A filesystem is just bytes on a disk waiting for a decoder ring. This book builds that ring.
FAT12 is the oldest and simplest member of the FAT family — small volumes, simple allocation, flat root directory, and still everywhere: the default for QEMU and VirtualBox floppy images, EFI boot partitions, and embedded firmware. Learn FAT12 once and you already understand FAT16 and FAT32.
You will write every line of code yourself, from the boot sector decoder up to a working cat command in QEMU:
- Build a portable block device abstraction so your filesystem code runs on files and bare metal
- Decode every field of the boot sector and compute disk geometry
- Navigate the famously awkward 12-bit File Allocation Table
- Walk the root directory, read files, and follow cluster chains
- Write files, create directories, delete and rename entries
- Format a disk from scratch
- Port the same library to a 32-bit i386 kernel via ATA PIO and VGA text mode
The code is written for understanding, not production — every I/O check is suppressed to keep the FAT12 logic front and center. Each chapter includes debugging tips and a Production callout explaining what a real-world driver would do differently.
Who this is for: You are building or tinkering with a hobby OS. You know C — pointers, structs, bitwise operations. You have skimmed filesystem tutorials but now you want to actually write one.