14 lines
420 B
C
14 lines
420 B
C
#pragma once
|
|
|
|
#include "pci.h"
|
|
|
|
struct AtaDevice {
|
|
struct PciDevice pcidev;
|
|
uint16_t base;
|
|
uint16_t ctrl;
|
|
uint32_t sector_count;
|
|
};
|
|
|
|
bool ata_init(struct AtaDevice *atadev, struct PciDevice pcidev);
|
|
bool ata_read(struct AtaDevice atadev, uint32_t lba, uint8_t sector_count, uint16_t buf[sector_count*256]);
|
|
bool ata_write(struct AtaDevice atadev, uint32_t lba, uint8_t sector_count, uint16_t buf[sector_count*256]);
|