Read, write, delete, mkdir, rmdir, rename, format — all in C, no assembly.
This book takes you from first sector to a complete, dual-platform FAT12 implementation. 11 chapters, ~1500 lines of C, one evolving codebase that compiles zero-warning on both your development machine and in QEMU as a 32-bit kernel.
Leanpub sample includes chapters 1–3. No email required for the PDF.
The manuscript is content-complete and I'm polishing it based on reviewer feedback. If you'd like a free copy in exchange for your thoughts, send me an email:
fat12@softwarefreak.netEvery on-disk structure comes with a color-coded field map — no guesswork, no "offset 27 stores the first cluster, trust me." Here is the BPB layout, byte 11 through 35:
11 chapters, ~1500 lines of C, one evolving codebase:
Clean C, no magic. Here's the core typesystem your FAT12 driver starts with:
typedef struct { uint8_t jmp[3]; uint8_t oem[8]; uint16_t bytes_per_sector; uint8_t sectors_per_cluster; uint16_t reserved_sectors; uint8_t fat_count; uint16_t root_entry_count; uint16_t total_sectors_16; uint8_t media_descriptor; uint16_t fat_size_16; uint16_t sectors_per_track; uint16_t head_count; uint32_t hidden_sectors; uint32_t total_sectors_32; } __attribute__((packed)) BPB;
You — if you're building a hobby OS and need a filesystem driver. You know C (pointers, structs, bit manipulation) and want a complete FAT12 implementation you can drop into your kernel.
OS Design Book Series by Ben Lunt — a comprehensive deep dive into operating system internals.