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