The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i386at/hdreg.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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  Software.Distribution@CS.CMU.EDU
   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  * HISTORY
   28  * $Log:        hdreg.h,v $
   29  * Revision 2.7  91/10/07  17:25:45  af
   30  *      Made port addresses dependent on base address, cleaned up hh struct
   31  *      [91/08/07            mg32]
   32  * 
   33  * Revision 2.6  91/05/14  16:23:39  mrt
   34  *      Correcting copyright
   35  * 
   36  * Revision 2.5  91/02/05  17:17:17  mrt
   37  *      Changed to new Mach copyright
   38  *      [91/02/01  17:43:16  mrt]
   39  * 
   40  * Revision 2.4  90/11/26  14:49:40  rvb
   41  *      jsb bet me to XMK34, sigh ...
   42  *      [90/11/26            rvb]
   43  *      Synched 2.5 & 3.0 at I386q (r1.5.1.5) & XMK35 (r2.4)
   44  *      [90/11/15            rvb]
   45  * 
   46  * Revision 1.5.1.4  90/07/27  11:25:57  rvb
   47  *      Fix Intel Copyright as per B. Davies authorization.
   48  *      [90/07/27            rvb]
   49  * 
   50  * Revision 2.2  90/05/03  15:42:24  dbg
   51  *      First checkin.
   52  * 
   53  * Revision 1.5.1.3  90/03/29  18:59:52  rvb
   54  *      Added some more ERROR_ codes.
   55  *      [90/03/28            rvb]
   56  * 
   57  * Revision 1.5.1.2  90/01/08  13:31:35  rvb
   58  *      Add Intel copyright.
   59  *      [90/01/08            rvb]
   60  * 
   61  * Revision 1.5.1.1  89/12/21  18:00:06  rvb
   62  *      Changes from Eugene:
   63  *        1) ERROR_BBD, ERROR_ECC, MAX_RETRIES, MAX_ALTBUFS
   64  *        2) field rename in hh:
   65  *              controller_busy, retry_count, restore_request
   66  *      [89/12/07            rvb]
   67  * 
   68  * Revision 1.5  89/09/09  15:22:00  rvb
   69  *      hd.h -> hdreg.h; hd.h is now use for configuration.
   70  *      [89/09/09            rvb]
   71  * 
   72  * Revision 1.4  89/07/17  10:40:31  rvb
   73  *      Olivetti Changes to X79 upto 5/9/89:
   74  *      [89/07/11            rvb]
   75  * 
   76  * Revision 1.3  89/02/26  12:36:47  gm0w
   77  *      Changes for cleanup.
   78  * 
   79  */
   80  
   81 /*
   82   Copyright 1988, 1989 by Intel Corporation, Santa Clara, California.
   83 
   84                 All Rights Reserved
   85 
   86 Permission to use, copy, modify, and distribute this software and
   87 its documentation for any purpose and without fee is hereby
   88 granted, provided that the above copyright notice appears in all
   89 copies and that both the copyright notice and this permission notice
   90 appear in supporting documentation, and that the name of Intel
   91 not be used in advertising or publicity pertaining to distribution
   92 of the software without specific, written prior permission.
   93 
   94 INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
   95 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
   96 IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
   97 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
   98 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
   99 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  100 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  101 */
  102 
  103 #define BOOTRECORDSIGNATURE                     (0x55aa & 0x00ff)
  104 #define FIXED_DISK_REG(ctrl)                    ((ctrl)?0x376:0x3f6)
  105 #define FIXEDBITS                               0x0a0
  106 #define WHOLE_DISK(unit)                        (((unit)<<4)+PART_DISK)
  107 
  108 #define PORT_DATA(addr)                         (0x0+(addr))
  109 #define PORT_ERROR(addr)                        (0x1+(addr))
  110 #define PORT_PRECOMP(addr)                      (0x1+(addr))
  111 #define PORT_NSECTOR(addr)                      (0x2+(addr))
  112 #define PORT_SECTOR(addr)                       (0x3+(addr))
  113 #define PORT_CYLINDERLOWBYTE(addr)              (0x4+(addr))
  114 #define PORT_CYLINDERHIBYTE(addr)               (0x5+(addr))
  115 #define PORT_DRIVE_HEADREGISTER(addr)           (0x6+(addr))
  116 #define PORT_STATUS(addr)                       (0x7+(addr))
  117 #define PORT_COMMAND(addr)                      (0x7+(addr))
  118 
  119 #define STAT_BUSY                               0x080
  120 #define STAT_READY                              0x040
  121 #define STAT_WRITEFAULT                         0x020
  122 #define STAT_SEEKDONE                           0x010
  123 #define STAT_DATAREQUEST                        0x008
  124 #define STAT_ECC                                0x004
  125 #define STAT_INDEX                              0x002
  126 #define STAT_ERROR                              0x001 
  127 
  128 #define CMD_RESTORE                             0x010
  129 #define CMD_SEEK                                0x070
  130 #define CMD_READ                                0x020
  131 #define CMD_WRITE                               0x030
  132 #define CMD_FORMAT                              0x050
  133 #define CMD_READVERIFY                          0x040
  134 #define CMD_DIAGNOSE                            0x090
  135 #define CMD_SETPARAMETERS                       0x091
  136 
  137 #define PATIENCE        3000000         /* how long to wait for controller */
  138 #define PARTITION(z)    (minor(z) & 0x0f)
  139 #define UNIT(z)         ((minor(z) >> 4) & 0x03)
  140 
  141 #define PDLOCATION      29
  142 #define BAD_BLK         0x80                    /* needed for V_VERIFY */
  143 
  144 #define NDRIVES 2                               /* drives per controller */
  145 #define SECSIZE 512
  146 
  147 /*  hh holds the state of the one and only (stupid board) current 
  148     block I/O request
  149 */
  150     
  151 struct hh {
  152         u_char  curdrive;               /* drive the controller is using */
  153         u_char  controller_busy;        /* controller can't take cmd now */
  154         u_char  retry_count;            /* # of times cmd has been tried */
  155         u_char  restore_request;        /* restore command */
  156         int     rw_addr;                /* ram addr to read/write sector */
  157         int     physblock;              /* block # relative to partition 0 */
  158         u_int   single_mode;            /* 1 = transfer one block each time */
  159         u_int   cylinder;               /* cylinder # rel. to part. 0 */
  160         u_int   head;                   /* as it looks */
  161         u_int   sector;                 /* as it looks */
  162         u_int   blockcount;             /* blocks done so far */
  163         u_int   blocktotal;             /* total blocks this request */
  164         u_int   start_of_unix[NDRIVES]; /* unix vs dos partitions */
  165 };
  166 
  167 /* the boot record partition table is documented in IBM AT Tech. Ref p. 9-6 */
  168 struct  boot_record     {
  169         u_char  boot_ind;       /* if it == 0x80, this partition is active */
  170         u_char  head;           /* driver does not look at this field */
  171         u_char  sector;         /* driver does not look at this field */
  172         u_char  cylinder;       /* driver does not look at this field */
  173 
  174         u_char  sys_ind;        /* driver does not look at this field */
  175         u_char  end_head;       /* driver does not look at this field */
  176         u_char  end_sector;     /* driver does not look at this field */
  177         u_char  end_cylinder;   /* driver does not look at this field */
  178 
  179         u_int   rel_sect;       /* where unix starts if boot_ind == 0x80 */
  180         u_int   num_sects;      /* driver does not look at this field */
  181 };

Cache object: 38ca5d93be0f7e4808ea0cd691d7e54a


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.