From e166338295d40f926d65e3bf75767decc00513ef Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 1 Nov 2022 03:59:32 +0200 Subject: [PATCH] Updated driver API --- DAPI.hpp | 18 ++++++++++++++++++ Fex.hpp | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/DAPI.hpp b/DAPI.hpp index 8c40856..6841ccb 100644 --- a/DAPI.hpp +++ b/DAPI.hpp @@ -68,6 +68,16 @@ struct KernelAPI void (*SendPacket)(unsigned int DriverID, unsigned char *Data, unsigned short Size); void (*ReceivePacket)(unsigned int DriverID, unsigned char *Data, unsigned short Size); } Network; + + /** @brief Connects to the disk manager */ + struct + { + struct + { + void (*ReadSector)(unsigned int DriverID, unsigned long Sector, unsigned char *Data, unsigned int SectorCount, unsigned char Port); + void (*WriteSector)(unsigned int DriverID, unsigned long Sector, unsigned char *Data, unsigned int SectorCount, unsigned char Port); + } AHCI; + } Disk; } Commmand; } __attribute__((packed)); @@ -98,6 +108,14 @@ struct KernelCallback unsigned long Length; } NetworkCallback; + /** @brief When the kernel wants to write to disk. */ + struct + { + unsigned long Sector; + unsigned long SectorCount; + unsigned char Port; + unsigned char *Data; + } DiskCallback; } __attribute__((packed)); #endif // !__FENNIX_DRIVER_API_H__ diff --git a/Fex.hpp b/Fex.hpp index a93be34..894ebbf 100644 --- a/Fex.hpp +++ b/Fex.hpp @@ -79,8 +79,8 @@ struct FexExtended struct { - unsigned short VendorID; - unsigned short DeviceID; + unsigned short VendorID[16]; + unsigned short DeviceID[16]; unsigned short Class; unsigned short SubClass; unsigned short ProgIF;