Added stub code for kernel API

This commit is contained in:
Alex 2022-11-03 03:15:54 +02:00
parent b809cab953
commit 0ccee08913
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -2,6 +2,7 @@
#include <interrupts.hpp> #include <interrupts.hpp>
#include <memory.hpp> #include <memory.hpp>
#include <dumper.hpp>
#include <task.hpp> #include <task.hpp>
#include <lock.hpp> #include <lock.hpp>
#include <printf.h> #include <printf.h>
@ -74,6 +75,31 @@ namespace Driver
return memset(Destination, Value, Size); return memset(Destination, Value, Size);
} }
void DriverNetSend(unsigned int DriverID, unsigned char *Data, unsigned short Size)
{
DumpData("DriverNetSend", Data, Size);
}
void DriverNetReceive(unsigned int DriverID, unsigned char *Data, unsigned short Size)
{
DumpData("DriverNetReceive", Data, Size);
}
void DriverAHCIDiskRead(unsigned int DriverID, unsigned long Sector, unsigned char *Data, unsigned int SectorCount, unsigned char Port)
{
DumpData("DriverDiskRead", Data, SectorCount * 512);
}
void DriverAHCIDiskWrite(unsigned int DriverID, unsigned long Sector, unsigned char *Data, unsigned int SectorCount, unsigned char Port)
{
DumpData("DriverDiskWrite", Data, SectorCount * 512);
}
char *DriverPCIGetDeviceName(unsigned int VendorID, unsigned int DeviceID)
{
return (char *)"Unknown";
}
KernelAPI KAPI = { KernelAPI KAPI = {
.Version = { .Version = {
.Major = 0, .Major = 0,
@ -91,8 +117,7 @@ namespace Driver
.Unmap = UnmapMemory, .Unmap = UnmapMemory,
}, },
.PCI = { .PCI = {
.GetDeviceName = nullptr, .GetDeviceName = DriverPCIGetDeviceName,
.Write = nullptr,
}, },
.Util = { .Util = {
.DebugPrint = DriverDebugPrint, .DebugPrint = DriverDebugPrint,
@ -102,13 +127,13 @@ namespace Driver
}, },
.Commmand = { .Commmand = {
.Network = { .Network = {
.SendPacket = nullptr, .SendPacket = DriverNetSend,
.ReceivePacket = nullptr, .ReceivePacket = DriverNetReceive,
}, },
.Disk = { .Disk = {
.AHCI = { .AHCI = {
.ReadSector = nullptr, .ReadSector = DriverAHCIDiskRead,
.WriteSector = nullptr, .WriteSector = DriverAHCIDiskWrite,
}, },
}, },
}, },