![]() |
Max OS 0.3
|
Generic Disk, handles the reading and writing of data to the hard drive. More...
#include <disk.h>
Public Member Functions | |
| void | read (uint32_t sector, common::buffer_t *data_buffer) |
| read data from the disk into a buffer (max capacity 512 bytes) | |
| virtual void | read (uint32_t sector, common::buffer_t *data_buffer, size_t amount) |
| read data from the disk | |
| void | write (uint32_t sector, common::buffer_t *data) |
| write data to the disk from a buffer (max capacity 512 bytes) | |
| virtual void | write (uint32_t sector, common::buffer_t *data, size_t count) |
| write data to the disk | |
| virtual void | flush () |
| Flush the disk cache. | |
| 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. | |
Generic Disk, handles the reading and writing of data to the hard drive.
|
overridevirtual |
Activate the disk driver.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 78 of file disk.cpp.
References MaxOS::drivers::Driver::activate().
|
overridevirtual |
Get the device name.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 87 of file disk.cpp.
|
virtual |
Flush the disk cache.
This function is used to flush the disk cache to ensure that all data is written to the disk.
Reimplemented in MaxOS::drivers::disk::AdvancedTechnologyAttachment.
Definition at line 72 of file disk.cpp.
| void Disk::read | ( | uint32_t | sector, |
| common::buffer_t * | data_buffer | ||
| ) |
read data from the disk into a buffer (max capacity 512 bytes)
| sector | The sector to read from |
| data_buffer | The buffer to read the data into |
Definition at line 26 of file disk.cpp.
References read().
Referenced by MaxOS::filesystem::format::Fat32Volume::Fat32Volume(), MaxOS::filesystem::partition::MSDOSPartition::mount_partitions(), MaxOS::filesystem::format::Fat32Volume::next_cluster(), MaxOS::filesystem::format::Fat32File::read(), read(), MaxOS::filesystem::format::ext2::Ext2Volume::read_block(), MaxOS::filesystem::format::Fat32Volume::set_next_cluster(), MaxOS::filesystem::format::Fat32Directory::update_entry_on_disk(), and MaxOS::filesystem::format::Fat32File::write().
|
virtual |
read data from the disk
| sector | The sector to read from |
| data_buffer | The buffer to read the data into |
| amount | The amount of data to read |
Reimplemented in MaxOS::drivers::disk::AdvancedTechnologyAttachment.
Definition at line 40 of file disk.cpp.
|
overridevirtual |
Get the vendor name.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 96 of file disk.cpp.
| void Disk::write | ( | uint32_t | sector, |
| common::buffer_t * | data | ||
| ) |
write data to the disk from a buffer (max capacity 512 bytes)
| sector | The sector to write to |
| data | The buffer to write the data from |
Definition at line 50 of file disk.cpp.
References MaxOS::common::Buffer::capacity(), and write().
Referenced by MaxOS::filesystem::format::Fat32Volume::allocate_cluster(), MaxOS::filesystem::format::Fat32Volume::free_cluster(), MaxOS::filesystem::format::Fat32Volume::set_next_cluster(), MaxOS::filesystem::format::Fat32Directory::update_entry_on_disk(), MaxOS::filesystem::format::Fat32File::write(), write(), and MaxOS::filesystem::format::ext2::Ext2Volume::write_block().
|
virtual |
write data to the disk
| sector | The sector to write to |
| data | The buffer to write the data into |
| count | The amount of data to write |
Reimplemented in MaxOS::drivers::disk::AdvancedTechnologyAttachment.
Definition at line 64 of file disk.cpp.