summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/bootsect.h
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-02-18 09:28:47 +0000
committerjkh <jkh@FreeBSD.org>1998-02-18 09:28:47 +0000
commit90f90fc3470f6725b317b359c1b3149995b822b7 (patch)
treea41d30021bc38cb8b60af8e616a1a634111adecc /sys/fs/msdosfs/bootsect.h
parent4430df5b848751ab6f0d04b584f8c0921f47d494 (diff)
downloadFreeBSD-src-90f90fc3470f6725b317b359c1b3149995b822b7.zip
FreeBSD-src-90f90fc3470f6725b317b359c1b3149995b822b7.tar.gz
Update MSDOSFS code using NetBSD's msdosfs as a guide to support
FAT32 partitions. Unfortunately, we looked around here at Walnut Creek CDROM for any newer FAT32-supporting versions of Win95 and we were unsuccessful; only the older stuff here. So this is untested beyond simply making sure it compiles and someone with access to an actual FAT32 fs will have to let us know how well it actually works. Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> Obtained from: NetBSD
Diffstat (limited to 'sys/fs/msdosfs/bootsect.h')
-rw-r--r--sys/fs/msdosfs/bootsect.h87
1 files changed, 65 insertions, 22 deletions
diff --git a/sys/fs/msdosfs/bootsect.h b/sys/fs/msdosfs/bootsect.h
index 86fc415..11b93371a 100644
--- a/sys/fs/msdosfs/bootsect.h
+++ b/sys/fs/msdosfs/bootsect.h
@@ -1,5 +1,5 @@
-/* $Id$ */
-/* $NetBSD: bootsect.h,v 1.4 1994/06/29 06:35:28 cgd Exp $ */
+/* $Id: bootsect.h,v 1.5 1997/02/22 09:40:43 peter Exp $ */
+/* $NetBSD: bootsect.h,v 1.9 1997/11/17 15:36:17 ws Exp $ */
/*
* Written by Paul Popelka (paulp@uts.amdahl.com)
@@ -23,36 +23,78 @@
* 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[479]; /* pad so structure is 512 bytes long */
- u_short bsBootSectSig;
-#define BOOTSIG 0xaa55
+ 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
};
-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) */
+struct extboot {
+ int8_t exDriveNumber; /* drive number (0x80) */
+ int8_t exReserved1; /* reserved */
+ int8_t exBootSignature; /* ext. 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
+ 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 */
+ int8_t bsPBP[53]; /* BIOS parameter block */
+ int8_t bsExt[26]; /* Bootsector Extension */
+ int8_t bsBootCode[418]; /* pad so structure is 512b */
+ u_int8_t bsBootSectSig2; /* 2 & 3 are only defined for FAT32? */
+ u_int8_t bsBootSectSig3;
+ u_int8_t bsBootSectSig0;
+ u_int8_t bsBootSectSig1;
+#define BOOTSIG0 0x55
+#define BOOTSIG1 0xaa
+#define BOOTSIG2 0
+#define BOOTSIG3 0
+};
+#ifdef atari
+/*
+ * The boot sector on a gemdos fs is a little bit different from the msdos fs
+ * format. Currently there is no need to declare a seperate structure, the
+ * bootsector33 struct will do.
+ */
+#if 0
+struct bootsec_atari {
+ u_int8_t bsBranch[2]; /* branch inst if auto-boot */
+ int8_t bsFiller[6]; /* anything or nothing */
+ int8_t bsSerial[3]; /* serial no. for mediachange */
+ int8_t bsBPB[19]; /* BIOS parameter block */
+ int8_t bsBootCode[482]; /* pad so struct is 512b */
};
+#endif
+#endif /* atari */
union bootsector {
struct bootsector33 bs33;
struct bootsector50 bs50;
+ struct bootsector710 bs710;
};
+#if 0
/*
* Shorthand for fields in the bpb.
*/
@@ -68,3 +110,4 @@ union bootsector {
#define bsHeads bsBPB.bpbHeads
#define bsHiddenSecs bsBPB.bpbHiddenSecs
#define bsHugeSectors bsBPB.bpbHugeSectors
+#endif
OpenPOWER on IntegriCloud