FATX - Historical Evolution - File System Types - FAT12

FAT12

Between April and August 1980, while borrowing the FAT concept for SCP's own 8086 operating system QDOS 0.11, Tim Paterson extended the table elements to 12 bits, reduced the number of FATs to two, redefined the semantics of some of the reserved cluster values, modified the disk layout, so that the root directory was now located between the FAT and the data area and changed the size and layout of directory entries from 16 bytes to 32 bytes for his implementation of FAT12, whereas the format used in Microsoft Stand-alone Disk BASIC's 8-bit file system precursor was not supported by QDOS. Soonafter, QDOS was renamed into 86-DOS with version 0.33 in December 1980, and later in 1981 evolved into Microsoft's MS-DOS and IBM PC DOS.

Originally designed as a file system for floppy disks, FAT12 used 12-bit entries for the cluster addresses in the FAT, which not only limited the maximum generally possible count of data clusters to 4084 (for data clusters 0x002 to 0xFF5), or in some contexts to 4078 (for 0x002 to 0xFEF), but made FAT manipulation tricky with the PC's 8-bit and 16-bit registers.

The disk's size was stored and calculated as a 16-bit count of sectors, which limited the size to 32 MB for a logical sector size of 512 bytes. FAT12 was used by several manufacturers with different physical formats, but a typical floppy disk at the time was 5.25-inch (130 mm), single-sided, 40 tracks, with 8 sectors per track, resulting in a capacity of 160 KB for both the system areas and files. The FAT12 limitations exceeded this capacity by a factor of ten or more. (The 32 MB limit was later circumvented using logical sectored FATs with logical sector sizes larger than 512 bytes in some OEM versions of MS-DOS 3.x, but this fell into disuse when FAT16B became available with DOS 3.31, which supported 32-bit sector numbers and thereby further lifted the limits.)

By convention, all the control structures were organized to fit inside the first track, thus avoiding head movement during read and write operations, although this varied depending on the manufacturer and physical format of the disk. A limitation which was not addressed until much later (with FAT32) was that any bad sector in the control structures area, track 0, could prevent the disk from being usable. The DOS formatting tool rejected such disks completely. Bad sectors were allowed only in the file data area and were marked with the reserved value 0xFF7 in the FAT. They made the entire containing cluster unusable.

While 86-DOS supported three disk formats (250.25 KB, 500.5 KB and 1232 KB with media descriptor bytes 0xFF and 0xFE) on 8-inch (200 mm) floppy drives, IBM PC DOS 1.0, released with the original IBM Personal Computer in 1981, supported only an 8-sector floppy format with a formatted capacity of 160 KB (media descriptor byte 0xFE) for single-sided 5.25-inch floppy drives, and PC DOS 1.1 added support for a double-sided format with 320 KB (media descriptor byte 0xFF). PC DOS 2.0 introduced support for 9-sector floppy formats with 180 KB (media descriptor byte 0xFC) and 360 KB (media descriptor byte 0xFD).

PC DOS 1.0 directory entries included only one date, the last modified date. PC DOS 1.1 added the last modified time. PC DOS 1.x file attributes included a hidden bit and system bit, with the remaining six bits undefined. At this time, DOS did not support a hierarchical file system, which was still acceptable, given that the number of files on a disk was typically not more than a few dozen.

The PC XT was the first PC with a hard drive from IBM, and PC DOS 2.0 supported that hard drive with FAT12 (media descriptor byte 0xF8). The fixed assumption of 8 sectors per clusters on hard disks practically limited the maximum partition size to 16 MB for 512 byte sectors and 4 KB clusters.

The BIOS Parameter Block (BPB) was introduced with PC DOS 2.0 as well, and this version also added read-only, archive, volume label, and directory attribute bits for hierarchical sub-directories.

MS-DOS 3.0 introduced support for high-density 1.2 MB 5.25-inch diskettes (media descriptor byte 0xF9), which notably had 15 sectors per track, hence more space for the FATs.

FAT12 remains in use on all common floppy disks, including 1.44 MB and later 2.88 MB disks (media descriptor byte 0xF0).

Read more about this topic:  FATX, Historical Evolution, File System Types