]> git.saurik.com Git - apple/boot.git/blob - i386/libsaio/fdisk.h
cda163d8065b2286fc9d44602c2e85778ad3d53f
[apple/boot.git] / i386 / libsaio / fdisk.h
1 /*
2 * Copyright (c) 1999 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 /*
26 * Copyright (c) 1992 NeXT Computer, Inc.
27 *
28 * IBM PC disk partitioning data structures.
29 *
30 * HISTORY
31 *
32 * 8 July 1992 David E. Bohman at NeXT
33 * Created.
34 */
35
36 #ifndef __LIBSAIO_FDISK_H
37 #define __LIBSAIO_FDISK_H
38
39 #define DISK_BLK0 0 /* blkno of boot block */
40 #define DISK_BLK0SZ 512 /* size of boot block */
41 #define DISK_BOOTSZ 446 /* size of boot code in boot block */
42 #define DISK_SIGNATURE 0xAA55 /* signature of the boot record */
43 #define FDISK_NPART 4 /* number of entries in fdisk table */
44 #define FDISK_ACTIVE 0x80 /* indicator of active partition */
45 #define FDISK_NEXTNAME 0xA7 /* indicator of NeXT partition */
46 #define FDISK_DOS12 0x01 /* 12-bit fat < 10MB dos partition */
47 #define FDISK_DOS16S 0x04 /* 16-bit fat < 32MB dos partition */
48 #define FDISK_DOSEXT 0x05 /* extended dos partition */
49 #define FDISK_DOS16B 0x06 /* 16-bit fat >= 32MB dos partition */
50 #define FDISK_UFS 0xa8 /* Apple UFS partition */
51 #define FDISK_HFS 0xaf /* Apple HFS partition */
52 #define FDISK_BOOTER 0xab /* Apple booter partition */
53
54 /*
55 * Format of fdisk partion entry (if present).
56 */
57 struct fdisk_part {
58 unsigned char bootid; /* bootable or not */
59 unsigned char beghead; /* begining head, sector, cylinder */
60 unsigned char begsect; /* begcyl is a 10-bit number */
61 unsigned char begcyl; /* High 2 bits are in begsect */
62 unsigned char systid; /* OS type */
63 unsigned char endhead; /* ending head, sector, cylinder */
64 unsigned char endsect; /* endcyl is a 10-bit number */
65 unsigned char endcyl; /* High 2 bits are in endsect */
66 unsigned long relsect; /* partion physical offset on disk */
67 unsigned long numsect; /* number of sectors in partition */
68 };
69
70 /*
71 * Format of boot block.
72 */
73 struct disk_blk0 {
74 unsigned char bootcode[DISK_BOOTSZ];
75 unsigned char parts[FDISK_NPART][sizeof (struct fdisk_part)];
76 unsigned short signature;
77 };
78
79 #endif /* !__LIBSAIO_FDISK_H */