fat problems
Posted: Thu Apr 14, 2005 7:29 am
I've some problems with reading the fat filesystem... I'm trying to get the first sector of the rootdirectory, using this formula (from the microsoft specification):
but this outputs a number which is wrong (can't remember what ). The value should be 0x13 (looked it up with a hex-editor).
This is what the header & values it reads look like:
Anyone ideas?
Thanks.
Code: Select all
int start = header.fats_amount * header.sec_per_fat + header.res_sectors;
This is what the header & values it reads look like:
Code: Select all
typedef struct {
uchar NameVer[8]; // mkdosfs
ushort bytes_per_sector; // 512
uchar sec_per_cluster; // 1
ushort res_sectors; // 512
uchar fats_amount; // 224
ushort rootdir_entries; // 2880
ushort sec_in_vol; // 2544
uchar media_desc; //0x0
ushort sec_per_fat; // 512
ushort sec_per_track; // 0
ushort heads_no; // 0
uint hidden_sectors; // 0
} fat12_header;
Thanks.