Chameleon

Chameleon Svn Source Tree

Root/tags/2.3/i386/libsaio/fdisk.h

Source at commit HEAD created 4 years 9 months ago.
By ifabio, Few update to kernelPatcher (Credits to CrazyBirdy)
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_BLK00 /* blkno of boot block */
39#define DISK_BLK0SZ512 /* size of boot block */
40#define DISK_BOOTSZ446 /* size of boot code in boot block */
41#define DISK_SIGNATURE0xAA55/* signature of the boot record */
42#define FDISK_NPART4 /* number of entries in fdisk table */
43#define FDISK_ACTIVE0x80/* indicator of active partition */
44
45
46#define FDISK_DOS120x01/* 12-bit fat < 10MB dos partition */
47#define FDISK_DOS16S0x04/* 16-bit fat < 32MB dos partition */
48#define FDISK_DOSEXT0x05/* extended DOS partition */
49#define FDISK_DOS16B0x06/* 16-bit fat >= 32MB dos partition */
50#define FDISK_NTFS0x07/* NTFS partition */
51#define FDISK_SMALLFAT320x0B/* DOS FAT32 partition */
52#define FDISK_FAT320x0C/* Win FAT32 partition */
53#define FDISK_DOS16SLBA0x0E /* Win 16-bit FAT, LBA-mapped */
54#define FDISK_WIN_LDM0x42/* NTFS partition */
55#define FDISK_LINUX_SWAP0x82 /* Linux swap */
56#define FDISK_LINUX0x83 /* Linux native */
57#define FDISK_LINUX_LVM0x8E /* Linux LVM */
58#define FDISK_FREEBSD0xA5 /* FreeBSD UFS2 partition */
59#define FDISK_OPENBSD0xA6 /* OpenBSD FFS partition */
60#define FDISK_NEXTNAME0xA7/* Indicator of NeXT partition */
61#define FDISK_UFS0xA8/* Apple UFS partition */
62#define FDISK_NETBSD0xA9 /* NetBSD disk label */
63#define FDISK_BOOTER0xAB/* Apple booter partition */
64#define FDISK_ENCRYPTED0xAE/* Apple encrypted */
65#define FDISK_HFS0xAF/* Apple HFS partition */
66#define FDISK_BEFS0xEB /* Haiku BeFS partition */
67#define FDISK_LINUX_RAID0xFD /* Linux RAID */
68#define FDISK_PSEUDO_EXFAT0x107/* Shared with FDISK_NTFS */
69
70/*
71 * Format of fdisk partion entry (if present).
72 */
73struct fdisk_part {
74unsigned char bootid; /* bootable or not */
75unsigned char beghead; /* begining head, sector, cylinder */
76unsigned char begsect; /* begcyl is a 10-bit number */
77unsigned char begcyl; /* High 2 bits are in begsect */
78unsigned char systid; /* OS type */
79unsigned char endhead; /* ending head, sector, cylinder */
80unsigned char endsect; /* endcyl is a 10-bit number */
81unsigned char endcyl; /* High 2 bits are in endsect */
82unsigned long relsect; /* partion physical offset on disk */
83unsigned long numsect; /* number of sectors in partition */
84} __attribute__((packed));
85
86/*
87 * Format of boot block.
88 */
89struct disk_blk0 {
90unsigned char bootcode[DISK_BOOTSZ];
91unsigned char parts[FDISK_NPART][sizeof (struct fdisk_part)];
92unsigned short signature;
93};
94
95struct REAL_disk_blk0 {
96unsigned char bootcode[DISK_BOOTSZ];
97struct fdisk_part parts[FDISK_NPART];
98unsigned short signature;
99} __attribute__((packed));
100
101#endif /* !__LIBSAIO_FDISK_H */
102

Archive Download this file

Revision: HEAD