FAT16 boot record error

Hello,

I'm developing a "USB card reader" which must read a 512 bytes non-writable memory and display it as a file.

Since the 512 bytes memory contains only data which have to be stored in the file, I have to define in firmware the entire FAT as a big array. Thus, no possibility to format the media using for example Windows.

I'm encountering problems when I connect my device to the host PC: Windows

7 asks if I want to format the removable device. As I understood and as I saw with my USB analyzer, the OS doesn't seem to understand the FAT boot sector. I based on the USB Mass Storage book from Jan Axelson.

Do someone have some ideas about what fields in the boot sector can generate such an error? Do you know where I can find some documentation on how Windows set the boot sector?

Thank you, Johann

--------------------------------------- Posted through

formatting link

Reply to
johsey
Loading thread data ...

Windows 7 requires that a FAT block device contains at least 8 sectors. Define your device as having 8 sectors and return contant value (0s) whenever Windows attempts to read any sector above the implmented ones.

Reply to
Bernard

[...]

Actually, FAT16 requires the device to have at least 4096 clusters (otherwise it'd be FAT12), so the device better had a few more sectors than that (boot record, FAT, root directory, plus data clusters).

Stefan

Reply to
Stefan Reuther

Actually the boundary between FAT12 and FAT16 is 4085* clusters - 4085 and fewer must be formatted FAT12, 4086 and higher must be FAT16 (until you get to 65526 clusters, at which point it's FAT32).

In any event, given the vast number of incorrect implementations, you should avoid formatting any volume with a number of clusters within about 16 of the above limits, either by adjusting the reserved area size or the cluster size.

Anyway, the definitive reference for FAT:

formatting link

  • *not* 4095/4096
Reply to
Robert Wessel

Actually the boundary between FAT12 and FAT16 is 4085* clusters - 4085 and fewer must be formatted FAT12, 4086 and higher must be FAT16 (until you get to 65526 clusters, at which point it's FAT32).

In any event, given the vast number of incorrect implementations, you should avoid formatting any volume with a number of clusters within about 16 of the above limits, either by adjusting the reserved area size or the cluster size.

Anyway, the definitive reference for FAT:

formatting link

  • *not* 4095/4096
Reply to
Robert Wessel

(apologies if this is a double post - newsreader was being weird)

Actually the boundary between FAT12 and FAT16 is 4085* clusters - 4085 and fewer must be formatted FAT12, 4086 and higher must be FAT16 (until you get to 65526 clusters, at which point it's FAT32).

In any event, given the vast number of incorrect implementations, you should avoid formatting any volume with a number of clusters within about 16 of the above limits, either by adjusting the reserved area size or the cluster size.

Anyway, the definitive reference for FAT:

formatting link

  • *not* 4095/4096
Reply to
Robert Wessel

Thank you for your answers.

I will try to put more clusters in order to be pretty much higher than the FAT16 low limits and I will have a look at the linked document.

I will come back if I still have problems with my device being recognized by Windows.

Regards, Johann

--------------------------------------- Posted through

formatting link

Reply to
johsey

How big is the "disk" pretending to be? Small disks can only be FAT12, you can not create an arbitrary sized FAT16 disk. There are set rules in cluster count for each FAT type as the number of clusters is the only way to determine the FAT type, see:

formatting link

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

Rule of the Great:
 Click to see the full signature
Reply to
Stef

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.