FreeNOS
Data Structures | Macros | Typedefs
ATAController.h File Reference
#include <FreeNOS/User.h>
#include <List.h>
#include <Device.h>

Go to the source code of this file.

Data Structures

struct  IdentifyData
 IDENTIFY data presentation. More...
 
struct  ATADrive
 Represents a Drive on the ATA bus. More...
 
class  ATAController
 AT Attachment (ATA) Host Controller Device. More...
 

Macros

#define IDENTIFY_TEXT_SWAP(field, size)
 Swap ASCII bytes from IDENTIFY.
 
ATA I/O Bases.
#define ATA_BASE_CMD0   0x1f0
 First ATA Bus Command I/O Base.
 
#define ATA_BASE_CMD1   0x170
 Second ATA Bus Command I/O Base.
 
#define ATA_BASE_CTL0   0x3f6
 First ATA Bus Control I/O Base.
 
#define ATA_BASE_CTL1   0x376
 Second ATA Bus Control I/O Base.
 
ATA Command Registers.
#define ATA_REG_DATA   0
 Data port.
 
#define ATA_REG_ERROR   1
 Features and Error info.
 
#define ATA_REG_COUNT   2
 Sector Count.
 
#define ATA_REG_ADDR0   3
 Partial Disk Sector address.
 
#define ATA_REG_ADDR1   4
 Partial Disk Sector address.
 
#define ATA_REG_ADDR2   5
 Partial Disk Sector address.
 
#define ATA_REG_SELECT   6
 Drive Select bit, Flag bits, Extra address bits.
 
#define ATA_REG_CMD   7
 Command port and Regular Status port.
 
#define ATA_REG_STATUS   7
 Regular Status port.
 
ATA Status Registers.
#define ATA_STATUS_ERROR   0x01
 Error flag (when set).
 
#define ATA_STATUS_DATA   0x08
 Drive data ready for transfer.
 
#define ATA_STATUS_BUSY   0x80
 Drive is preparing to accept or send data.
 
ATA Control Registers.
#define ATA_REG_RESET   0x4
 Software Reset.
 
#define ATA_REG_INTR   0x2
 Interrupt Disable.
 
ATA Device Selector Flags.
#define ATA_SEL_MASTER   0xa0
 Master Drive in Legacy mode.
 
#define ATA_SEL_MASTER_28   0xe0
 Master Drive in 28-bit LBA mode.
 
#define ATA_SEL_MASTER_48   0x40
 Master Drive in 48-bit LBA mode.
 
ATA Commands.
#define ATA_CMD_IDENTIFY   0xec
 Identifies an ATA device, if any.
 
#define ATA_CMD_READ   0x20
 Reads sectors from an ATA device.
 

Typedefs

typedef struct IdentifyData IdentifyData
 IDENTIFY data presentation.
 
typedef struct ATADrive ATADrive
 Represents a Drive on the ATA bus.