1 | /*␊ |
2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * ␊ |
5 | * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights␊ |
6 | * Reserved. This file contains Original Code and/or Modifications of␊ |
7 | * Original Code as defined in and that are subject to the Apple Public␊ |
8 | * Source License Version 2.0 (the "License"). You may not use this file␊ |
9 | * except in compliance with the License. Please obtain a copy of the␊ |
10 | * License at http://www.apple.com/publicsource and read it before using␊ |
11 | * this file.␊ |
12 | * ␊ |
13 | * The Original Code and all software distributed under the License are␊ |
14 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
17 | * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the␊ |
18 | * License for the specific language governing rights and limitations␊ |
19 | * under the License.␊ |
20 | * ␊ |
21 | *␊ |
22 | * Copyright (c) 1992 NeXT Computer, Inc.␊ |
23 | *␊ |
24 | * IBM PC disk partitioning data structures.␊ |
25 | *␊ |
26 | * HISTORY␊ |
27 | *␊ |
28 | * 8 July 1992 David E. Bohman at NeXT␊ |
29 | * Created.␊ |
30 | */␊ |
31 | ␊ |
32 | #ifndef __LIBSAIO_FDISK_H␊ |
33 | #define __LIBSAIO_FDISK_H␊ |
34 | ␊ |
35 | #define DISK_BLK0␉␉0 /* blkno of boot block */␊ |
36 | #define DISK_BLK0SZ␉␉512 /* size of boot block */␊ |
37 | #define DISK_BOOTSZ␉␉446 /* size of boot code in boot block */␊ |
38 | #define DISK_SIGNATURE␉␉0xAA55␉/* signature of the boot record */␊ |
39 | #define FDISK_NPART␉␉4 /* number of entries in fdisk table */␊ |
40 | #define FDISK_ACTIVE␉␉0x80␉/* indicator of active partition */␊ |
41 | #define FDISK_NEXTNAME␉␉0xA7␉/* indicator of NeXT partition */␊ |
42 | #define FDISK_DOS12␉␉0x01␉/* 12-bit fat < 10MB dos partition */␊ |
43 | #define FDISK_DOS16S␉␉0x04␉/* 16-bit fat < 32MB dos partition */␊ |
44 | #define FDISK_DOSEXT␉␉0x05␉/* extended dos partition */␊ |
45 | #define FDISK_DOS16B␉␉0x06␉/* 16-bit fat >= 32MB dos partition */␊ |
46 | #define FDISK_NTFS␉␉0x07␉/* NTFS partition */␊ |
47 | #define FDISK_SMALLFAT32␉0x0b␉/* FAT32 partition */␊ |
48 | #define FDISK_FAT32␉␉0x0c␉/* FAT32 partition */␊ |
49 | #define FDISK_DOS16SLBA␉␉0x0e /* 16-bit FAT, LBA-mapped */␊ |
50 | #define FDISK_LINUX␉␉0x83 /* Linux native */␊ |
51 | #define FDISK_OPENBSD␉␉0xa6 /* OpenBSD FFS partition */␊ |
52 | #define FDISK_FREEBSD␉␉0xa5 /* FreeBSD UFS2 partition */␊ |
53 | #define FDISK_BEFS␉␉0xeb /* Haiku BeFS partition */␊ |
54 | #define FDISK_UFS␉␉0xa8␉/* Apple UFS partition */␊ |
55 | #define FDISK_HFS␉␉0xaf␉/* Apple HFS partition */␊ |
56 | #define FDISK_BOOTER␉␉0xab␉/* Apple booter partition */␊ |
57 | ␊ |
58 | /*␊ |
59 | * Format of fdisk partion entry (if present).␊ |
60 | */␊ |
61 | struct fdisk_part␊ |
62 | {␊ |
63 | ␉unsigned char bootid; /* bootable or not */␊ |
64 | ␉unsigned char beghead; /* begining head, sector, cylinder */␊ |
65 | ␉unsigned char begsect; /* begcyl is a 10-bit number */␊ |
66 | ␉unsigned char begcyl; /* High 2 bits are in begsect */␊ |
67 | ␉unsigned char systid; /* OS type */␊ |
68 | ␉unsigned char endhead; /* ending head, sector, cylinder */␊ |
69 | ␉unsigned char endsect; /* endcyl is a 10-bit number */␊ |
70 | ␉unsigned char endcyl; /* High 2 bits are in endsect */␊ |
71 | ␉unsigned long relsect; /* partion physical offset on disk */␊ |
72 | ␉unsigned long numsect; /* number of sectors in partition */␊ |
73 | } __attribute__((packed));␊ |
74 | ␊ |
75 | /*␊ |
76 | * Format of boot block.␊ |
77 | */␊ |
78 | struct disk_blk0␊ |
79 | {␊ |
80 | ␉unsigned char bootcode[DISK_BOOTSZ];␊ |
81 | ␉unsigned char parts[FDISK_NPART][sizeof (struct fdisk_part)];␊ |
82 | ␉unsigned short signature;␊ |
83 | };␊ |
84 | ␊ |
85 | struct REAL_disk_blk0␊ |
86 | {␊ |
87 | ␉unsigned char bootcode[DISK_BOOTSZ];␊ |
88 | ␉struct fdisk_part parts[FDISK_NPART];␊ |
89 | ␉unsigned short signature;␊ |
90 | } __attribute__((packed));␊ |
91 | ␊ |
92 | #endif /* !__LIBSAIO_FDISK_H */␊ |
93 | |