lkml.org 
[lkml]   [1997]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: FAT12 vs FAT16

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
.


\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.052 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site