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
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
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; \
Input/Output operations specific to the ARM architecture.
AT Attachment (ATA) Host Controller Device.
Arch::IO m_io
Port I/O object.
virtual FileSystem::Result initialize()
Configures the ATA controller.
List< ATADrive * > drives
Drives detected on the ATA bus.
virtual FileSystem::Result read(IOBuffer &buffer, Size &size, const Size offset)
Read bytes from a drive attached to the ATA controller.
virtual FileSystem::Result interrupt(const Size vector)
Process ATA interrupts.
void pollReady(bool noData=false)
Polls the Regular Status register.
Abstract device class interface.
Abstract Input/Output buffer.
Simple linked list template class.
unsigned int u32
Unsigned 32-bit number.
unsigned short u16
Unsigned 16-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
unsigned long long u64
Unsigned 64-bit number.
unsigned char u8
Unsigned 8-bit number.
Result
Result code for filesystem Actions.
Represents a Drive on the ATA bus.
IdentifyData identity
Bytes returned from IDENTIFY.
Size sectors
Number of sectors.
IDENTIFY data presentation.