hdreg.h

Go to the documentation of this file.
00001 #ifndef _LINUX_HDREG_H
00002 #define _LINUX_HDREG_H
00003 
00004 /**
00005 *
00006 
00007  * This file contains some defines for the AT-hd-controller.
00008  * Various sources. Check out some definitions (see comments with
00009  * a ques).
00010 
00011 
00012 */
00013 
00014 /// Hd controller regs. Ref: IBM AT Bios-listing 
00015 #define HD_DATA         0x1f0   ///< _CTL when writing 
00016 #define HD_ERROR        0x1f1   ///< see err-bits 
00017 #define HD_NSECTOR      0x1f2   ///< nr of sectors to read/write 
00018 #define HD_SECTOR       0x1f3   ///< starting sector 
00019 #define HD_LCYL         0x1f4   ///< starting cylinder 
00020 #define HD_HCYL         0x1f5   ///< high byte of starting cyl 
00021 #define HD_CURRENT      0x1f6   ///< 101dhhhh , d=drive, hhhh=head 
00022 #define HD_STATUS       0x1f7   ///< see status-bits 
00023 #define HD_PRECOMP HD_ERROR     ///< same io address, read=error, write=precomp 
00024 #define HD_COMMAND HD_STATUS    ///< same io address, read=status, write=cmd 
00025 
00026 #define HD_CMD          0x3f6
00027 
00028 /// Bits of HD_STATUS 
00029 #define ERR_STAT        0x01
00030 #define INDEX_STAT      0x02
00031 #define ECC_STAT        0x04    ///< Corrected error 
00032 #define DRQ_STAT        0x08
00033 #define SEEK_STAT       0x10
00034 #define WRERR_STAT      0x20
00035 #define READY_STAT      0x40
00036 #define BUSY_STAT       0x80
00037 
00038 /// Values for HD_COMMAND 
00039 #define WIN_RESTORE             0x10
00040 #define WIN_READ                0x20
00041 #define WIN_WRITE               0x30
00042 #define WIN_VERIFY              0x40
00043 #define WIN_FORMAT              0x50
00044 #define WIN_INIT                0x60
00045 #define WIN_SEEK                0x70
00046 #define WIN_DIAGNOSE            0x90
00047 #define WIN_SPECIFY             0x91
00048 
00049 /// Bits for HD_ERROR 
00050 #define MARK_ERR        0x01    ///< Bad address mark 
00051 #define TRK0_ERR        0x02    ///< couldn't find track 0 
00052 #define ABRT_ERR        0x04    ///< Command aborted 
00053 #define ID_ERR          0x10    ///< ID field not found 
00054 #define ECC_ERR         0x40    ///< Uncorrectable ECC error 
00055 #define BBD_ERR         0x80    ///< block marked bad 
00056 
00057 
00058 /**
00059 *
00060  HDIO_GETGEO is the preferred choice - HDIO_REQ will be removed at some
00061 
00062 
00063 */
00064 #define HDIO_REQ 0x301
00065 #define HDIO_GETGEO 0x301
00066 struct hd_geometry {
00067       unsigned char heads;
00068       unsigned char sectors;
00069       unsigned short cylinders;
00070       unsigned long start;
00071 };
00072 #endif

Generated on Mon May 1 21:47:00 2006 for KernelAPI by  doxygen 1.4.6-5