FAT16 question

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

FAT16 question

Unread post by Bas »

I'm still slowly plodding away at a disk image generator and now at the point where it spits out FAT16 formatted partitions that I could start writing files to.

My question, as I use MS-DOS 6.22 for reference. I generate a 50MB disk and partition that. I format it from DOS using FORMAT /S to get a minimal bootable reference disk.

The FAT is weird though. Clusters 0 and 1 are reserved as expected but I expect cluster 2 to be the start of IO.SYS. it's not, though. Instead IO.SYS starts at cluster 0x44.

What causes this gap? And how is it calculated? I can't find it in any docs.

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: FAT16 question

Unread post by Bas »

A theory: clusters are counted from the start of a volume. A FAT volume contains a BPB/VBR, usually 2 copies of the allocation table and the root directory. These structures are large-ish. After all these structures, the first available data cluster is quite a way into the volume, or the metadata structures would get nuked, so 0x44 doesn't sound all that odd anymore.

I have yet to check this.. but hoping it rings a bell for anyone. Are clusters actually counted from the start of the volume, or do they start at the first sector of the data area?? Docs are still inconclusive.

Post Reply