Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/libsaio/fdisk.h

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

Archive Download this file

Revision: 1724