![]() |
Max OS 0.3
|
Driver for the ATA controller, handles the reading and writing of data to the hard drive. More...
#include <ata.h>
Public Member Functions | |
| AdvancedTechnologyAttachment (uint16_t port_base, bool master) | |
| Constructor for the AdvancedTechnologyAttachment class. | |
| bool | identify () |
| Identify the ATA device. | |
| void | read (uint32_t sector, common::buffer_t *data_buffer, size_t amount) final |
| read a sector from the ATA device | |
| void | write (uint32_t sector, common::buffer_t *data, size_t count) final |
| write to a sector on the ATA device | |
| void | flush () final |
| Flush the cache of the ATA device. | |
| string | device_name () final |
| Get the device name. | |
| string | vendor_name () final |
| Get the vendor name. | |
Public Member Functions inherited from MaxOS::drivers::disk::Disk | |
| void | read (uint32_t sector, common::buffer_t *data_buffer) |
| read data from the disk into a buffer (max capacity 512 bytes) | |
| void | write (uint32_t sector, common::buffer_t *data) |
| write data to the disk from a buffer (max capacity 512 bytes) | |
| void | activate () override |
| Activate the disk driver. | |
| string | device_name () override |
| Get the device name. | |
| string | vendor_name () override |
| Get the vendor name. | |
Public Member Functions inherited from MaxOS::drivers::Driver | |
| virtual void | deactivate () |
| Deactivate the driver. | |
| virtual void | initialise () |
| Initialise the driver. | |
| virtual uint32_t | reset () |
| Reset the driver. | |
Driver for the ATA controller, handles the reading and writing of data to the hard drive.
Constructor for the AdvancedTechnologyAttachment class.
| port_base | The base port for the ATA device |
| master | True if the device is master, false if slave |
Definition at line 23 of file ata.cpp.
|
finalvirtual |
Get the device name.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 248 of file ata.cpp.
|
finalvirtual |
Flush the cache of the ATA device.
Reimplemented from MaxOS::drivers::disk::Disk.
Definition at line 219 of file ata.cpp.
References MaxOS::hardwarecommunication::Port8Bit::read(), and MaxOS::hardwarecommunication::Port8Bit::write().
Referenced by write().
| bool AdvancedTechnologyAttachment::identify | ( | ) |
Identify the ATA device.
Definition at line 44 of file ata.cpp.
References MaxOS::hardwarecommunication::Port8Bit::read(), MaxOS::hardwarecommunication::Port16Bit::read(), MaxOS::Logger::WARNING(), and MaxOS::hardwarecommunication::Port8Bit::write().
|
finalvirtual |
read a sector from the ATA device
| sector | The sector to read |
| data_buffer | The data to read into |
| amount | The amount of bytes to read from that sector |
Reimplemented from MaxOS::drivers::disk::Disk.
Definition at line 103 of file ata.cpp.
References MaxOS::hardwarecommunication::Port8Bit::read(), MaxOS::hardwarecommunication::Port16Bit::read(), and MaxOS::hardwarecommunication::Port8Bit::write().
|
finalvirtual |
Get the vendor name.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 257 of file ata.cpp.
|
finalvirtual |
write to a sector on the ATA device
| sector | The sector to write to |
| data | The data to write |
| count | The amount of data to write to that sector |
Reimplemented from MaxOS::drivers::disk::Disk.
Definition at line 163 of file ata.cpp.
References flush(), MaxOS::common::Buffer::read(), MaxOS::hardwarecommunication::Port8Bit::read(), MaxOS::hardwarecommunication::Port16Bit::write(), and MaxOS::hardwarecommunication::Port8Bit::write().