diff options
author | dfr <dfr@FreeBSD.org> | 1994-09-19 15:41:57 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1994-09-19 15:41:57 +0000 |
commit | 7efbb964fdff1348e01bdcd7d4bb59551c389bef (patch) | |
tree | 4ee90f451b7756bcd74bbc0c7e0ef0219507ff02 /sys/fs/msdosfs/bootsect.h | |
parent | 7a224749be53b3a6bdb826ffbd93208f0b757586 (diff) | |
download | FreeBSD-src-7efbb964fdff1348e01bdcd7d4bb59551c389bef.zip FreeBSD-src-7efbb964fdff1348e01bdcd7d4bb59551c389bef.tar.gz |
Added msdosfs.
Obtained from: NetBSD
Diffstat (limited to 'sys/fs/msdosfs/bootsect.h')
-rw-r--r-- | sys/fs/msdosfs/bootsect.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/sys/fs/msdosfs/bootsect.h b/sys/fs/msdosfs/bootsect.h new file mode 100644 index 0000000..099b15f --- /dev/null +++ b/sys/fs/msdosfs/bootsect.h @@ -0,0 +1,70 @@ +/* $Id$ */ +/* $NetBSD: bootsect.h,v 1.4 1994/06/29 06:35:28 cgd Exp $ */ + +/* + * 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 + */ + +/* + * 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 { + u_char bsJump[3]; /* jump instruction E9xxxx or EBxx90 */ + char bsOemName[8]; /* OEM name and version */ + char bsBPB[19]; /* BIOS parameter block */ + char bsDriveNumber; /* drive number (0x80) */ + char bsBootCode[474]; /* pad so structure is 512 bytes long */ + u_short bsBootSectSig; +#define BOOTSIG 0xaa55 +}; + +struct bootsector50 { + u_char bsJump[3]; /* jump instruction E9xxxx or EBxx90 */ + char bsOemName[8]; /* OEM name and version */ + char bsBPB[25]; /* BIOS parameter block */ + char bsDriveNumber; /* drive number (0x80) */ + char bsReserved1; /* reserved */ + char bsBootSignature; /* extended boot signature (0x29) */ +#define EXBOOTSIG 0x29 + char bsVolumeID[4]; /* volume ID number */ + char bsVolumeLabel[11]; /* volume label */ + char bsFileSysType[8]; /* file system type (FAT12 or FAT16) */ + char bsBootCode[448]; /* pad so structure is 512 bytes long */ + u_short bsBootSectSig; +#define BOOTSIG 0xaa55 +}; + +union bootsector { + struct bootsector33 bs33; + struct bootsector50 bs50; +}; + +/* + * 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 |