📄 fat_8h-source.html
字号:
00129 CHAR bsExt[26]; <span class="comment">// Bootsector Extension</span>00130 CHAR bsBootCode[418]; <span class="comment">// pad so structure is 512b</span>00131 BYTE bsBootSectSig2; <span class="comment">// 2 & 3 are only defined for FAT32?</span>00132 BYTE bsBootSectSig3;00133 BYTE bsBootSectSig0; <span class="comment">// boot sector signature byte 0x55</span>00134 BYTE bsBootSectSig1; <span class="comment">// boot sector signature byte 0xAA</span>00135 <span class="preprocessor">#define BOOTSIG0 0x55</span>00136 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG1 0xaa</span>00137 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG2 0</span>00138 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG3 0</span>00139 <span class="preprocessor"></span>} GNUC_PACKED;00140 00141 00142 <span class="comment">/***************************************************************/</span>00143 <span class="comment">/***************************************************************/</span>00144 00145 <span class="comment">// BIOS Parameter Block (BPB) for DOS 3.3</span>00146 <span class="keyword">struct </span>bpb33 {00147 WORD bpbBytesPerSec; <span class="comment">// bytes per sector</span>00148 BYTE bpbSecPerClust; <span class="comment">// sectors per cluster</span>00149 WORD bpbResSectors; <span class="comment">// number of reserved sectors</span>00150 BYTE bpbFATs; <span class="comment">// number of FATs</span>00151 WORD bpbRootDirEnts; <span class="comment">// number of root directory entries</span>00152 WORD bpbSectors; <span class="comment">// total number of sectors</span>00153 BYTE bpbMedia; <span class="comment">// media descriptor</span>00154 WORD bpbFATsecs; <span class="comment">// number of sectors per FAT</span>00155 WORD bpbSecPerTrack; <span class="comment">// sectors per track</span>00156 WORD bpbHeads; <span class="comment">// number of heads</span>00157 WORD bpbHiddenSecs; <span class="comment">// number of hidden sectors</span>00158 } GNUC_PACKED;00159 00160 <span class="comment">// BPB for DOS 5.0</span>00161 <span class="comment">// The difference is bpbHiddenSecs is a short for DOS 3.3,</span>00162 <span class="comment">// and bpbHugeSectors is not present in the DOS 3.3 bpb.</span>00163 <span class="keyword">struct </span>bpb50 {00164 WORD bpbBytesPerSec; <span class="comment">// bytes per sector</span>00165 BYTE bpbSecPerClust; <span class="comment">// sectors per cluster</span>00166 WORD bpbResSectors; <span class="comment">// number of reserved sectors</span>00167 BYTE bpbFATs; <span class="comment">// number of FATs</span>00168 WORD bpbRootDirEnts; <span class="comment">// number of root directory entries</span>00169 WORD bpbSectors; <span class="comment">// total number of sectors</span>00170 BYTE bpbMedia; <span class="comment">// media descriptor</span>00171 WORD bpbFATsecs; <span class="comment">// number of sectors per FAT</span>00172 WORD bpbSecPerTrack; <span class="comment">// sectors per track</span>00173 WORD bpbHeads; <span class="comment">// number of heads</span>00174 DWORD bpbHiddenSecs; <span class="comment">// # of hidden sectors</span>00175 <span class="comment">// 3.3 compat ends here</span>00176 DWORD bpbHugeSectors; <span class="comment">// # of sectors if bpbSectors == 0</span>00177 } GNUC_PACKED;00178 00179 <span class="comment">// BPB for DOS 7.10 (FAT32)</span>00180 <span class="comment">// This one has a few extensions to bpb50.</span>00181 <span class="keyword">struct </span>bpb710 {00182 WORD bpbBytesPerSec; <span class="comment">// bytes per sector</span>00183 BYTE bpbSecPerClust; <span class="comment">// sectors per cluster</span>00184 WORD bpbResSectors; <span class="comment">// number of reserved sectors</span>00185 BYTE bpbFATs; <span class="comment">// number of FATs</span>00186 WORD bpbRootDirEnts; <span class="comment">// number of root directory entries</span>00187 WORD bpbSectors; <span class="comment">// total number of sectors</span>00188 BYTE bpbMedia; <span class="comment">// media descriptor</span>00189 WORD bpbFATsecs; <span class="comment">// number of sectors per FAT</span>00190 WORD bpbSecPerTrack; <span class="comment">// sectors per track</span>00191 WORD bpbHeads; <span class="comment">// number of heads</span>00192 DWORD bpbHiddenSecs; <span class="comment">// # of hidden sectors</span>00193 <span class="comment">// 3.3 compat ends here</span>00194 DWORD bpbHugeSectors; <span class="comment">// # of sectors if bpbSectors == 0</span>00195 <span class="comment">// 5.0 compat ends here</span>00196 DWORD bpbBigFATsecs;<span class="comment">// like bpbFATsecs for FAT32</span>00197 WORD bpbExtFlags; <span class="comment">// extended flags:</span>00198 <span class="preprocessor">#define FATNUM 0xf // mask for numbering active FAT</span>00199 <span class="preprocessor"></span><span class="preprocessor">#define FATMIRROR 0x80 // FAT is mirrored (like it always was)</span>00200 <span class="preprocessor"></span> WORD bpbFSVers; <span class="comment">// filesystem version</span>00201 <span class="preprocessor">#define FSVERS 0 // currently only 0 is understood</span>00202 <span class="preprocessor"></span> DWORD bpbRootClust; <span class="comment">// start cluster for root directory</span>00203 WORD bpbFSInfo; <span class="comment">// filesystem info structure sector</span>00204 WORD bpbBackup; <span class="comment">// backup boot sector</span>00205 <span class="comment">// There is a 12 byte filler here, but we ignore it</span>00206 } GNUC_PACKED;00207 00208 00209 00210 00211 <span class="comment">// ***************************************************************</span>00212 <span class="comment">// * byte versions of the above structs *</span>00213 <span class="comment">// ***************************************************************</span>00214 00215 00216 <span class="comment">// BIOS Parameter Block (BPB) for DOS 3.3</span>00217 <span class="keyword">struct </span>byte_bpb33 {00218 CHAR bpbBytesPerSec[2]; <span class="comment">// bytes per sector</span>00219 CHAR bpbSecPerClust; <span class="comment">// sectors per cluster</span>00220 CHAR bpbResSectors[2]; <span class="comment">// number of reserved sectors</span>00221 CHAR bpbFATs; <span class="comment">// number of FATs</span>00222 CHAR bpbRootDirEnts[2]; <span class="comment">// number of root directory entries</span>00223 CHAR bpbSectors[2]; <span class="comment">// total number of sectors</span>00224 CHAR bpbMedia; <span class="comment">// media descriptor</span>00225 CHAR bpbFATsecs[2]; <span class="comment">// number of sectors per FAT</span>00226 CHAR bpbSecPerTrack[2]; <span class="comment">// sectors per track</span>00227 CHAR bpbHeads[2]; <span class="comment">// number of heads</span>00228 CHAR bpbHiddenSecs[2]; <span class="comment">// number of hidden sectors</span>00229 } GNUC_PACKED;00230 00231 <span class="comment">// BPB for DOS 5.0</span>00232 <span class="comment">// The difference is bpbHiddenSecs is a short for DOS 3.3,</span>00233 <span class="comment">// and bpbHugeSectors is not in the 3.3 bpb.</span>00234 <span class="keyword">struct </span>byte_bpb50 {00235 CHAR bpbBytesPerSec[2]; <span class="comment">// bytes per sector</span>00236 CHAR bpbSecPerClust; <span class="comment">// sectors per cluster</span>00237 CHAR bpbResSectors[2]; <span class="comment">// number of reserved sectors</span>00238 CHAR bpbFATs; <span class="comment">// number of FATs</span>00239 CHAR bpbRootDirEnts[2]; <span class="comment">// number of root directory entries</span>00240 CHAR bpbSectors[2]; <span class="comment">// total number of sectors</span>00241 CHAR bpbMedia; <span class="comment">// media descriptor</span>00242 CHAR bpbFATsecs[2]; <span class="comment">// number of sectors per FAT</span>00243 CHAR bpbSecPerTrack[2]; <span class="comment">// sectors per track</span>00244 CHAR bpbHeads[2]; <span class="comment">// number of heads</span>00245 CHAR bpbHiddenSecs[4]; <span class="comment">// number of hidden sectors</span>00246 CHAR bpbHugeSectors[4]; <span class="comment">// # of sectors if bpbSectors == 0</span>00247 } GNUC_PACKED;00248 00249 <span class="comment">// BPB for DOS 7.10 (FAT32).</span>00250 <span class="comment">// This one has a few extensions to bpb50.</span>00251 <span class="keyword">struct </span>byte_bpb710 {00252 BYTE bpbBytesPerSec[2]; <span class="comment">// bytes per sector</span>00253 BYTE bpbSecPerClust; <span class="comment">// sectors per cluster</span>00254 BYTE bpbResSectors[2]; <span class="comment">// number of reserved sectors</span>00255 BYTE bpbFATs; <span class="comment">// number of FATs</span>00256 BYTE bpbRootDirEnts[2]; <span class="comment">// number of root directory entries</span>00257 BYTE bpbSectors[2]; <span class="comment">// total number of sectors</span>00258 BYTE bpbMedia; <span class="comment">// media descriptor</span>00259 BYTE bpbFATsecs[2]; <span class="comment">// number of sectors per FAT</span>00260 BYTE bpbSecPerTrack[2]; <span class="comment">// sectors per track</span>00261 BYTE bpbHeads[2]; <span class="comment">// number of heads</span>00262 BYTE bpbHiddenSecs[4]; <span class="comment">// # of hidden sectors</span>00263 BYTE bpbHugeSectors[4]; <span class="comment">// # of sectors if bpbSectors == 0</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -