]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/disktab.h
0d1d60f975be15583d87639d7abb26db97188b50
[apple/xnu.git] / bsd / sys / disktab.h
1 /*
2 * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * HISTORY:
32 * 16-Mar-88 John Seamons (jks) at NeXT
33 * Cleaned up to support standard disk label definitions.
34 *
35 * 24-Feb-88 Mike DeMoney (mike) at NeXT
36 * Added d_boot0_blkno to indicate logical block number
37 * of "block 0" boot. This blkno is in d_secsize sectors.
38 * Added d_bootfile to indicate the default operating system
39 * image to be booted by the blk 0 boot.
40 * Changed d_name and d_type to be char arrays rather than ptrs
41 * so they are part of label. This limits length of info in
42 * /etc/disktab, sorry.
43 */
44
45 #ifndef _SYS_DISKTAB_
46 #define _SYS_DISKTAB_
47
48 #include <sys/appleapiopts.h>
49
50 #ifdef __APPLE_API_OBSOLETE
51
52 /*
53 * Disk description table, see disktab(5)
54 */
55 #ifndef KERNEL
56 #define DISKTAB "/etc/disktab"
57 #endif /* !KERNEL */
58
59 #define MAXDNMLEN 24 // drive name length
60 #define MAXMPTLEN 16 // mount point length
61 #define MAXFSTLEN 8 // file system type length
62 #define MAXTYPLEN 24 // drive type length
63 #define NBOOTS 2 // # of boot blocks
64 #define MAXBFLEN 24 // bootfile name length
65 #define MAXHNLEN 32 // host name length
66 #define NPART 8 // # of partitions
67
68 typedef struct partition {
69 int p_base; /* base sector# of partition */
70 int p_size; /* #sectors in partition */
71 short p_bsize; /* block size in bytes */
72 short p_fsize; /* frag size in bytes */
73 char p_opt; /* 's'pace/'t'ime optimization pref */
74 short p_cpg; /* cylinders per group */
75 short p_density; /* bytes per inode density */
76 char p_minfree; /* minfree (%) */
77 char p_newfs; /* run newfs during init */
78 char p_mountpt[MAXMPTLEN];/* mount point */
79 char p_automnt; /* auto-mount when inserted */
80 char p_type[MAXFSTLEN];/* file system type */
81 } partition_t;
82
83 typedef struct disktab {
84 char d_name[MAXDNMLEN]; /* drive name */
85 char d_type[MAXTYPLEN]; /* drive type */
86 int d_secsize; /* sector size in bytes */
87 int d_ntracks; /* # tracks/cylinder */
88 int d_nsectors; /* # sectors/track */
89 int d_ncylinders; /* # cylinders */
90 int d_rpm; /* revolutions/minute */
91 short d_front; /* size of front porch (sectors) */
92 short d_back; /* size of back porch (sectors) */
93 short d_ngroups; /* number of alt groups */
94 short d_ag_size; /* alt group size (sectors) */
95 short d_ag_alts; /* alternate sectors / alt group */
96 short d_ag_off; /* sector offset to first alternate */
97 int d_boot0_blkno[NBOOTS]; /* "blk 0" boot locations */
98 char d_bootfile[MAXBFLEN]; /* default bootfile */
99 char d_hostname[MAXHNLEN]; /* host name */
100 char d_rootpartition; /* root partition e.g. 'a' */
101 char d_rwpartition; /* r/w partition e.g. 'b' */
102 partition_t d_partitions[NPART];
103 } disktab_t;
104
105 #ifndef KERNEL
106 struct disktab *getdiskbyname(), *getdiskbydev();
107 #endif /* !KERNEL */
108
109 #endif /* __APPLE_API_OBSOLETE */
110
111 #endif /* _SYS_DISKTAB_ */