]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/disktab.h
12015dfde129da44932486c6770d6bdd40022e86
[apple/xnu.git] / bsd / sys / disktab.h
1 /*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * 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, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * HISTORY:
25 * 16-Mar-88 John Seamons (jks) at NeXT
26 * Cleaned up to support standard disk label definitions.
27 *
28 * 24-Feb-88 Mike DeMoney (mike) at NeXT
29 * Added d_boot0_blkno to indicate logical block number
30 * of "block 0" boot. This blkno is in d_secsize sectors.
31 * Added d_bootfile to indicate the default operating system
32 * image to be booted by the blk 0 boot.
33 * Changed d_name and d_type to be char arrays rather than ptrs
34 * so they are part of label. This limits length of info in
35 * /etc/disktab, sorry.
36 */
37
38 #ifndef _SYS_DISKTAB_
39 #define _SYS_DISKTAB_
40
41 #include <sys/appleapiopts.h>
42
43 #ifdef __APPLE_API_OBSOLETE
44
45 /*
46 * Disk description table, see disktab(5)
47 */
48 #ifndef KERNEL
49 #define DISKTAB "/etc/disktab"
50 #endif /* !KERNEL */
51
52 #define MAXDNMLEN 24 // drive name length
53 #define MAXMPTLEN 16 // mount point length
54 #define MAXFSTLEN 8 // file system type length
55 #define MAXTYPLEN 24 // drive type length
56 #define NBOOTS 2 // # of boot blocks
57 #define MAXBFLEN 24 // bootfile name length
58 #define MAXHNLEN 32 // host name length
59 #define NPART 8 // # of partitions
60
61 typedef struct partition {
62 int p_base; /* base sector# of partition */
63 int p_size; /* #sectors in partition */
64 short p_bsize; /* block size in bytes */
65 short p_fsize; /* frag size in bytes */
66 char p_opt; /* 's'pace/'t'ime optimization pref */
67 short p_cpg; /* cylinders per group */
68 short p_density; /* bytes per inode density */
69 char p_minfree; /* minfree (%) */
70 char p_newfs; /* run newfs during init */
71 char p_mountpt[MAXMPTLEN];/* mount point */
72 char p_automnt; /* auto-mount when inserted */
73 char p_type[MAXFSTLEN];/* file system type */
74 } partition_t;
75
76 typedef struct disktab {
77 char d_name[MAXDNMLEN]; /* drive name */
78 char d_type[MAXTYPLEN]; /* drive type */
79 int d_secsize; /* sector size in bytes */
80 int d_ntracks; /* # tracks/cylinder */
81 int d_nsectors; /* # sectors/track */
82 int d_ncylinders; /* # cylinders */
83 int d_rpm; /* revolutions/minute */
84 short d_front; /* size of front porch (sectors) */
85 short d_back; /* size of back porch (sectors) */
86 short d_ngroups; /* number of alt groups */
87 short d_ag_size; /* alt group size (sectors) */
88 short d_ag_alts; /* alternate sectors / alt group */
89 short d_ag_off; /* sector offset to first alternate */
90 int d_boot0_blkno[NBOOTS]; /* "blk 0" boot locations */
91 char d_bootfile[MAXBFLEN]; /* default bootfile */
92 char d_hostname[MAXHNLEN]; /* host name */
93 char d_rootpartition; /* root partition e.g. 'a' */
94 char d_rwpartition; /* r/w partition e.g. 'b' */
95 partition_t d_partitions[NPART];
96 } disktab_t;
97
98 #ifndef KERNEL
99 struct disktab *getdiskbyname(), *getdiskbydev();
100 #endif /* !KERNEL */
101
102 #endif /* __APPLE_API_OBSOLETE */
103
104 #endif /* _SYS_DISKTAB_ */