mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Updated driver API
This commit is contained in:
parent
75883030ad
commit
3ec416b215
@ -100,6 +100,18 @@ char *DriverPCIGetDeviceName(unsigned int VendorID, unsigned int DeviceID)
|
|||||||
return (char *)"Unknown";
|
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 = {
|
KernelAPI KernelAPITemplate = {
|
||||||
.Version = {
|
.Version = {
|
||||||
.Major = 0,
|
.Major = 0,
|
||||||
@ -137,4 +149,8 @@ KernelAPI KernelAPITemplate = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
.Display = {
|
||||||
|
.GetWidth = DriverGetWidth,
|
||||||
|
.GetHeight = DriverGetHeight,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
6
DAPI.hpp
6
DAPI.hpp
@ -95,6 +95,12 @@ struct KernelAPI
|
|||||||
} Disk;
|
} Disk;
|
||||||
} Command;
|
} Command;
|
||||||
|
|
||||||
|
struct KAPIDisplay
|
||||||
|
{
|
||||||
|
unsigned int (*GetWidth)(void);
|
||||||
|
unsigned int (*GetHeight)(void);
|
||||||
|
/* TODO: Add more */
|
||||||
|
} Display;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
enum CallbackReason
|
enum CallbackReason
|
||||||
|
Loading…
x
Reference in New Issue
Block a user