FAT file system -overview

 
  BPB:BIOS Parameter Block
sector[510] =0x55, sector[511] = 0xAA
Boot sector   BPB_ResvdSecCnt
Reserved sector  

 
Reserved sector
FAT[0] If(BPB_FATSz16 != 0)
    FATSz = BPB_FATSz16;
Else
    FATSz = BPB_FATSz32;
BPB_NumFATs * FATSz

 
FAT[n]
 
RootDirSector   RootDirSectors = ((BPB_RootEntCnt * 32) + (BPB_BytsPerSec – 1)) / BPB_BytsPerSec;/*round up*/
Data   (cluster 2)
If(BPB_FATSz16 != 0)
    FATSz = BPB_FATSz16;
Else
    FATSz = BPB_FATSz32;

FirstDataSector = BPB_ResvdSecCnt + (BPB_NumFATs * FATSz) + RootDirSectors;

   
Data   cluster N
FirstSectorofCluster = ((N – 2) * BPB_SecPerClus) + FirstDataSector

   

你可能感兴趣的:(FAT file system -overview)