struct BootSec { unsigned int BPB_BytesPerSec; unsigned char BPB_SecPerClus; unsigned char BPB_NumOfFat; unsigned int BPB_SectPerFat; }; void mf16_Init() { unsigned long BootSector; struct BootSec *bootp; BootSector = 0; mmc_read(BootSector,temp); bootp=(struct BootSec *)temp; RootDirEntry = bootp->BPB_ResrvdSector + (bootp->BPB_NumOfFat * bootp->BPB_SectPerFat); RootDirEntry+= BootSector; ClusterOffset = ((bootp->BPB_BytesPerSec * 32)/BlockSize); ClusterOffset+= RootDirEntry; FatStart = BootSector + bootp->BPB_ResrvdSector; SectPerCluster = bootp->BPB_SecPerClus; }