⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fat_8h-source.html

📁 avr应用测试程序
💻 HTML
📖 第 1 页 / 共 3 页
字号:
00133     CHAR    bsBootCode[448];            <span class="comment">// pad so structure is 512b</span>00134     BYTE    bsBootSectSig0;             <span class="comment">// boot sector signature byte 0x55 </span>00135     BYTE    bsBootSectSig1;             <span class="comment">// boot sector signature byte 0xAA</span>00136 <span class="preprocessor">#define BOOTSIG0        0x55</span>00137 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG1        0xaa</span>00138 <span class="preprocessor"></span>};00139 00140 <span class="keyword">struct </span>bootsector710 {00141     BYTE    bsJump[3];                  <span class="comment">// jump inst E9xxxx or EBxx90</span>00142     CHAR    bsOEMName[8];               <span class="comment">// OEM name and version</span>00143     CHAR    bsBPB[53];                  <span class="comment">// BIOS parameter block</span>00144     CHAR    bsExt[26];                  <span class="comment">// Bootsector Extension</span>00145     CHAR    bsBootCode[418];            <span class="comment">// pad so structure is 512b</span>00146     BYTE    bsBootSectSig2;             <span class="comment">// 2 &amp; 3 are only defined for FAT32?</span>00147     BYTE    bsBootSectSig3;00148     BYTE    bsBootSectSig0;             <span class="comment">// boot sector signature byte 0x55</span>00149     BYTE    bsBootSectSig1;             <span class="comment">// boot sector signature byte 0xAA</span>00150 <span class="preprocessor">#define BOOTSIG0        0x55</span>00151 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG1        0xaa</span>00152 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG2        0</span>00153 <span class="preprocessor"></span><span class="preprocessor">#define BOOTSIG3        0</span>00154 <span class="preprocessor"></span>};00155 00156 00157 <span class="comment">/***************************************************************/</span>00158 <span class="comment">/***************************************************************/</span>00159 00160 <span class="comment">// BIOS Parameter Block (BPB) for DOS 3.3</span>00161 <span class="keyword">struct </span>bpb33 {00162         WORD    bpbBytesPerSec; <span class="comment">// bytes per sector</span>00163         BYTE    bpbSecPerClust; <span class="comment">// sectors per cluster</span>00164         WORD    bpbResSectors;  <span class="comment">// number of reserved sectors</span>00165         BYTE    bpbFATs;        <span class="comment">// number of FATs</span>00166         WORD    bpbRootDirEnts; <span class="comment">// number of root directory entries</span>00167         WORD    bpbSectors;     <span class="comment">// total number of sectors</span>00168         BYTE    bpbMedia;       <span class="comment">// media descriptor</span>00169         WORD    bpbFATsecs;     <span class="comment">// number of sectors per FAT</span>00170         WORD    bpbSecPerTrack; <span class="comment">// sectors per track</span>00171         WORD    bpbHeads;       <span class="comment">// number of heads</span>00172         WORD    bpbHiddenSecs;  <span class="comment">// number of hidden sectors</span>00173 };00174 00175 <span class="comment">// BPB for DOS 5.0</span>00176 <span class="comment">// The difference is bpbHiddenSecs is a short for DOS 3.3,</span>00177 <span class="comment">// and bpbHugeSectors is not present in the DOS 3.3 bpb.</span>00178 <span class="keyword">struct </span>bpb50 {00179         WORD    bpbBytesPerSec; <span class="comment">// bytes per sector</span>00180         BYTE    bpbSecPerClust; <span class="comment">// sectors per cluster</span>00181         WORD    bpbResSectors;  <span class="comment">// number of reserved sectors</span>00182         BYTE    bpbFATs;        <span class="comment">// number of FATs</span>00183         WORD    bpbRootDirEnts; <span class="comment">// number of root directory entries</span>00184         WORD    bpbSectors;     <span class="comment">// total number of sectors</span>00185         BYTE    bpbMedia;       <span class="comment">// media descriptor</span>00186         WORD    bpbFATsecs;     <span class="comment">// number of sectors per FAT</span>00187         WORD    bpbSecPerTrack; <span class="comment">// sectors per track</span>00188         WORD    bpbHeads;       <span class="comment">// number of heads</span>00189         DWORD   bpbHiddenSecs;  <span class="comment">// # of hidden sectors</span>00190 <span class="comment">// 3.3 compat ends here</span>00191         DWORD   bpbHugeSectors; <span class="comment">// # of sectors if bpbSectors == 0</span>00192 };00193 00194 <span class="comment">// BPB for DOS 7.10 (FAT32)</span>00195 <span class="comment">// This one has a few extensions to bpb50.</span>00196 <span class="keyword">struct </span>bpb710 {00197         WORD    bpbBytesPerSec; <span class="comment">// bytes per sector</span>00198         BYTE    bpbSecPerClust; <span class="comment">// sectors per cluster</span>00199         WORD    bpbResSectors;  <span class="comment">// number of reserved sectors</span>00200         BYTE    bpbFATs;        <span class="comment">// number of FATs</span>00201         WORD    bpbRootDirEnts; <span class="comment">// number of root directory entries</span>00202         WORD    bpbSectors;     <span class="comment">// total number of sectors</span>00203         BYTE    bpbMedia;       <span class="comment">// media descriptor</span>00204         WORD    bpbFATsecs;     <span class="comment">// number of sectors per FAT</span>00205         WORD    bpbSecPerTrack; <span class="comment">// sectors per track</span>00206         WORD    bpbHeads;       <span class="comment">// number of heads</span>00207         DWORD   bpbHiddenSecs;  <span class="comment">// # of hidden sectors</span>00208 <span class="comment">// 3.3 compat ends here</span>00209         DWORD   bpbHugeSectors; <span class="comment">// # of sectors if bpbSectors == 0</span>00210 <span class="comment">// 5.0 compat ends here</span>00211         DWORD     bpbBigFATsecs;<span class="comment">// like bpbFATsecs for FAT32</span>00212         WORD      bpbExtFlags;  <span class="comment">// extended flags:</span>00213 <span class="preprocessor">#define FATNUM    0xf           // mask for numbering active FAT</span>00214 <span class="preprocessor"></span><span class="preprocessor">#define FATMIRROR 0x80          // FAT is mirrored (like it always was)</span>00215 <span class="preprocessor"></span>        WORD      bpbFSVers;    <span class="comment">// filesystem version</span>00216 <span class="preprocessor">#define FSVERS    0             // currently only 0 is understood</span>00217 <span class="preprocessor"></span>        DWORD     bpbRootClust; <span class="comment">// start cluster for root directory</span>00218         WORD      bpbFSInfo;    <span class="comment">// filesystem info structure sector</span>00219         WORD      bpbBackup;    <span class="comment">// backup boot sector</span>00220         <span class="comment">// There is a 12 byte filler here, but we ignore it</span>00221 };00222 00223 00224 00225 00226 <span class="comment">// ***************************************************************</span>00227 <span class="comment">// * byte versions of the above structs                          *</span>00228 <span class="comment">// ***************************************************************</span>00229 00230 00231 <span class="comment">// BIOS Parameter Block (BPB) for DOS 3.3</span>00232 <span class="keyword">struct </span>byte_bpb33 {00233         CHAR bpbBytesPerSec[2];     <span class="comment">// bytes per sector</span>00234         CHAR bpbSecPerClust;        <span class="comment">// sectors per cluster</span>00235         CHAR bpbResSectors[2];      <span class="comment">// number of reserved sectors</span>00236         CHAR bpbFATs;               <span class="comment">// number of FATs</span>00237         CHAR bpbRootDirEnts[2];     <span class="comment">// number of root directory entries</span>00238         CHAR bpbSectors[2];         <span class="comment">// total number of sectors</span>00239         CHAR bpbMedia;              <span class="comment">// media descriptor</span>00240         CHAR bpbFATsecs[2];         <span class="comment">// number of sectors per FAT</span>00241         CHAR bpbSecPerTrack[2];     <span class="comment">// sectors per track</span>00242         CHAR bpbHeads[2];           <span class="comment">// number of heads</span>00243         CHAR bpbHiddenSecs[2];      <span class="comment">// number of hidden sectors</span>00244 };00245 00246 <span class="comment">// BPB for DOS 5.0</span>00247 <span class="comment">// The difference is bpbHiddenSecs is a short for DOS 3.3,</span>00248 <span class="comment">// and bpbHugeSectors is not in the 3.3 bpb.</span>00249 <span class="keyword">struct </span>byte_bpb50 {00250         CHAR bpbBytesPerSec[2];     <span class="comment">// bytes per sector</span>00251         CHAR bpbSecPerClust;        <span class="comment">// sectors per cluster</span>00252         CHAR bpbResSectors[2];      <span class="comment">// number of reserved sectors</span>00253         CHAR bpbFATs;               <span class="comment">// number of FATs</span>00254         CHAR bpbRootDirEnts[2];     <span class="comment">// number of root directory entries</span>00255         CHAR bpbSectors[2];         <span class="comment">// total number of sectors</span>00256         CHAR bpbMedia;              <span class="comment">// media descriptor</span>00257         CHAR bpbFATsecs[2];         <span class="comment">// number of sectors per FAT</span>00258         CHAR bpbSecPerTrack[2];     <span class="comment">// sectors per track</span>00259         CHAR bpbHeads[2];           <span class="comment">// number of heads</span>00260         CHAR bpbHiddenSecs[4];      <span class="comment">// number of hidden sectors</span>00261         CHAR bpbHugeSectors[4];     <span class="comment">// # of sectors if bpbSectors == 0</span>00262 };00263 00264 <span class="comment">// BPB for DOS 7.10 (FAT32).</span>00265 <span class="comment">// This one has a few extensions to bpb50.</span>00266 <span class="keyword">struct </span>byte_bpb710 {00267         BYTE bpbBytesPerSec[2];     <span class="comment">// bytes per sector</span>00268         BYTE bpbSecPerClust;        <span class="comment">// sectors per cluster</span>00269         BYTE bpbResSectors[2];      <span class="comment">// number of reserved sectors</span>00270         BYTE bpbFATs;               <span class="comment">// number of FATs</span>00271         BYTE bpbRootDirEnts[2];     <span class="comment">// number of root directory entries</span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -