FAT file system-Given any valid cluster number N, where in the FAT(s) is the entry for that cluster number?

来源:互联网 发布:土地建设数据库 编辑:程序博客网 时间:2024/05/29 03:46
For FAT16 and FAT32:
If(BPB_FATSz16 != 0)
     FATSz = BPB_FATSz16;
 Else
    FATSz = BPB_FATSz32; 

If(FATType == FAT16)
    FATOffset = N * 2;
Else if (FATType == FAT32)
    FATOffset = N * 4;

ThisFATSecNum = BPB_ResvdSecCnt + (FATOffset / BPB_BytsPerSec);
ThisFATEntOffset = REM(FATOffset / BPB_BytsPerSec);
/* remainder after division of FATOffset by BPB_BytsPerSec (
余数)*/
原创粉丝点击