Go to the documentation of this file.
18 #ifndef __SERVER_ATA_ATACONTROLLER_H
19 #define __SERVER_ATA_ATACONTROLLER_H
21 #include <FreeNOS/User.h>
39 #define ATA_BASE_CMD0 0x1f0
42 #define ATA_BASE_CMD1 0x170
45 #define ATA_BASE_CTL0 0x3f6
48 #define ATA_BASE_CTL1 0x376
64 #define ATA_REG_DATA 0
70 #define ATA_REG_ERROR 1
76 #define ATA_REG_COUNT 2
82 #define ATA_REG_ADDR0 3
87 #define ATA_REG_ADDR1 4
92 #define ATA_REG_ADDR2 5
97 #define ATA_REG_SELECT 6
103 #define ATA_REG_CMD 7
110 #define ATA_REG_STATUS 7
125 #define ATA_STATUS_ERROR 0x01
131 #define ATA_STATUS_DATA 0x08
138 #define ATA_STATUS_BUSY 0x80
154 #define ATA_REG_RESET 0x4
160 #define ATA_REG_INTR 0x2
172 #define ATA_SEL_MASTER 0xa0
175 #define ATA_SEL_MASTER_28 0xe0
178 #define ATA_SEL_MASTER_48 0x40
190 #define ATA_CMD_IDENTIFY 0xec
193 #define ATA_CMD_READ 0x20
206 #define IDENTIFY_TEXT_SWAP(field,size) \
211 for (int i = 0; i < (size); i+=2) \
214 (field)[i] = (field)[i+1]; \
215 (field)[i+1] = tmp; \
virtual FileSystem::Result interrupt(const Size vector)
Process ATA interrupts.
struct IdentifyData IdentifyData
IDENTIFY data presentation.
virtual FileSystem::Result initialize()
Configures the ATA controller.
struct ATADrive ATADrive
Represents a Drive on the ATA bus.
Input/Output operations specific to the ARM architecture.
ATAController(const u32 inode)
Constructor.
AT Attachment (ATA) Host Controller Device.
void pollReady(bool noData=false)
Polls the Regular Status register.
Abstract device class interface.
Represents a Drive on the ATA bus.
unsigned long long u64
Unsigned 64-bit number.
unsigned short u16
Unsigned 16-bit number.
Abstract Input/Output buffer.
Size sectors
Number of sectors.
unsigned int u32
Unsigned 32-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
List< ATADrive * > drives
Drives detected on the ATA bus.
Arch::IO m_io
Port I/O object.
IdentifyData identity
Bytes returned from IDENTIFY.
Result
Result code for filesystem Actions.
unsigned char u8
Unsigned 8-bit number.
virtual FileSystem::Result read(IOBuffer &buffer, Size &size, const Size offset)
Read bytes from a drive attached to the ATA controller.
IDENTIFY data presentation.