| 1 |
/* ata.h - ATA PIO Block Device Driver for Pactor64 */ |
| 2 |
#ifndef _ATA_H |
| 3 |
#define _ATA_H |
| 4 |
|
| 5 |
#include "../include/pactor64.h" |
| 6 |
|
| 7 |
/* Initialize ATA controller and detect drive */ |
| 8 |
void ata_init(void); |
| 9 |
|
| 10 |
/* Read sectors from disk (LBA28 PIO) */ |
| 11 |
int ata_read_sectors(uint32_t lba, uint32_t count, void *buf); |
| 12 |
|
| 13 |
/* Write sectors to disk (LBA28 PIO) */ |
| 14 |
int ata_write_sectors(uint32_t lba, uint32_t count, const void *buf); |
| 15 |
|
| 16 |
/* Check if an ATA drive was detected */ |
| 17 |
int ata_is_present(void); |
| 18 |
|
| 19 |
/* Get drive capacity in sectors */ |
| 20 |
uint32_t ata_get_sector_count(void); |
| 21 |
|
| 22 |
/* Get drive model string */ |
| 23 |
const char *ata_get_model(void); |
| 24 |
|
| 25 |
/* Get drive serial string */ |
| 26 |
const char *ata_get_serial(void); |
| 27 |
|
| 28 |
/* Block device read callback (for ext2) */ |
| 29 |
int ata_block_read(uint64_t lba, uint32_t count, void *buf); |
| 30 |
|
| 31 |
#endif /* _ATA_H */ |
| 32 |
|