home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / FLOPPY.H < prev    next >
Text File  |  1995-04-14  |  4KB  |  94 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /*static char *SCCSID = "@(#)floppy.h    6.1 90/11/15";*/
  14. /***    Floppy Device Driver (FLPY)
  15.  *
  16.  *    SCCSID = @(#)floppy.h    13.2 90/06/29
  17.  *
  18.  *
  19.  *
  20.  *
  21.  *    DESCRIPTION
  22.  *    Floppy hardware constants
  23.  *
  24.  *    MODIFICATION HISTORY
  25.  *    06/13/90 MTS    Created.
  26.  */
  27.  
  28.  
  29. // Ports
  30.  
  31. #define PORT_STATUSA        0x3f0    //read-only
  32. #define PORT_STATUSB        0x3f1    //read-only
  33. #define PORT_DIGITALOUT     0x3f2    //write-only
  34. #define PORT_DIGITALIN        0x3f7    //read-only
  35. #define PORT_CONFIG        0x3f7    //write-only
  36. #define PORT_FDCSTATUS        0x3f4    //read-only
  37. #define PORT_FDCDATA        0x3f5    //read/write
  38.  
  39. // Status A register
  40.  
  41. #define STATUSA_DIR        0x01    //direction
  42. #define STATUSA_NOTWRTPROT    0x02    //not write protect
  43. #define STATUSA_NOTINDEX    0x04    //not index
  44. #define STATUSA_HEAD1        0x08    //select head 1
  45. #define STATUSA_NOTTRACK0    0x10    //not track 0
  46. #define STATUSA_STEP        0x20    //step
  47. #define STATUSA_NO2NDDRIVE    0x40    //no 2nd drive installed
  48. #define STATUSA_INTRPENDING    0x80    //interrupt pending
  49.  
  50. // Status B register
  51.  
  52. #define STATUSB_MOTOREN0    0x01    //motor enable 0
  53. #define STATUSB_MOTOREN1    0x02    //motor enable 1
  54. #define STATUSB_WRITEEN     0x04    //write enable
  55. #define STATUSB_READDATA    0x08    //pos. transition of -RD toggle this bit
  56. #define STATUSB_WRITEDATA    0x10    //pos. transition of -WR toggle this bit
  57. #define STATUSB_DRIVESEL    0x20    //drive select
  58. #define STATUSB_RESERVED    0xc0    //reserved bits
  59.  
  60. // Digital Output register
  61.  
  62. #define DO_DRIVESEL0        0x01    //drive select 0
  63. #define DO_DRIVESEL1        0x02    //drive select 1
  64. #define DO_NOTFDCRESET        0x04    //-controller reset
  65. #define DO_INTENABLE        0x08    //interrupt enable
  66. #define DO_MOTOREN0        0x10    //motor enable 0
  67. #define DO_MOTOREN1        0x20    //motor enable 1
  68. #define DO_RESERVED        0xc0    //reserved bits
  69.  
  70. // Digital Input register
  71.  
  72. #define DI_NOTHIDENSEL        0x01    //not high density select
  73. #define DI_RESERVED        0x7e    //reserved bits
  74. #define DI_DISKCHANGED        0x80    //diskette changed
  75.  
  76. // Configuration Control register
  77.  
  78. #define CFG_DRC         0x03    //drive control
  79. #define CFG_DRC500K        0x00    //500 Kbit mode
  80. #define CFG_DRC250K        0x02    //250 Kbit mode
  81.  
  82. // Diskette Drive Controller Status register
  83.  
  84. #define STATUS_DRV0BUSY     0x01    //drive 0 busy
  85. #define STATUS_DRV1BUSY     0x02    //drive 1 busy
  86. #define STATUS_RESERVED     0x0c    //reserved bits
  87. #define STATUS_FDCBUSY        0x10    //diskette controller busy
  88. #define STATUS_NONDMA        0x20    //non-DMA mode
  89. #define STATUS_DATAOUT        0x40    //data output from controller
  90. #define STATUS_READY        0x80    //controller ready
  91.  
  92. #define FLPY_IRQ        0x06    //floppy uses IRQ 6
  93. #define FLPY_DMA        0x02    //floppy uses DMA channel 2
  94.