18 lines
587 B
C
18 lines
587 B
C
#pragma once
|
|
// io_driver.h - driver-side interface for registering disk controllers
|
|
#include "hal_api.h"
|
|
#include "ke_status.h"
|
|
#include "../kernel/io_file.h"
|
|
#include <stdint.h>
|
|
|
|
typedef KSTATUS (*DRIVER_ENTRY_FN)(const HAL_API* hal);
|
|
typedef void (*DRIVER_UNLOAD_FN)(void);
|
|
|
|
typedef struct DISK_DRIVER {
|
|
KSTATUS (*ReadSectors)(uint64_t lba, uint32_t count, void* buf);
|
|
KSTATUS (*WriteSectors)(uint64_t lba, uint32_t count, const void* buf);
|
|
uint64_t SectorCount;
|
|
} DISK_DRIVER;
|
|
|
|
KSTATUS IoRegisterDisk(uint8_t driveIndex, const DISK_DRIVER* driver);
|