- Joined
- Mar 25, 2009
- Messages
- 2
- Reaction score
- 0
Hi,
I am in the process of writing FAT16 compliant file system. I want to port it to SDCard, for this I am using 2GB SDCard(Sandisk). The basic formatting and writing data to the SDCard I am doing through windows(XP) only.
I am facing following issues-
1: Master Boot Record is missing and Partition Boot Record starts from zero sector.
2: Data file should start at the first sector of data area but doesn't starts there. Let me explain this-
I have read following values form Partiton Boot Record-
Bytes_per_sector = 512
Sectors_per_cluster = 64
Reserved_sectors = 2
Number_of_FAT_copies = 2
Maximum_Root_DIR_entries = 512
Sectors_per_FAT = 243
With the above information we can say that-
partition_start_sector = 0;
fat1_start_sector = 2; //partition_start_sector + Reserved_sectors
fat2_start_sector = 245; //fat1_start_sector + Sectors_per_FAT
rdir_start_sector = 488; //fat2_start_sector + Sectors_per_FAT
userdata_start_sec = 520; //rdir_start_sector + 32
As user data starts at 520th sector thus first file's data should at this sector, but instead of this first file's data is starting from 525th sector.
I am unable to figure out why this is starting after 5 sectors.
Thanks
Parag
I am in the process of writing FAT16 compliant file system. I want to port it to SDCard, for this I am using 2GB SDCard(Sandisk). The basic formatting and writing data to the SDCard I am doing through windows(XP) only.
I am facing following issues-
1: Master Boot Record is missing and Partition Boot Record starts from zero sector.
2: Data file should start at the first sector of data area but doesn't starts there. Let me explain this-
I have read following values form Partiton Boot Record-
Bytes_per_sector = 512
Sectors_per_cluster = 64
Reserved_sectors = 2
Number_of_FAT_copies = 2
Maximum_Root_DIR_entries = 512
Sectors_per_FAT = 243
With the above information we can say that-
partition_start_sector = 0;
fat1_start_sector = 2; //partition_start_sector + Reserved_sectors
fat2_start_sector = 245; //fat1_start_sector + Sectors_per_FAT
rdir_start_sector = 488; //fat2_start_sector + Sectors_per_FAT
userdata_start_sec = 520; //rdir_start_sector + 32
As user data starts at 520th sector thus first file's data should at this sector, but instead of this first file's data is starting from 525th sector.
I am unable to figure out why this is starting after 5 sectors.
Thanks
Parag