1/* 2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 7 * 8 * This file contains Original Code and/or Modifications of Original Code 9 * as defined in and that are subject to the Apple Public Source License 10 * Version 2.0 (the 'License'). You may not use this file except in 11 * compliance with the License. Please obtain a copy of the License at 12 * http://www.opensource.apple.com/apsl/ and read it before using this 13 * file. 14 * 15 * The Original Code and all software distributed under the License are 16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 20 * Please see the License for the specific language governing rights and 21 * limitations under the License. 22 * 23 * @APPLE_LICENSE_HEADER_END@ 24 */ 25/* $FreeBSD: src/sys/msdosfs/bootsect.h,v 1.7 1999/08/28 00:48:06 peter Exp $ */ 26/* $NetBSD: bootsect.h,v 1.9 1997/11/17 15:36:17 ws Exp $ */ 27 28/* 29 * Written by Paul Popelka (paulp@uts.amdahl.com) 30 * 31 * You can do anything you want with this software, just don't say you wrote 32 * it, and don't remove this notice. 33 * 34 * This software is provided "as is". 35 * 36 * The author supplies this software to be publicly redistributed on the 37 * understanding that the author is not responsible for the correct 38 * functioning of this software in any circumstances and is not liable for 39 * any damages caused by this software. 40 * 41 * October 1992 42 */ 43 44#include <sys/types.h> 45 46/* 47 * Format of a boot sector. This is the first sector on a DOS floppy disk 48 * or the fist sector of a partition on a hard disk. But, it is not the 49 * first sector of a partitioned hard disk. 50 */ 51struct bootsector33 { 52 u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ 53 int8_t bsOemName[8]; /* OEM name and version */ 54 int8_t bsBPB[19]; /* BIOS parameter block */ 55 int8_t bsDriveNumber; /* drive number (0x80) */ 56 int8_t bsBootCode[479]; /* pad so struct is 512b */ 57 u_int8_t bsBootSectSig0; 58 u_int8_t bsBootSectSig1; 59#define BOOTSIG0 0x55 60#define BOOTSIG1 0xaa 61}; 62 63struct extboot { 64 int8_t exDriveNumber; /* drive number (0x80) */ 65 int8_t exReserved1; /* reserved */ 66 int8_t exBootSignature; /* ext. boot signature (0x29) */ 67#define EXBOOTSIG 0x29 68 int8_t exVolumeID[4]; /* volume ID number */ 69 int8_t exVolumeLabel[11]; /* volume label */ 70 int8_t exFileSysType[8]; /* fs type (FAT12 or FAT16) */ 71}; 72 73struct bootsector50 { 74 u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ 75 int8_t bsOemName[8]; /* OEM name and version */ 76 int8_t bsBPB[25]; /* BIOS parameter block */ 77 int8_t bsExt[26]; /* Bootsector Extension */ 78 int8_t bsBootCode[448]; /* pad so structure is 512b */ 79 u_int8_t bsBootSectSig0; 80 u_int8_t bsBootSectSig1; 81#define BOOTSIG0 0x55 82#define BOOTSIG1 0xaa 83}; 84 85struct bootsector710 { 86 u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ 87 int8_t bsOEMName[8]; /* OEM name and version */ 88 int8_t bsBPB[53]; /* BIOS parameter block */ 89 int8_t bsExt[26]; /* Bootsector Extension */ 90 int8_t bsBootCode[420]; /* pad so structure is 512b */ 91 u_int8_t bsBootSectSig0; 92 u_int8_t bsBootSectSig1; 93#define BOOTSIG0 0x55 94#define BOOTSIG1 0xaa 95}; 96 97union bootsector { 98 struct bootsector33 bs33; 99 struct bootsector50 bs50; 100 struct bootsector710 bs710; 101}; 102