Annotation of Gnu-Mach/i386/i386at/disk.h, revision 1.1.1.2

1.1       root        1: /* 
                      2:  * Mach Operating System
                      3:  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
                      4:  * All Rights Reserved.
                      5:  * 
                      6:  * Permission to use, copy, modify and distribute this software and its
                      7:  * documentation is hereby granted, provided that both the copyright
                      8:  * notice and this permission notice appear in all copies of the
                      9:  * software, derivative works or modified versions, and any portions
                     10:  * thereof, and that both notices appear in supporting documentation.
                     11:  * 
                     12:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
                     13:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
                     14:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
                     15:  * 
                     16:  * Carnegie Mellon requests users of this software to return to
                     17:  * 
                     18:  *  Software Distribution Coordinator  or  [email protected]
                     19:  *  School of Computer Science
                     20:  *  Carnegie Mellon University
                     21:  *  Pittsburgh PA 15213-3890
                     22:  * 
                     23:  * any improvements or extensions that they make and grant Carnegie Mellon
                     24:  * the rights to redistribute these changes.
                     25:  */
                     26: /*
                     27:   Copyright 1988, 1989 by Intel Corporation, Santa Clara, California.
                     28: 
                     29:                All Rights Reserved
                     30: 
                     31: Permission to use, copy, modify, and distribute this software and
                     32: its documentation for any purpose and without fee is hereby
                     33: granted, provided that the above copyright notice appears in all
                     34: copies and that both the copyright notice and this permission notice
                     35: appear in supporting documentation, and that the name of Intel
                     36: not be used in advertising or publicity pertaining to distribution
                     37: of the software without specific, written prior permission.
                     38: 
                     39: INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
                     40: INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
                     41: IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
                     42: CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
                     43: LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
                     44: NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
                     45: WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     46: */
                     47: 
                     48: /*
                     49:  * disk.h
                     50:  */
                     51: 
1.1.1.2 ! root       52: #ifndef _DISK_H_
        !            53: #define _DISK_H_
        !            54: 
