1 #ifndef HARDDISK_PIO_MODE_HEADER 2 #define HARDDISK_PIO_MODE_HEADER 12 #define HARDDISK_ATA_PRIMARY_BUS_IO_PORT 0x1F0 16 #define HARDDISK_ATA_PRIMARY_BUS_CONTROL_PORT 0x3F6 20 #define HARDDISK_ATA_SECONDARY_BUS_IO_PORT 0x170 24 #define HARDDISK_ATA_SECONDARY_BUS_CONTROL_PORT 0x376 32 #define HARDDISK_IO_DATA_REGISTER_OFFSET 0 38 #define HARDDISK_IO_ERROR_REGISTER_OFFSET 1 44 #define HARDDISK_FEATURES_REGISTER_OFFSET 1 50 #define HARDDISK_IO_SECTOR_COUNT_REGISTER_OFFSET 2 56 #define HARDDISK_IO_SECTOR_NUMBER_REGISTER_OFFSET 3 62 #define HARDDISK_IO_CYLINDER_LOW_REGISTER_OFFSET 4 68 #define HARDDISK_IO_CYLINDER_HIGH_REGISTER_OFFSET 5 74 #define HARDDISK_IO_DRIVE_HEAD_REGISTER_OFFSET 6 80 #define HARDDISK_IO_STATUS_REGISTER_OFFSET 7 86 #define HARDDISK_IO_COMMAND_REGISTER_OFFSET 7 92 #define HARDDISK_CONTROL_ALTERNATE_STATUS_REGISTER_OFFSET 0 98 #define HARDDISK_CONTROL_DEVICE_CONTROL_REGISTER_OFFSET 0 104 #define HARDDISK_CONTROL_DEVICE_ADDRESS_REGISTER_OFFSET 1 uint16_t value
Value of this union.
Definition: harddisk_pio_mode_header.h:139
uint8_t value
Value of this union.
Definition: harddisk_pio_mode_header.h:206
uint8_t busy
Indicates the drive is preparing to send/receive data (wait for it to clear). In case of 'hang' (it n...
Definition: harddisk_pio_mode_header.h:192
Hard disk I/O based Error Register.
Definition: harddisk_pio_mode_header.h:134
uint8_t index
Index. Always set to zero. (short: IDX).
Definition: harddisk_pio_mode_header.h:180
uint8_t value
Value of this union.
Definition: harddisk_pio_mode_header.h:246
uint8_t drive_number
Selects the drive number (short: DRV).
Definition: harddisk_pio_mode_header.h:149
uint8_t stop_sending_interrupts
Set this to stop the current device from sending interrupts (short: nIEN).
Definition: harddisk_pio_mode_header.h:220
uint8_t drive_fault_error
Drive Fault Error (does not set ERR). (short: DF).
Definition: harddisk_pio_mode_header.h:188
uint8_t value
Value of this union.
Definition: harddisk_pio_mode_header.h:272
uint8_t id_not_found
ID not found (short: IDNF).
Definition: harddisk_pio_mode_header.h:123
uint8_t select_drive_1
Drive 1 select. Clears when drive 1 selected (short: DS1).
Definition: harddisk_pio_mode_header.h:256
uint8_t overlapped_mode_service_request
Overlapped Mode Service Request. (short: SRV).
Definition: harddisk_pio_mode_header.h:186
uint8_t media_changed
Media changed (short: MC).
Definition: harddisk_pio_mode_header.h:125
uint8_t uses_lba
Uses CHS addressing if clear or LBA addressing if set (short: LBA).
Definition: harddisk_pio_mode_header.h:153
harddisk_control_device_control_register_fields fields
Fields of this union.
Definition: harddisk_pio_mode_header.h:244
uint8_t select_drive_0
Drive 0 select. Clears when drive 0 selected (short: DS0).
Definition: harddisk_pio_mode_header.h:254
uint8_t always_set_field_2
Always set.
Definition: harddisk_pio_mode_header.h:155
uint8_t error_occurred
Indicates an error occurred. Send a new command to clear it (or nuke it with a Software Reset)...
Definition: harddisk_pio_mode_header.h:178
uint8_t corrected_data
Corrected data. Always set to zero. (short: CORR).
Definition: harddisk_pio_mode_header.h:182
uint8_t high_order_byte_read
Set this to read back the High Order Byte of the last LBA48 value sent to an IO port (short: HOB)...
Definition: harddisk_pio_mode_header.h:232
uint8_t unused
Unused.
Definition: harddisk_pio_mode_header.h:113
Hard disk I/O based Drive / Head Register.
Definition: harddisk_pio_mode_header.h:160
uint8_t reserved_field_4
Reserved, set to zero.
Definition: harddisk_pio_mode_header.h:224
uint8_t always_clear_field_1
Always set to zero.
Definition: harddisk_pio_mode_header.h:218
uint8_t drive_ready
Set when the drive has PIO data to transfer, or is ready to accept PIO data. (short: DRQ)...
Definition: harddisk_pio_mode_header.h:184
uint8_t media_change_request
Media change request (short: MCR).
Definition: harddisk_pio_mode_header.h:121
uint8_t aborted_command
Aborted command (short: ABRT).
Definition: harddisk_pio_mode_header.h:119
Hard disk Control based Drive Address Register.
Definition: harddisk_pio_mode_header.h:267
uint8_t always_set_field_1
Always set.
Definition: harddisk_pio_mode_header.h:151
uint8_t reserved_field_3
Reserved, set to zero.
Definition: harddisk_pio_mode_header.h:226
Hard disk Control based Device Control Register.
Definition: harddisk_pio_mode_header.h:215
uint8_t address_mark_not_found
Address mark not found (short: AMNF).
Definition: harddisk_pio_mode_header.h:115
uint8_t software_reset
Set, then clear (after 5us), this to do a "Software Reset" on all ATA drives on a bus...
Definition: harddisk_pio_mode_header.h:222
uint8_t write_gate
Write gate; goes low while writing to the drive is in progress (short: WTG).
Definition: harddisk_pio_mode_header.h:260
uint8_t reserved_for_floppy_controllers
Reserved for compatibility with floppy drive controllers which may use this bit.
Definition: harddisk_pio_mode_header.h:262
uint8_t selected_head
One's compliment representation of the currently selected head (short: HS0 - HS3).
Definition: harddisk_pio_mode_header.h:258
harddisk_control_drive_address_register_fields fields
Fields of this union.
Definition: harddisk_pio_mode_header.h:270
harddisk_io_error_register_fields fields
Fields of this union.
Definition: harddisk_pio_mode_header.h:137
uint8_t reserved_field_1
Reserved, set to zero.
Definition: harddisk_pio_mode_header.h:230
Hard disk Control based Drive Address Register.
Definition: harddisk_pio_mode_header.h:251
Hard disk I/O or Control based Status Register.
Definition: harddisk_pio_mode_header.h:201
uint8_t ready
Bit is clear when drive is spun down, or after an error. Set otherwise. (short: RDY).
Definition: harddisk_pio_mode_header.h:190
uint8_t bad_block_detected
Bad Block detected (short: BBK).
Definition: harddisk_pio_mode_header.h:129
Hard disk I/O based Error Register.
Definition: harddisk_pio_mode_header.h:110
harddisk_io_drive_head_register_fields fields
Fields of this union.
Definition: harddisk_pio_mode_header.h:163
uint8_t chs_head_lba_block_number
In CHS addressing, bits 0 to 3 of the head. In LBA addressing, bits 24 to 27 of the block number...
Definition: harddisk_pio_mode_header.h:147
uint8_t track_zero_not_found
Track zero not found (short: TKZNF).
Definition: harddisk_pio_mode_header.h:117
Hard disk Control based Device Control Register.
Definition: harddisk_pio_mode_header.h:241
uint8_t reserved_field_2
Reserved, set to zero.
Definition: harddisk_pio_mode_header.h:228
uint8_t value
Value of this union.
Definition: harddisk_pio_mode_header.h:165
harddisk_io_control_status_register_fields fields
Fields of this union.
Definition: harddisk_pio_mode_header.h:204
Hard disk I/O based Drive / Head Register.
Definition: harddisk_pio_mode_header.h:144
uint8_t uncorrectable_data_error
Uncorrectable data error (short: UNC).
Definition: harddisk_pio_mode_header.h:127
Hard disk I/O or Control based Status Register.
Definition: harddisk_pio_mode_header.h:175