* Written by Paul Popelka (paulp@uts.amdahl.com)
*
* You can do anything you want with this software, just don't say you wrote
* it, and don't remove this notice.
*
* This software is provided "as is".
*
* 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.
*
* October 1992
*/
#ifndef _FS_MSDOSFS_BOOTSECT_H_
#define _FS_MSDOSFS_BOOTSECT_H_
* 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 {
uint8_t bsJump[3];
int8_t bsOemName[8];
int8_t bsBPB[19];
int8_t bsDriveNumber;
int8_t bsBootCode[479];
uint8_t bsBootSectSig0;
uint8_t bsBootSectSig1;
#define BOOTSIG0 0x55
#define BOOTSIG1 0xaa
};
struct extboot {
int8_t exDriveNumber;
int8_t exReserved1;
int8_t exBootSignature;
#define EXBOOTSIG 0x29
int8_t exVolumeID[4];
int8_t exVolumeLabel[11];
int8_t exFileSysType[8];
};
struct bootsector50 {
uint8_t bsJump[3];
int8_t bsOemName[8];
int8_t bsBPB[25];
int8_t bsExt[26];
int8_t bsBootCode[448];
uint8_t bsBootSectSig0;
uint8_t bsBootSectSig1;
#define BOOTSIG0 0x55
#define BOOTSIG1 0xaa
};
struct bootsector710 {
uint8_t bsJump[3];
int8_t bsOEMName[8];
int8_t bsBPB[53];
int8_t bsExt[26];
int8_t bsBootCode[420];
uint8_t bsBootSectSig0;
uint8_t bsBootSectSig1;
#define BOOTSIG0 0x55
#define BOOTSIG1 0xaa
};
union bootsector {
struct bootsector33 bs33;
struct bootsector50 bs50;
struct bootsector710 bs710;
};
#if 0
* 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
#endif
#endif