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