ApertureOS
Functions
AHCI Driver

Functions

uint8_t AHCI_Initialize (void)
 Initialize the AHCI controller. More...
 
void AHCI_Reset (void)
 Reset the AHCI controller. More...
 
uint8_t AHCI_CheckDeviceType (HBA_PORT *port)
 Check the device type of the current port. More...
 
bool AHCI_Read (HBA_PORT *port, uint64_t start, uint32_t count, uint16_t *buf)
 Read from the disk. More...
 
bool AHCI_0_Read (uint64_t start, uint32_t count, uint16_t *buf)
 Read from the first disk. More...
 
bool AHCI_Write (HBA_PORT *port, uint64_t start, uint32_t count, uint16_t *buf)
 Write to the disk. More...
 
bool AHCI_0_Write (uint64_t start, uint32_t count, uint16_t *buf)
 Write to the first disk. More...
 

Detailed Description

Function Documentation

bool AHCI_0_Read ( uint64_t  start,
uint32_t  count,
uint16_t *  buf 
)

Read from the first disk.

Parameters
startThe LBA48 sector start address
countThe number of bytes to copy over, this is rounded up to a multiple of 32
bufThe buffer to put the read data into
Returns
TRUE on read success, FALSe on failure
bool AHCI_0_Write ( uint64_t  start,
uint32_t  count,
uint16_t *  buf 
)

Write to the first disk.

Parameters
startThe LBA48 sector start address
countThe number of bytes to write, this is rounded down to a multiple of 512
bufThe buffer to read data from
Returns
TRUE on write success, FALSE on failure
uint8_t AHCI_CheckDeviceType ( HBA_PORT port)

Check the device type of the current port.

Returns
the AHCI device type
uint8_t AHCI_Initialize ( void  )

Initialize the AHCI controller.

Returns
0 on success, anything else on failure
bool AHCI_Read ( HBA_PORT port,
uint64_t  start,
uint32_t  count,
uint16_t *  buf 
)

Read from the disk.

Parameters
startThe LBA48 sector start address
countThe number of bytes to copy over, this is rounded up to a multiple of 512
bufThe buffer to put the read data into
Returns
TRUE on read success, FALSE on failure
void AHCI_Reset ( void  )

Reset the AHCI controller.

bool AHCI_Write ( HBA_PORT port,
uint64_t  start,
uint32_t  count,
uint16_t *  buf 
)

Write to the disk.

Parameters
startThe LBA48 sector start address
countThe number of bytes to write, this is rounded down to a multiple of 512
bufThe buffer to read data from
Returns
TRUE on write success, FALSE on failure