Skip to content
daniel@cosenza:~/blog
FreeDOSDeep Dive February 10, 2026 4 min read

FAT12 and FAT16 Internals: The Filesystem Behind FreeDOS

How the File Allocation Table represents files as linked chains of clusters, and why that simple design has both strengths and hard limits.

FAT is one of the simplest filesystem designs still in real use, and FreeDOS relies on it directly: FAT12 for floppy disks and small volumes, FAT16 for larger hard disks. Its entire structure fits in a mental model far smaller than NTFS’s MFT-based approach or a Unix inode table — which is both its charm and its ceiling.

The core idea: a table of cluster chains

A FAT volume divides its data area into fixed-size clusters, and the File Allocation Table itself is just an array with one entry per cluster, recording what comes next in that file’s chain — or a special value marking end-of-file, a bad cluster, or free space.

Cluster:  5    6    7    8
FAT[5] =  6
FAT[6] =  7
FAT[7] = EOF

A file that spans clusters 5, 6, and 7 is represented purely by that chain — the directory entry just needs to know the first cluster, and the FAT itself lets you walk the rest.

C:\>chkdsk C:

The root directory and directory entries

Each directory entry is a fixed-size (32-byte) structure holding the filename (in the classic 8.3 format), attributes (read-only, hidden, system, directory), timestamps, the starting cluster number, and the file size in bytes:

C:\>dir /a

DATA     TXT       1024  01-15-2026  10:30a
SUBDIR   <DIR>            01-15-2026  10:31a

FAT12/16’s root directory is special: it has a fixed maximum size, set when the volume was formatted, unlike subdirectories (which are just regular files containing directory entries and can grow like any other file). That fixed root directory size is one of several hard limits baked into the format.

Why FAT12 vs. FAT16 vs. FAT32

The number in the name is literally the bit-width of each FAT entry — 12-bit entries (FAT12) support at most 4,086 clusters, which is exactly why FAT12 is only practical for small volumes like floppy disks; 16-bit entries (FAT16) support up to 65,526 clusters, extending usable volume size considerably (at the cost of needing correspondingly larger clusters on bigger disks, which wastes space through internal fragmentation on many small files). FAT32, developed later, uses 32-bit entries and removed several of FAT16’s more painful limits, but classic FreeDOS/DOS environments are most commonly associated with FAT12/16.

FORMAT A: /FS:FAT

Long filenames: VFAT as a compatibility trick

The original FAT format only supports 8.3 filenames — the VFAT extension (which FreeDOS supports, noted in ver’s “FAT32-LFN” designation) adds long filename support by storing extra directory entries marked with a special attribute combination that legacy DOS tools ignore entirely, alongside a generated 8.3 “short name” alias — so an old program sees PROGRA~1 while a long-filename-aware one sees Program Files, both referencing the exact same directory entry chain underneath.

C:\>dir /x

/x shows both the short and long name side by side, exposing exactly this dual-representation trick.

Fragmentation: a direct consequence of the chain model

Because a file’s clusters can be scattered anywhere free space exists on the volume — there’s no requirement that a file’s chain be contiguous — heavy use naturally fragments files across the disk, which is why defragmentation tools were such a fixture of the DOS and early Windows era: physically rewriting files so their cluster chains become contiguous again, directly improving sequential read performance on spinning media.

C:\>defrag C:

Recovering from corruption

Because the FAT itself is the single source of truth for every file’s cluster chain, DOS keeps a second copy of the FAT on disk specifically as a recovery fallback — if the primary table is damaged, tools can reconstruct from the mirror copy, which is a much more primitive but conceptually similar safety net to NTFS’s $LogFile journal or ZFS’s copy-on-write consistency guarantees.

C:\>chkdsk C: /f

Why this design still matters

FAT’s genuinely simple, fully-documented on-disk structure — one flat table, fixed-size directory entries, no journaling, no B-trees — is exactly why it remains the universal lowest-common-denominator format today, still used for EFI System Partitions, camera SD cards, and USB drives specifically because virtually anything can read it. FreeDOS relying on FAT12/16 isn’t a limitation imposed on it; it’s a faithful continuation of the exact filesystem design DOS software has always assumed, and understanding its cluster-chain model end-to-end is most of what you need to understand why FAT behaves the way it does everywhere else it still shows up today.