1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 struct bootsector33 {
26 u_int8_t bsJump[3];
27 int8_t bsOemName[8];
28 int8_t bsBPB[19];
29 int8_t bsDriveNumber;
30 int8_t bsBootCode[479];
31 u_int8_t bsBootSectSig0;
32 u_int8_t bsBootSectSig1;
33 #define BOOTSIG0 0x55
34 #define BOOTSIG1 0xaa
35 };
36
37 struct extboot {
38 int8_t exDriveNumber;
39 int8_t exReserved1;
40 int8_t exBootSignature;
41 #define EXBOOTSIG 0x29
42 int8_t exVolumeID[4];
43 int8_t exVolumeLabel[11];
44 int8_t exFileSysType[8];
45 };
46
47 struct bootsector50 {
48 u_int8_t bsJump[3];
49 int8_t bsOemName[8];
50 int8_t bsBPB[25];
51 int8_t bsExt[26];
52 int8_t bsBootCode[448];
53 u_int8_t bsBootSectSig0;
54 u_int8_t bsBootSectSig1;
55 #define BOOTSIG0 0x55
56 #define BOOTSIG1 0xaa
57 };
58
59 struct bootsector710 {
60 u_int8_t bsJump[3];
61 int8_t bsOEMName[8];
62 int8_t bsPBP[53];
63 int8_t bsExt[26];
64 int8_t bsBootCode[418];
65 u_int8_t bsBootSectSig2;
66 u_int8_t bsBootSectSig3;
67 u_int8_t bsBootSectSig0;
68 u_int8_t bsBootSectSig1;
69 #define BOOTSIG0 0x55
70 #define BOOTSIG1 0xaa
71 #define BOOTSIG2 0
72 #define BOOTSIG3 0
73 };
74
75 union bootsector {
76 struct bootsector33 bs33;
77 struct bootsector50 bs50;
78 struct bootsector710 bs710;
79 };
80
81 #if 0
82
83
84
85 #define bsBytesPerSec bsBPB.bpbBytesPerSec
86 #define bsSectPerClust bsBPB.bpbSectPerClust
87 #define bsResSectors bsBPB.bpbResSectors
88 #define bsFATS bsBPB.bpbFATS
89 #define bsRootDirEnts bsBPB.bpbRootDirEnts
90 #define bsSectors bsBPB.bpbSectors
91 #define bsMedia bsBPB.bpbMedia
92 #define bsFATsecs bsBPB.bpbFATsecs
93 #define bsSectPerTrack bsBPB.bpbSectPerTrack
94 #define bsHeads bsBPB.bpbHeads
95 #define bsHiddenSecs bsBPB.bpbHiddenSecs
96 #define bsHugeSectors bsBPB.bpbHugeSectors
97 #endif