Max OS 0.3
Loading...
Searching...
No Matches
ata.h
Go to the documentation of this file.
1
9#ifndef MAXOS_DRIVERS_DISK_ATA_H
10#define MAXOS_DRIVERS_DISK_ATA_H
11
12#include <common/buffer.h>
13#include <common/outputStream.h>
15#include <drivers/disk/disk.h>
16#include <cstdint>
17
18
19namespace MaxOS::drivers::disk {
20
26
27 private:
30 hardwarecommunication::Port8Bit m_sector_count_port;
33 hardwarecommunication::Port8Bit m_LBA_high_Port;
37 bool m_is_master;
38 uint16_t m_bytes_per_sector { 512 };
39
40 public:
41 AdvancedTechnologyAttachment(uint16_t port_base, bool master);
43
44 bool identify();
45 void read(uint32_t sector, common::buffer_t* data_buffer, size_t amount) final;
46 void write(uint32_t sector, common::buffer_t* data, size_t count) final;
47 void flush() final;
48
49 string device_name() final;
50 string vendor_name() final;
51 };
52}
53
54
55#endif //MAXOS_DRIVERS_DISK_ATA_H
Defines a Buffer class for safe memory operations.
Wrapper class for a region of bytes in memor in an attempt to add some memory safety....
Definition buffer.h:25
Driver for the ATA controller, handles the reading and writing of data to the hard drive.
Definition ata.h:25
bool identify()
Identify the ATA device.
Definition ata.cpp:44
string device_name() final
Get the device name.
Definition ata.cpp:248
void flush() final
Flush the cache of the ATA device.
Definition ata.cpp:219
void read(uint32_t sector, common::buffer_t *data_buffer, size_t amount) final
read a sector from the ATA device
Definition ata.cpp:103
string vendor_name() final
Get the vendor name.
Definition ata.cpp:257
void write(uint32_t sector, common::buffer_t *data, size_t count) final
write to a sector on the ATA device
Definition ata.cpp:163
Generic Disk, handles the reading and writing of data to the hard drive.
Definition disk.h:24
Handles 16 bit ports.
Definition port.h:57
Defines a generic Disk driver for reading and writing data to disk drives.
Defines OutputStream and GenericOutputStream classes for writing data to streams.
Defines classes for handling hardware communication ports (8, 16, and 32 bit)