1999-08-28 01:08:13 +00:00
|
|
|
/* $FreeBSD$ */
|
1998-02-18 09:28:47 +00:00
|
|
|
/* $NetBSD: bootsect.h,v 1.9 1997/11/17 15:36:17 ws Exp $ */
|
1994-09-19 15:41:57 +00:00
|
|
|
|
2005-01-06 18:10:42 +00:00
|
|
|
/*-
|
1994-09-19 15:41:57 +00:00
|
|
|
* Written by Paul Popelka (paulp@uts.amdahl.com)
|
1995-05-30 08:16:23 +00:00
|
|
|
*
|
1994-09-19 15:41:57 +00:00
|
|
|
* You can do anything you want with this software, just don't say you wrote
|
|
|
|
* it, and don't remove this notice.
|
1995-05-30 08:16:23 +00:00
|
|
|
*
|
1994-09-19 15:41:57 +00:00
|
|
|
* This software is provided "as is".
|
1995-05-30 08:16:23 +00:00
|
|
|
*
|
1994-09-19 15:41:57 +00:00
|
|
|
* The author supplies this software to be publicly redistributed on the
|
|
|
|
* understanding that the author is not responsible for the correct
|
|
|
|
* functioning of this software in any circumstances and is not liable for
|
|
|
|
* any damages caused by this software.
|
1995-05-30 08:16:23 +00:00
|
|
|
*
|
1994-09-19 15:41:57 +00:00
|
|
|
* October 1992
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Format of a boot sector. This is the first sector on a DOS floppy disk
|
|
|
|
* or the fist sector of a partition on a hard disk. But, it is not the
|
|
|
|
* first sector of a partitioned hard disk.
|
|
|
|
*/
|
|
|
|
struct bootsector33 {
|
1998-02-18 09:28:47 +00:00
|
|
|
u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */
|
|
|
|
int8_t bsOemName[8]; /* OEM name and version */
|
|
|
|
int8_t bsBPB[19]; /* BIOS parameter block */
|
|
|
|
int8_t bsDriveNumber; /* drive number (0x80) */
|
|
|
|
int8_t bsBootCode[479]; /* pad so struct is 512b */
|
|
|
|
u_int8_t bsBootSectSig0;
|
|
|
|
u_int8_t bsBootSectSig1;
|
|
|
|
#define BOOTSIG0 0x55
|
|
|
|
#define BOOTSIG1 0xaa
|
1994-09-19 15:41:57 +00:00
|
|
|
};
|
|
|
|
|
1998-02-18 09:28:47 +00:00
|
|
|
struct extboot {
|
|
|
|
int8_t exDriveNumber; /* drive number (0x80) */
|
|
|
|
int8_t exReserved1; /* reserved */
|
|
|
|
int8_t exBootSignature; /* ext. boot signature (0x29) */
|
1994-09-19 15:41:57 +00:00
|
|
|
#define EXBOOTSIG 0x29
|
1998-02-18 09:28:47 +00:00
|
|
|
int8_t exVolumeID[4]; /* volume ID number */
|
|
|
|
int8_t exVolumeLabel[11]; /* volume label */
|
|
|
|
int8_t exFileSysType[8]; /* fs type (FAT12 or FAT16) */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct bootsector50 {
|
|
|
|
u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */
|
|
|
|
int8_t bsOemName[8]; /* OEM name and version */
|
|
|
|
int8_t bsBPB[25]; /* BIOS parameter block */
|
|
|
|
int8_t bsExt[26]; /* Bootsector Extension */
|
|
|
|
int8_t bsBootCode[448]; /* pad so structure is 512b */
|
|
|
|
u_int8_t bsBootSectSig0;
|
|
|
|
u_int8_t bsBootSectSig1;
|
|
|
|
#define BOOTSIG0 0x55
|
|
|
|
#define BOOTSIG1 0xaa
|
|
|
|
};
|
|
|
|
|
|
|
|
struct bootsector710 {
|
|
|
|
u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */
|
|
|
|
int8_t bsOEMName[8]; /* OEM name and version */
|
2002-10-21 19:00:50 +00:00
|
|
|
int8_t bsBPB[53]; /* BIOS parameter block */
|
1998-02-18 09:28:47 +00:00
|
|
|
int8_t bsExt[26]; /* Bootsector Extension */
|
2005-09-29 14:09:46 +00:00
|
|
|
int8_t bsBootCode[420]; /* pad so structure is 512b */
|
1998-02-18 09:28:47 +00:00
|
|
|
u_int8_t bsBootSectSig0;
|
|
|
|
u_int8_t bsBootSectSig1;
|
|
|
|
#define BOOTSIG0 0x55
|
|
|
|
#define BOOTSIG1 0xaa
|
|
|
|
};
|
1994-09-19 15:41:57 +00:00
|
|
|
|
|
|
|
union bootsector {
|
|
|
|
struct bootsector33 bs33;
|
|
|
|
struct bootsector50 bs50;
|
1998-02-18 09:28:47 +00:00
|
|
|
struct bootsector710 bs710;
|
1994-09-19 15:41:57 +00:00
|
|
|
};
|
|
|
|
|
1998-02-18 09:28:47 +00:00
|
|
|
#if 0
|
1994-09-19 15:41:57 +00:00
|
|
|
/*
|
|
|
|
* Shorthand for fields in the bpb.
|
|
|
|
*/
|
|
|
|
#define bsBytesPerSec bsBPB.bpbBytesPerSec
|
|
|
|
#define bsSectPerClust bsBPB.bpbSectPerClust
|
|
|
|
#define bsResSectors bsBPB.bpbResSectors
|
|
|
|
#define bsFATS bsBPB.bpbFATS
|
|
|
|
#define bsRootDirEnts bsBPB.bpbRootDirEnts
|
|
|
|
#define bsSectors bsBPB.bpbSectors
|
|
|
|
#define bsMedia bsBPB.bpbMedia
|
|
|
|
#define bsFATsecs bsBPB.bpbFATsecs
|
|
|
|
#define bsSectPerTrack bsBPB.bpbSectPerTrack
|
|
|
|
#define bsHeads bsBPB.bpbHeads
|
|
|
|
#define bsHiddenSecs bsBPB.bpbHiddenSecs
|
|
|
|
#define bsHugeSectors bsBPB.bpbHugeSectors
|
1998-02-18 09:28:47 +00:00
|
|
|
#endif
|