fdreg.h

Go to the documentation of this file.
00001 #ifndef _LINUX_FDREG_H
00002 #define _LINUX_FDREG_H
00003 /**
00004 *
00005 
00006  * This file contains some defines for the floppy disk controller.
00007  * Various sources. Mostly "IBM Microcomputers: A Programmers
00008  * Handbook", Sanches and Canton.
00009 
00010 
00011 */
00012 
00013 /// Fd controller regs. S&C, about page 340 
00014 #define FD_STATUS       0x3f4
00015 #define FD_DATA         0x3f5
00016 #define FD_DOR          0x3f2           ///< Digital Output Register 
00017 #define FD_DIR          0x3f7           ///< Digital Input Register (read) 
00018 #define FD_DCR          0x3f7           ///< Diskette Control Register (write)
00019 
00020 /// Bits of main status register 
00021 #define STATUS_BUSYMASK 0x0F            ///< drive busy mask 
00022 #define STATUS_BUSY     0x10            ///< FDC busy 
00023 #define STATUS_DMA      0x20            ///< 0- DMA mode 
00024 #define STATUS_DIR      0x40            ///< 0- cpu->fdc 
00025 #define STATUS_READY    0x80            ///< Data reg ready 
00026 
00027 /// Bits of FD_ST0 
00028 #define ST0_DS          0x03            ///< drive select mask 
00029 #define ST0_HA          0x04            ///< Head (Address) 
00030 #define ST0_NR          0x08            ///< Not Ready 
00031 #define ST0_ECE         0x10            ///< Equipment chech error 
00032 #define ST0_SE          0x20            ///< Seek end 
00033 #define ST0_INTR        0xC0            ///< Interrupt code mask 
00034 
00035 /// Bits of FD_ST1 
00036 #define ST1_MAM         0x01            ///< Missing Address Mark 
00037 #define ST1_WP          0x02            ///< Write Protect 
00038 #define ST1_ND          0x04            ///< No Data - unreadable 
00039 #define ST1_OR          0x10            ///< OverRun 
00040 #define ST1_CRC         0x20            ///< CRC error in data or addr 
00041 #define ST1_EOC         0x80            ///< End Of Cylinder 
00042 
00043 /// Bits of FD_ST2 
00044 #define ST2_MAM         0x01            ///< Missing Addess Mark (again) 
00045 #define ST2_BC          0x02            ///< Bad Cylinder 
00046 #define ST2_SNS         0x04            ///< Scan Not Satisfied 
00047 #define ST2_SEH         0x08            ///< Scan Equal Hit 
00048 #define ST2_WC          0x10            ///< Wrong Cylinder 
00049 #define ST2_CRC         0x20            ///< CRC error in data field 
00050 #define ST2_CM          0x40            ///< Control Mark = deleted 
00051 
00052 /// Bits of FD_ST3 
00053 #define ST3_HA          0x04            ///< Head (Address) 
00054 #define ST3_TZ          0x10            ///< Track Zero signal (1=track 0) 
00055 #define ST3_WP          0x40            ///< Write Protect 
00056 
00057 /// Values for FD_COMMAND 
00058 #define FD_RECALIBRATE          0x07    ///< move to track 0 
00059 #define FD_SEEK                 0x0F    ///< seek track 
00060 #define FD_READ                 0xE6    ///< read with MT, MFM, SKip deleted 
00061 #define FD_WRITE                0xC5    ///< write with MT, MFM 
00062 #define FD_SENSEI               0x08    ///< Sense Interrupt Status 
00063 #define FD_SPECIFY              0x03    ///< specify HUT etc 
00064 #define FD_FORMAT               0x4D    ///< format one track 
00065 #define FD_VERSION              0x10    ///< get version code 
00066 #define FD_CONFIGURE            0x13    ///< configure FIFO operation 
00067 #define FD_PERPENDICULAR        0x12    ///< perpendicular r/w mode 
00068 
00069 /// DMA commands 
00070 #define DMA_READ        0x46
00071 #define DMA_WRITE       0x4A
00072 
00073 /// FDC version return types 
00074 #define FDC_TYPE_STD    0x80    ///< normal 8272A clone FDC 
00075 #define FDC_TYPE_82077  0x90    ///< FIFO + perpendicular support 
00076 
00077 #endif

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