1.1       root       55: /* Grab the public part.  */
                     56: #include <mach/machine/disk.h>
                     57: 
                     58: 
                     59: 
                     60: #define MAX_ALTENTS     253            /* Maximum # of slots for alts */
                     61:                                        /* allowed for in the table. */
                     62: 
                     63: #define ALT_SANITY      0xdeadbeef      /* magic # to validate alt table */
                     64: 
                     65: struct  alt_table {
                     66:        u_short alt_used;               /* # of alternates already assigned */
                     67:        u_short alt_reserved;           /* # of alternates reserved on disk */
                     68:        long    alt_base;               /* 1st sector (abs) of the alt area */
                     69:        long    alt_bad[MAX_ALTENTS];   /* list of bad sectors/tracks   */
                     70: };
                     71: 
                     72: struct alt_info {                      /* table length should be multiple of 512 */
                     73:        long    alt_sanity;             /* to validate correctness */
                     74:        u_short alt_version;            /* to corroborate vintage */
                     75:        u_short alt_pad;                /* padding for alignment */
                     76:        struct alt_table alt_trk;       /* bad track table */
                     77:        struct alt_table alt_sec;       /* bad sector table */
                     78: };
                     79: typedef struct alt_info altinfo_t;
                     80: 
                     81: #define V_NUMPAR        16              /* maximum number of partitions */
                     82: 
                     83: #define VTOC_SANE       0x600DDEEE      /* Indicates a sane VTOC */
                     84: #define PDLOCATION     29              /* location of VTOC */
                     85: 
                     86: #define BAD_BLK         0x80                    /* needed for V_VERIFY */
                     87: /* BAD_BLK moved from old hdreg.h */
                     88: 
                     89: 
                     90: #define        HDPDLOC         29              /* location of pdinfo/vtoc */
                     91: #define        LBLLOC          1               /* label block for xxxbsd */
                     92: 
                     93: /* Partition permission flags */
                     94: #define V_OPEN          0x100           /* Partition open (for driver use) */
                     95: #define V_VALID         0x200           /* Partition is valid to use */
                     96: 
                     97: 
                     98: 
                     99: /* Sanity word for the physical description area */
                    100: #define VALID_PD               0xCA5E600D
                    101: 
                    102: struct localpartition  {
                    103:        u_int   p_flag;                 /*permision flags*/
                    104:        long    p_start;                /*physical start sector no of partition*/
                    105:        long    p_size;                 /*# of physical sectors in partition*/
                    106: };
                    107: typedef struct localpartition localpartition_t;
                    108: 
                    109: struct evtoc {
                    110:        u_int   fill0[6];
                    111:        u_int   cyls;                   /*number of cylinders per drive*/
                    112:        u_int   tracks;                 /*number tracks per cylinder*/
                    113:        u_int   sectors;                /*number sectors per track*/
                    114:        u_int   fill1[13];
                    115:        u_int   version;                /*layout version*/
                    116:        u_int   alt_ptr;                /*byte offset of alternates table*/
                    117:        u_short alt_len;                /*byte length of alternates table*/
                    118:        u_int   sanity;                 /*to verify vtoc sanity*/
                    119:        u_int   xcyls;                  /*number of cylinders per drive*/
                    120:        u_int   xtracks;                /*number tracks per cylinder*/
                    121:        u_int   xsectors;               /*number sectors per track*/
                    122:        u_short nparts;                 /*number of partitions*/
                    123:        u_short fill2;                  /*pad for 286 compiler*/
                    124:        char    label[40];
                    125:        struct localpartition part[V_NUMPAR];/*partition headers*/
                    126:        char    fill[512-352];
                    127: };
                    128: 
                    129: union   io_arg {
                    130:        struct  {
                    131:                u_short ncyl;           /* number of cylinders on drive */
                    132:                u_char  nhead;          /* number of heads/cyl */
                    133:                u_char  nsec;           /* number of sectors/track */
                    134:                u_short secsiz;         /* number of bytes/sector */
                    135:                } ia_cd;                /* used for Configure Drive cmd */
                    136:        struct  {
                    137:                u_short flags;          /* flags (see below) */
                    138:                long    bad_sector;     /* absolute sector number */
                    139:                long    new_sector;     /* RETURNED alternate sect assigned */
                    140:                } ia_abs;               /* used for Add Bad Sector cmd */
                    141:        struct  {
                    142:                u_short start_trk;      /* first track # */
                    143:                u_short num_trks;       /* number of tracks to format */
                    144:                u_short intlv;          /* interleave factor */
                    145:                } ia_fmt;               /* used for Format Tracks cmd */
                    146:        struct  {
                    147:                u_short start_trk;      /* first track  */
                    148:                char    *intlv_tbl;     /* interleave table */
                    149:                } ia_xfmt;              /* used for the V_XFORMAT ioctl */
                    150: };
                    151: 
                    152: 
                    153: #define BOOTSZ         446             /* size of boot code in master boot block */
                    154: #define FD_NUMPART     4               /* number of 'partitions' in fdisk table */
                    155: #define ACTIVE         128             /* indicator of active partition */
                    156: #define        BOOT_MAGIC      0xAA55          /* signature of the boot record */
                    157: #define        UNIXOS          99              /* UNIX partition */
                    158: #define BSDOS          165
                    159: #define LINUXSWAP      130
                    160: #define LINUXOS                131
                    161: extern int             OS;             /* what partition we came from */
                    162: 
                    163: /*
                    164:  * structure to hold the fdisk partition table
                    165:  */
                    166: struct ipart {
                    167:        u_char  bootid;                 /* bootable or not */
                    168:        u_char  beghead;                /* beginning head, sector, cylinder */
                    169:        u_char  begsect;                /* begcyl is a 10-bit number. High 2 bits */
                    170:        u_char  begcyl;                 /*     are in begsect. */
                    171:        u_char  systid;                 /* OS type */
                    172:        u_char  endhead;                /* ending head, sector, cylinder */
                    173:        u_char  endsect;                /* endcyl is a 10-bit number.  High 2 bits */
                    174:        u_char  endcyl;                 /*     are in endsect. */
                    175:        long    relsect;                /* first sector relative to start of disk */
                    176:        long    numsect;                /* number of sectors in partition */
                    177: };
                    178: 
                    179: /*
                    180:  * structure to hold master boot block in physical sector 0 of the disk.
                    181:  * Note that partitions stuff can't be directly included in the structure
                    182:  * because of lameo '386 compiler alignment design.
                    183:  */
                    184: struct  mboot {                                     /* master boot block */
                    185:        char    bootinst[BOOTSZ];
                    186:        char    parts[FD_NUMPART * sizeof(struct ipart)];
                    187:        u_short signature;
                    188: };
                    189: 
1.1.1.2 ! root      190: #endif /* _DISK_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.