FreeNOS
|
AT Attachment (ATA) Host Controller Device. More...
#include <ATAController.h>
Public Member Functions | |
ATAController (const u32 inode) | |
Constructor. More... | |
virtual FileSystem::Result | initialize () |
Configures the ATA controller. More... | |
virtual FileSystem::Result | read (IOBuffer &buffer, Size &size, const Size offset) |
Read bytes from a drive attached to the ATA controller. More... | |
virtual FileSystem::Result | interrupt (const Size vector) |
Process ATA interrupts. More... | |
Public Member Functions inherited from Device | |
Device (const u32 inode, const FileSystem::FileType type) | |
Constructor. More... | |
virtual | ~Device () |
Destructor. More... | |
virtual const String & | getIdentifier () const |
Get unique device identifier. More... | |
Public Member Functions inherited from File | |
File (const u32 inode, const FileSystem::FileType type=FileSystem::RegularFile, const UserID uid=ZERO, const GroupID gid=ZERO) | |
Constructor function. More... | |
virtual | ~File () |
Destructor function. More... | |
u32 | getInode () const |
Get inode number. More... | |
FileSystem::FileType | getType () const |
Retrieve our filetype. More... | |
virtual FileSystem::Result | write (IOBuffer &buffer, Size &size, const Size offset) |
Write bytes to the file. More... | |
virtual FileSystem::Result | status (FileSystem::FileStat &st) |
Retrieve file statistics. More... | |
virtual bool | canRead () const |
Check if the File has data ready for reading. More... | |
virtual bool | canWrite () const |
Check if the File can be written to. More... | |
Private Member Functions | |
void | pollReady (bool noData=false) |
Polls the Regular Status register. More... | |
Private Attributes | |
List< ATADrive * > | drives |
Drives detected on the ATA bus. More... | |
Arch::IO | m_io |
Port I/O object. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Device | |
String | m_identifier |
Unique identifier for this Device. More... | |
Protected Attributes inherited from File | |
const u32 | m_inode |
Inode number. More... | |
const FileSystem::FileType | m_type |
Type of this file. More... | |
UserID | m_uid |
Owner of the file. More... | |
GroupID | m_gid |
Group of the file. More... | |
FileSystem::FileModes | m_access |
Access permissions. More... | |
Size | m_size |
Size of the file, in bytes. More... | |
AT Attachment (ATA) Host Controller Device.
Definition at line 262 of file ATAController.h.
ATAController::ATAController | ( | const u32 | inode | ) |
Constructor.
inode | Inode number |
Definition at line 41 of file ATAController.cpp.
References Device::m_identifier.
|
virtual |
Configures the ATA controller.
Reimplemented from Device.
Definition at line 47 of file ATAController.cpp.
References List< T >::append(), ATA_BASE_CMD0, ATA_CMD_IDENTIFY, ATA_REG_CMD, ATA_REG_DATA, ATA_REG_SELECT, ATA_REG_STATUS, ATA_SEL_MASTER, drives, IdentifyData::firmware, IDENTIFY_TEXT_SWAP, ATADrive::identity, m_io, IdentifyData::majorRevision, IdentifyData::minorRevision, IdentifyData::model, NOTICE, FileSystem::NotSupported, pollReady(), IdentifyData::sectors28, IdentifyData::serial, and FileSystem::Success.
|
virtual |
Process ATA interrupts.
vector | Interrupt number. |
Reimplemented from Device.
Definition at line 153 of file ATAController.cpp.
References INFO, and FileSystem::Success.
|
private |
Polls the Regular Status register.
noData | Don't wait for the ATA_STATUS_DATA flag to set. |
Definition at line 159 of file ATAController.cpp.
References ATA_BASE_CMD0, ATA_REG_STATUS, ATA_STATUS_BUSY, ATA_STATUS_DATA, m_io, and File::status().
Referenced by initialize(), and read().
|
virtual |
Read bytes from a drive attached to the ATA controller.
buffer | Input/Output buffer to output bytes to. |
size | Maximum number of bytes to read on input. On output, the actual number of bytes read. |
offset | Offset inside the file to start reading. |
Reimplemented from File.
Definition at line 101 of file ATAController.cpp.
References ATA_BASE_CMD0, ATA_CMD_READ, ATA_REG_ADDR0, ATA_REG_ADDR1, ATA_REG_ADDR2, ATA_REG_CMD, ATA_REG_COUNT, ATA_REG_DATA, ATA_REG_SELECT, ATA_SEL_MASTER_28, IOBuffer::bufferedWrite(), CEIL, drives, List< T >::first(), ATADrive::identity, FileSystem::IOError, List< T >::isEmpty(), m_io, pollReady(), IdentifyData::sectors28, and FileSystem::Success.
Drives detected on the ATA bus.
Definition at line 315 of file ATAController.h.
Referenced by initialize(), and read().
|
private |
Port I/O object.
Definition at line 318 of file ATAController.h.
Referenced by initialize(), pollReady(), and read().