Where things are
With the parameter block’s numbers: the boot sector is sector 0; the first FAT starts at sector reserved; the second follows it; the root directory follows the last FAT and takes root entries × 32 / 512 sectors; the data area follows. On a 720 KB disk that is the boot sector, 5 sectors for each FAT, 7 sectors of root directory and the data from sector 18, in clusters of 2 sectors (1 KB) numbered from 2.
The allocation table
Each cluster has a 12-bit entry, packed two to three bytes: entry n starts at byte n × 3 / 2; an even entry takes the low 12 bits of the little-endian word there, an odd
entry the high 12. Entries 0 and 1 hold the media descriptor and $FFF. An entry of 0 is a free cluster, $FF7 a bad cluster, $FF8 to $FFF
the last cluster of a file, and any other value the number of the file’s next cluster. The second FAT is a copy; the explorer notes when it differs.
Directory entries
An entry is 32 bytes. A first byte of 0 ends the directory and $E5 marks a deleted entry.
| Offset | Size | Field |
|---|---|---|
| 0 | 8 | Name, padded with spaces |
| 8 | 3 | Extension, padded with spaces |
| 11 | 1 | Attributes: 1 read-only, 2 hidden, 4 system, 8 volume label, 16 directory, 32 archive |
| 12 | 10 | Not used by the Atari |
| 22 | 2 | Time: hours (5 bits), minutes (6), seconds ÷ 2 (5) |
| 24 | 2 | Date: years since 1980 (7 bits), month (4), day (5) |
| 26 | 2 | The first cluster |
| 28 | 4 | The size in bytes, 0 for a directory |
A subdirectory is a file of entries in its own clusters, starting with the entries . and ... The Atari has no long file names; an entry of the PC long-name kind
(attributes $0F) is skipped. The explorer reports a chain that loops or leaves the disk, a file whose size and chain disagree, and a date or time that cannot exist.
Not described
Known, not yet covered
- Reference: the FAT12 packing and the directory entry are the PC’s, taken as they are; no Atari document was read for them, and what the Atari does with the unused bytes at offset 12 is not described. TOS’s own rules (how it allocates clusters, the disk-change detection by serial number) are not described.
- Viewer: only the first FAT is used for chains; a disk with only the second FAT intact is not repaired. Files are not checked against any real Atari disk.
Links
Reference
- bootiext.txt – the boot sector and the derived BIOS parameter block