39#define FLOPPY_DEFAULT_IRQ 0x6
40#define FDC_PORT_BYTES 0x8
43#define STATUS_REGISTER_A 0x0
44#define STATUS_REGISTER_B 0x1
45#define DIGITAL_OUTPUT_REGISTER 0x2
46#define TAPE_DRIVE_REGISTER 0x3
47#define MAIN_STATUS_REGISTER 0x4
48#define DATA_RATE_SELECT_REGISTER 0x4
50#define RESERVED_REGISTER 0x6
51#define DIGITAL_INPUT_REGISTER 0x7
52#define CONFIGURATION_CONTROL_REGISTER 0x7
55#define DSRA_DIRECTION 0x1
56#define DSRA_WRITE_PROTECT 0x2
58#define DSRA_HEAD_1_SELECT 0x8
59#define DSRA_TRACK_0 0x10
61#define DSRA_SECOND_DRIVE_INSTALLED 0x40
62#define DSRA_INTERRUPT_PENDING 0x80
65#define DSRB_MOTOR_ENABLE_0 0x1
66#define DSRB_MOTOR_ENABLE_1 0x2
67#define DSRB_WRITE_ENABLE 0x4
68#define DSRB_READ_DATA 0x8
69#define DSRB_WRITE_DATA 0x10
70#define DSRB_DRIVE_SELECT 0x20
73#define DOR_FLOPPY_DRIVE_SELECT 0x3
74#define DOR_FDC_ENABLE 0x4
76#define DOR_DMA_IO_INTERFACE_ENABLE 0x8
77#define DOR_FLOPPY_MOTOR_ON_A 0x10
78#define DOR_FLOPPY_MOTOR_ON_B 0x20
79#define DOR_FLOPPY_MOTOR_ON_C 0x40
80#define DOR_FLOPPY_MOTOR_ON_D 0x80
83#define DOR_FLOPPY_DRIVE_SELECT_A 0x0
84#define DOR_FLOPPY_DRIVE_SELECT_B 0x1
85#define DOR_FLOPPY_DRIVE_SELECT_C 0x2
86#define DOR_FLOPPY_DRIVE_SELECT_D 0x3
89#define MSR_FLOPPY_BUSY_0 0x1
90#define MSR_FLOPPY_BUSY_1 0x2
91#define MSR_FLOPPY_BUSY_2 0x4
92#define MSR_FLOPPY_BUSY_3 0x8
93#define MSR_READ_WRITE_IN_PROGRESS 0x10
94#define MSR_NON_DMA_MODE 0x20
95#define MSR_IO_DIRECTION 0x40
96#define MSR_DATA_REG_READY_FOR_IO 0x80
100#define DRSR_PRECOMP 0x1c
102#define DRSR_POWER_DOWN 0x40
103#define DRSR_SW_RESET 0x80
106#define DRSR_DSEL_500KBPS 0x0
107#define DRSR_DSEL_300KBPS 0x1
108#define DRSR_DSEL_250KBPS 0x2
109#define DRSR_DSEL_1MBPS 0x3
112#define SR0_UNIT_SELECTED_AT_INTERRUPT 0x3
113#define SR0_HEAD_NUMBER_AT_INTERRUPT 0x4
114#define SR0_NOT_READY_ON_READ_WRITE 0x8
115#define SR0_SS_ACCESS_TO_HEAD_1 0x8
116#define SR0_EQUIPMENT_CHECK 0x10
117#define SR0_SEEK_COMPLETE 0x20
118#define SR0_LAST_COMMAND_STATUS 0xC0
121#define SR0_UNIT_SELECTED_A 0x0
122#define SR0_UNIT_SELECTED_B 0x1
123#define SR0_UNIT_SELECTED_C 0x2
124#define SR0_UNIT_SELECTED_D 0x3
125#define SR0_PS2_UNIT_SELECTED_A 0x1
126#define SR0_PST_UNIT_SELECTED_B 0x2
129#define SR0_HEAD_0 0x0
130#define SR0_HEAD_1 0x1
133#define SR0_LCS_SUCCESS 0x0
134#define SR0_LCS_TERMINATED_ABNORMALLY 0x40
135#define SR0_LCS_INVALID_COMMAND_ISSUED 0x80
136#define SR0_LCS_READY_SIGNAL_CHANGED 0xc0
139#define SR1_CANNOT_FIND_ID_ADDRESS 0x1
140#define SR1_WRITE_PROTECT_DETECTED 0x2
141#define SR1_CANNOT_FIND_SECTOR_ID 0x4
142#define SR1_OVERRUN 0x10
143#define SR1_CRC_ERROR 0x20
144#define SR1_END_OF_CYLINDER 0x80
147#define SR2_MISSING_ADDRESS_MARK 0x1
148#define SR2_BAD_CYLINDER 0x2
149#define SR2_SCAN_COMMAND_FAILED 0x4
150#define SR2_SCAN_COMMAND_EQUAL 0x8
151#define SR2_WRONG_CYLINDER_DETECTED 0x10
152#define SR2_CRC_ERROR_IN_SECTOR_DATA 0x20
153#define SR2_SECTOR_WITH_DELETED_DATA 0x40
156#define SR3_UNIT_SELECTED 0x3
157#define SR3_SIDE_HEAD_SELECT_STATUS 0x4
158#define SR3_TWO_SIDED_STATUS_SIGNAL 0x8
159#define SR3_TRACK_ZERO_STATUS_SIGNAL 0x10
160#define SR3_READY_STATUS_SIGNAL 0x20
161#define SR3_WRITE_PROTECT_STATUS_SIGNAL 0x40
162#define SR3_FAULT_STATUS_SIGNAL 0x80
165#define SR3_UNIT_SELECTED_A 0x0
166#define SR3_UNIT_SELECTED_B 0x1
167#define SR3_UNIT_SELECTED_C 0x2
168#define SR3_UNIT_SELECTED_D 0x3
171#define SR3_SHSS_HEAD_0 0x0
172#define SR3_SHSS_HEAD_1 0x1
175#define DIR_HIGH_DENSITY_SELECT 0x1
176#define DIR_DISKETTE_CHANGE 0x80
184#define CCR_DRC_500000 0x0
185#define CCR_DRC_250000 0x2
188#define COMMAND_READ_TRACK 0x2
189#define COMMAND_SPECIFY 0x3
190#define COMMAND_SENSE_DRIVE_STATUS 0x4
191#define COMMAND_WRITE_DATA 0x5
192#define COMMAND_READ_DATA 0x6
193#define COMMAND_RECALIBRATE 0x7
194#define COMMAND_SENSE_INTERRUPT_STATUS 0x8
195#define COMMAND_WRITE_DELETED_DATA 0x9
196#define COMMAND_READ_ID 0xA
197#define COMMAND_READ_DELETED_DATA 0xC
198#define COMMAND_FORMAT_TRACK 0xD
199#define COMMAND_SEEK 0xF
200#define COMMAND_VERSION 0x10
201#define COMMAND_SCAN_EQUAL 0x11
202#define COMMAND_CONFIGURE 0x13
203#define COMMAND_SCAN_LOW_OR_EQUAL 0x19
204#define COMMAND_SCAN_HIGH_OR_EQUAL 0x1D
207#define READ_DATA_DS0 0x1
208#define READ_DATA_DS1 0x2
209#define READ_DATA_HDS 0x4
210#define READ_DATA_SK 0x20
211#define READ_DATA_MFM 0x40
212#define READ_DATA_MT 0x80
215#define READ_ID_MFM 0x40
218#define SPECIFY_HLT_1M 0x10
219#define SPECIFY_HLT_500K 0x8
220#define SPECIFY_HLT_300K 0x6
221#define SPECIFY_HLT_250K 0x4
222#define SPECIFY_HUT_1M 0x0
223#define SPECIFY_HUT_500K 0x0
224#define SPECIFY_HUT_300K 0x0
225#define SPECIFY_HUT_250K 0x0
226#define SPECIFY_SRT_1M 0x0
227#define SPECIFY_SRT_500K 0x0
228#define SPECIFY_SRT_300K 0x0
229#define SPECIFY_SRT_250K 0x0
232#define COMMAND_UNIT_SELECT 0x3
233#define COMMAND_UNIT_SELECT_0 0x1
234#define COMMAND_UNIT_SELECT_1 0x2
235#define COMMAND_HEAD_NUMBER 0x4
236#define COMMAND_HEAD_NUMBER_SHIFT 0x2
239#define VERSION_ENHANCED 0x90
242#define CUS_UNIT_0 0x0
243#define CUS_UNIT_1 0x1
246#define CONFIGURE_FIFOTHR 0xf
247#define CONFIGURE_POLL 0x10
248#define CONFIGURE_EFIFO 0x20
249#define CONFIGURE_EIS 0x40
250#define CONFIGURE_PRETRK 0xff
253#define COMMAND_HEAD_0 0x0
254#define COMMAND_HEAD_1 0x1
257#define HW_128_BYTES_PER_SECTOR 0x0
258#define HW_256_BYTES_PER_SECTOR 0x1
259#define HW_512_BYTES_PER_SECTOR 0x2
260#define HW_1024_BYTES_PER_SECTOR 0x3
278 UCHAR BytesPerSector,
296 UCHAR BytesPerSector,
299 UCHAR FillerPattern);
332 UCHAR HeadUnloadTime,
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
NTSTATUS NTAPI HwReadWriteResult(PCONTROLLER_INFO ControllerInfo)
NTSTATUS NTAPI HwFormatTrack(PCONTROLLER_INFO ControllerInfo, UCHAR Unit, UCHAR Head, UCHAR BytesPerSector, UCHAR SectorsPerTrack, UCHAR Gap3Length, UCHAR FillerPattern)
NTSTATUS NTAPI HwRecalibrateResult(PCONTROLLER_INFO ControllerInfo)
NTSTATUS NTAPI HwTurnOnMotor(PDRIVE_INFO DriveInfo)
NTSTATUS NTAPI HwConfigure(PCONTROLLER_INFO ControllerInfo, BOOLEAN EIS, BOOLEAN EFIFO, BOOLEAN POLL, UCHAR FIFOTHR, UCHAR PRETRK)
NTSTATUS NTAPI HwGetVersion(PCONTROLLER_INFO ControllerInfo)
VOID NTAPI HwDumpRegisters(PCONTROLLER_INFO ControllerInfo)
NTSTATUS NTAPI HwReset(PCONTROLLER_INFO Controller)
NTSTATUS NTAPI HwSeek(PDRIVE_INFO DriveInfo, UCHAR Cylinder)
NTSTATUS NTAPI HwSetDataRate(PCONTROLLER_INFO ControllerInfo, UCHAR DataRate)
NTSTATUS NTAPI HwRecalibrate(PDRIVE_INFO DriveInfo)
NTSTATUS NTAPI HwSpecify(PCONTROLLER_INFO ControllerInfo, UCHAR HeadLoadTime, UCHAR HeadUnloadTime, UCHAR StepRateTime, BOOLEAN NonDma)
NTSTATUS NTAPI HwReadId(PDRIVE_INFO DriveInfo, UCHAR Head)
NTSTATUS NTAPI HwReadWriteData(PCONTROLLER_INFO ControllerInfo, BOOLEAN Read, UCHAR Unit, UCHAR Cylinder, UCHAR Head, UCHAR Sector, UCHAR BytesPerSector, UCHAR EndOfTrack, UCHAR Gap3Length, UCHAR DataLength)
NTSTATUS NTAPI HwSenseInterruptStatus(PCONTROLLER_INFO ControllerInfo)
NTSTATUS NTAPI HwSenseDriveStatusResult(PCONTROLLER_INFO ControllerInfo, PUCHAR Status)
NTSTATUS NTAPI HwDiskChanged(PDRIVE_INFO DriveInfo, PBOOLEAN DiskChanged)
NTSTATUS NTAPI HwTurnOffMotor(PCONTROLLER_INFO ControllerInfo)
NTSTATUS NTAPI HwPowerOff(PCONTROLLER_INFO ControllerInfo)
NTSTATUS NTAPI HwSenseDriveStatus(PDRIVE_INFO DriveInfo)
NTSTATUS NTAPI HwReadIdResult(PCONTROLLER_INFO ControllerInfo, PUCHAR CurCylinder, PUCHAR CurHead)
_In_ ULONG _In_ ULONG SectorsPerTrack