Question

I'm developing a flash based USB mass storage device with FAT16 file system. It's working properly, however I have difficulties understanding what's happening on the FAT segments.

When I begin, I have a single file, 56 bytes long on the root directory, it's 32bits long and the data is stored on the 2nd cluster (the 0 and the 1 can't be used in FAT).

if I look at the memory dump of the FAT segment I see:

f8 ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00... zeros until the end

As I understand, the last 0xFFFF means that this cluster is the last cluster in the chain for this file.

so far so good.

But... when I extend the size of the actual file to 4,032 bytes , the FAT segment turn into

f8 ff ff 00 f0 ff 05 60 00 07 f0 ff 00 00 00 00 00... zeros until the end

Can anyone explain what's going on here ?

I see several things I can't explain:

1. why does the 4 system reserved bytes change ?

2. I can't see any 0xFFFF which means, there isn't an end to the cluster chain ?

If it helps anyone, the block size is 512 bytes, the file system is formatted 2 segments per cluster.

Était-ce utile?

La solution

Figures it was FAT12 and not FAT16 I was working with.

FAT12-16 distinguished by the number of clusters, not the string that's written in the boot sector.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top