Re: FAT12 vs FAT16
thospel@mail.dma.be
22 Aug 1997 20:14:16 -0000
In article <19970822131056.50330@atrey.karlin.mff.cuni.cz>,
<snip>
>
> There are the following ways to determine FAT type:
>
> (1) "FAT12" or "FAT16" string in the boot block. Not reliable and not supported
> in all DOS versions.
>
> (2) "Sector/cluster count rules" -- described for example in the Tech Help.
> Varies between DOS versions. Even if you know the DOS version, you can still
> be wrong as the disk might have been formatted on a different version.
>
> (3) Partition type. Seems to be totally ignored by DOS and sometimes very
> unreliable as DOS's format command doesn't alter this during reformatting
> (if you create the partition by one DOS version and format it by another one,
> an inconsistency might arise).
>
> (4) Number of sectors per FAT -- this value must be correct as the root
> directory position is calculated from it, but it sometimes allows both
> possibilities (although such cases are very rare).
>
> (5) Number of 0xff's at the start of the FAT. As you can remember, the first
> two cluster numbers are reserved for special purposes and their FAT entries
> are set to 0xff with an exception of the first FAT byte which contains a media
> descriptor. If there are less than 3 0xff's, the FAT must be 12-bit. In other
> case, both types are possible.
>
Ah, but...
what does dos itself use ? it must know, since it USES the filesystem.
We should just copy that, since they are the ultimate arbiter.
(even if any of your methods gives a better guess than DOS, we should
still follow that).
And if the algorithm differs from DOS to DOS version, pick what is used
in a recent one.
Ton
.