Updated driver API

This commit is contained in:
Alex 2023-03-02 02:30:25 +02:00
parent 75883030ad
commit 3ec416b215
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 22 additions and 0 deletions

View File

@ -100,6 +100,18 @@ char *DriverPCIGetDeviceName(unsigned int VendorID, unsigned int DeviceID)
return (char *)"Unknown";
}
unsigned int DriverGetWidth()
{
/* TODO: We won't rely only on display buffers, what about graphics drivers and changing resolutions? */
return Display->GetBuffer(0)->Width;
}
unsigned int DriverGetHeight()
{
/* TODO: We won't rely only on display buffers, what about graphics drivers and changing resolutions? */
return Display->GetBuffer(0)->Height;
}
KernelAPI KernelAPITemplate = {
.Version = {
.Major = 0,
@ -137,4 +149,8 @@ KernelAPI KernelAPITemplate = {
},
},
},
.Display = {
.GetWidth = DriverGetWidth,
.GetHeight = DriverGetHeight,
},
};

View File

@ -95,6 +95,12 @@ struct KernelAPI
} Disk;
} Command;
struct KAPIDisplay
{
unsigned int (*GetWidth)(void);
unsigned int (*GetHeight)(void);
/* TODO: Add more */
} Display;
} __attribute__((packed));
enum CallbackReason