Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/i386/libsaio/fdisk.h

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_BLK00 /* blkno of boot block */
36#define DISK_BLK0SZ512 /* size of boot block */
37#define DISK_BOOTSZ446 /* size of boot code in boot block */
38#define DISK_SIGNATURE0xAA55/* signature of the boot record */
39#define FDISK_NPART4 /* number of entries in fdisk table */
40#define FDISK_ACTIVE0x80/* indicator of active partition */
41#define FDISK_NEXTNAME0xA7/* indicator of NeXT partition */
42#define FDISK_DOS120x01/* 12-bit fat < 10MB dos partition */
43#define FDISK_DOS16S0x04/* 16-bit fat < 32MB dos partition */
44#define FDISK_DOSEXT0x05/* extended dos partition */
45#define FDISK_DOS16B0x06/* 16-bit fat >= 32MB dos partition */
46#define FDISK_NTFS0x07/* NTFS partition */
47#define FDISK_SMALLFAT320x0b/* FAT32 partition */
48#define FDISK_FAT320x0c/* FAT32 partition */
49#define FDISK_DOS16SLBA0x0e /* 16-bit FAT, LBA-mapped */
50#define FDISK_LINUX0x83 /* Linux native */
51#define FDISK_OPENBSD0xa6 /* OpenBSD FFS partition */
52#define FDISK_FREEBSD0xa5 /* FreeBSD UFS2 partition */
53#define FDISK_BEFS0xeb /* Haiku BeFS partition */
54#define FDISK_UFS0xa8/* Apple UFS partition */
55#define FDISK_HFS0xaf/* Apple HFS partition */
56#define FDISK_BOOTER0xab/* Apple booter partition */
57
58/*
59 * Format of fdisk partion entry (if present).
60 */
61struct fdisk_part
62{
63unsigned char bootid; /* bootable or not */
64unsigned char beghead; /* begining head, sector, cylinder */
65unsigned char begsect; /* begcyl is a 10-bit number */
66unsigned char begcyl; /* High 2 bits are in begsect */
67unsigned char systid; /* OS type */
68unsigned char endhead; /* ending head, sector, cylinder */
69unsigned char endsect; /* endcyl is a 10-bit number */
70unsigned char endcyl; /* High 2 bits are in endsect */
71unsigned long relsect; /* partion physical offset on disk */
72unsigned long numsect; /* number of sectors in partition */
73} __attribute__((packed));
74
75/*
76 * Format of boot block.
77 */
78struct disk_blk0
79{
80unsigned char bootcode[DISK_BOOTSZ];
81unsigned char parts[FDISK_NPART][sizeof (struct fdisk_part)];
82unsigned short signature;
83};
84
85struct REAL_disk_blk0
86{
87unsigned char bootcode[DISK_BOOTSZ];
88struct fdisk_part parts[FDISK_NPART];
89unsigned short signature;
90} __attribute__((packed));
91
92#endif /* !__LIBSAIO_FDISK_H */
93

Archive Download this file

Revision: 2045