This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / sys / pcfs / bootsect.h
CommitLineData
15637ed4
RG
1/*
2 * Written by Paul Popelka (paulp@uts.amdahl.com)
3 *
4 * You can do anything you want with this software,
5 * just don't say you wrote it,
6 * and don't remove this notice.
7 *
8 * This software is provided "as is".
9 *
10 * The author supplies this software to be publicly
11 * redistributed on the understanding that the author
12 * is not responsible for the correct functioning of
13 * this software in any circumstances and is not liable
14 * for any damages caused by this software.
15 *
16 * October 1992
17 *
bbc3f849 18 * $Id: bootsect.h,v 1.2 1993/10/16 19:29:24 rgrimes Exp $
15637ed4
RG
19 */
20
bbc3f849
GW
21#ifndef _PCFS_BOOTSECT_H_
22#define _PCFS_BOOTSECT_H_ 1
23
15637ed4
RG
24/*
25 * Format of a boot sector. This is the first sector
26 * on a DOS floppy disk or the fist sector of a partition
27 * on a hard disk. But, it is not the first sector of
28 * a partitioned hard disk.
29 */
30struct bootsector33 {
31 char bsJump[3]; /* jump instruction E9xxxx or EBxx90 */
32 char bsOemName[8]; /* OEM name and version */
33 char bsBPB[19]; /* BIOS parameter block */
34 char bsDriveNumber; /* drive number (0x80) */
35 char bsBootCode[474]; /* pad so structure is 512 bytes long */
36 u_short bsBootSectSig;
37#define BOOTSIG 0xaa55
38};
39
40struct bootsector50 {
41 char bsJump[3]; /* jump instruction E9xxxx or EBxx90 */
42 char bsOemName[8]; /* OEM name and version */
43 char bsBPB[25]; /* BIOS parameter block */
44 char bsDriveNumber; /* drive number (0x80) */
45 char bsReserved1; /* reserved */
46 char bsBootSignature; /* extended boot signature (0x29) */
47#define EXBOOTSIG 0x29
48 char bsVolumeID[4]; /* volume ID number */
49 char bsVolumeLabel[11]; /* volume label */
50 char bsFileSysType[8]; /* file system type (FAT12 or FAT16) */
51 char bsBootCode[448]; /* pad so structure is 512 bytes long */
52 u_short bsBootSectSig;
53#define BOOTSIG 0xaa55
54};
55
56union bootsector {
57 struct bootsector33 bs33;
58 struct bootsector50 bs50;
59};
60
61/*
62 * Shorthand for fields in the bpb.
63 */
64#define bsBytesPerSec bsBPB.bpbBytesPerSec
65#define bsSectPerClust bsBPB.bpbSectPerClust
66#define bsResSectors bsBPB.bpbResSectors
67#define bsFATS bsBPB.bpbFATS
68#define bsRootDirEnts bsBPB.bpbRootDirEnts
69#define bsSectors bsBPB.bpbSectors
70#define bsMedia bsBPB.bpbMedia
71#define bsFATsecs bsBPB.bpbFATsecs
72#define bsSectPerTrack bsBPB.bpbSectPerTrack
73#define bsHeads bsBPB.bpbHeads
74#define bsHiddenSecs bsBPB.bpbHiddenSecs
75#define bsHugeSectors bsBPB.bpbHugeSectors
bbc3f849 76#endif /* _PCFS_BOOTSECT_H_ */