FAT file system-Note
来源:互联网 发布:土地建设数据库 编辑:程序博客网 时间:2024/06/05 10:23
(this is not true of FAT12)
if (FATType == FAT12)
FATOffset = N + (N / 2);
/* Multiply by 1.5 without using floating point, the divide by 2 rounds DOWN */
ThisFATSecNum = BPB_ResvdSecCnt + (FATOffset / BPB_BytsPerSec);
ThisFATEntOffset = REM(FATOffset / BPB_BytsPerSec);
/* This cluster access spans a sector boundary in the FAT */
/* There are a number of strategies to handling this. The */
/* easiest is to always load FAT sectors into memory */
/* in pairs if the volume is FAT12 (if you want to load */
/* FAT sector N, you also load FAT sector N+1 immediately */
/* following it in memory unless sector N is the last FAT */
/* sector). It is assumed that this is the strategy used here */
/* which makes this if test for a sector boundary span */
/* unnecessary. */
}
we only want the low 12-bits of the 16-bits we fetch; and if the cluster number is ODD,
we only want the high 12-bits of the 16-bits we fetch:
Read:
FAT12ClusEntryVal = *((WORD *) &SecBuff[ThisFATEntOffset]);
If(N & 0x0001)
FAT12ClusEntryVal = FAT12ClusEntryVal >> 4; /* Cluster number is ODD */
Else
FAT12ClusEntryVal = FAT12ClusEntryVal & 0x0FFF; /* Cluster number is EVEN */
Write:
If(N & 0x0001) {
FAT12ClusEntryVal = FAT12ClusEntryVal << 4; /* Cluster number is ODD */
*((WORD *) &SecBuff[ThisFATEntOffset]) =
(*((WORD *) &SecBuff[ThisFATEntOffset])) & 0x000F;
} Else {
FAT12ClusEntryVal = FAT12ClusEntryVal & 0x0FFF; /* Cluster number is EVEN */
*((WORD *) &SecBuff[ThisFATEntOffset]) =
(*((WORD *) &SecBuff[ThisFATEntOffset])) & 0xF000;
}
*((WORD *) &SecBuff[ThisFATEntOffset]) =
(*((WORD *) &SecBuff[ThisFATEntOffset])) | FAT12ClusEntryVal;
the cluster number of the first cluster of the file is recorded.
The first cluster (extent) of the file is the data associated with this first cluster number,
and the location of that data on the volume is computed from the cluster number as described earlier (computation of FirstSectorofCluster)
- FAT file system-Note
- FAT file system
- FAT file system -overview
- FAT file system-FAT Type Determination
- FAT file system-FAT Volume Initialization
- FAT file system-read&set
- FAT file system-EOC mark
- FAT file system-BAD CLUSTER mark
- FAT file system-FAT32 FSInfo Sector Structure
- FAT file system-Backup Boot Sector
- FatFs - Generic FAT File System Module
- Siebel 8.1 Note:Siebel File System
- 好东西——FatFs - Generic FAT File System Module
- FAT file system-What are the two reserved clusters at the start of the FAT for?
- Linux System Programming note 2 ——File I/O
- FAT file system-Given any valid cluster number N, where in the FAT(s) is the entry for that cluster number?
- A note of porting yaffs2 file system to linux 2.6.18, part one.
- Linux System Programming note 4 —— Advanced File I/O
- FAT file system-FAT Type Determination
- FAT file system-Given any valid cluster number N, where in the FAT(s) is the entry for that cluster number?
- 万能的便携即时聊天软件-Pidgin Portable
- php调用各种类型的soap webservice的步骤(.net为例)
- FAT file system-read&set
- FAT file system-Note
- PointDemo.java
- FAT file system-EOC mark
- 如何做好一个垂直搜索引擎
- .NET反射示例
- java 取得瀏覽器分辨率
- 一点一点的进步
- 全国服装进货地点
- WEB网页结构化信息抽取技术介绍(网页库级)