stos: bpal: Initialize BPAL handle
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -25,7 +25,14 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
VOID KeBpalInit(VOID);
|
VOID KeBpalInit(VOID);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Obtain the boot protocol handle
|
||||||
|
*
|
||||||
|
* @Result: Result is written here
|
||||||
|
*/
|
||||||
|
VOID KeBpalGetHandle(BPAL_HANDLE *Result);
|
||||||
|
|
||||||
/* Backend init functions */
|
/* Backend init functions */
|
||||||
VOID KeBpalLimineInit(VOID);
|
VOID KeBpalLimineInit(BPAL_HANDLE *Handle);
|
||||||
|
|
||||||
#endif /* !_KE_BPAL_H_ */
|
#endif /* !_KE_BPAL_H_ */
|
||||||
|
|||||||
+13
-1
@@ -16,6 +16,18 @@
|
|||||||
#define BOOT_PROTO _BOOT_PROTO
|
#define BOOT_PROTO _BOOT_PROTO
|
||||||
#endif /* !_BOOT_PROTO */
|
#endif /* !_BOOT_PROTO */
|
||||||
|
|
||||||
|
static BPAL_HANDLE BpalHandle;
|
||||||
|
|
||||||
|
VOID
|
||||||
|
KeBpalGetHandle(BPAL_HANDLE *Result)
|
||||||
|
{
|
||||||
|
if (Result == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
*Result = BpalHandle;
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
KeBpalInit(VOID)
|
KeBpalInit(VOID)
|
||||||
{
|
{
|
||||||
@@ -24,7 +36,7 @@ KeBpalInit(VOID)
|
|||||||
switch (*BootProto) {
|
switch (*BootProto) {
|
||||||
case 'l':
|
case 'l':
|
||||||
if (RtlMemCmp(BootProto, "limine", 6) == 0) {
|
if (RtlMemCmp(BootProto, "limine", 6) == 0) {
|
||||||
KeBpalLimineInit();
|
KeBpalLimineInit(&BpalHandle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,13 @@
|
|||||||
#define DTRACE(Fmt, ...) \
|
#define DTRACE(Fmt, ...) \
|
||||||
TRACE("[ BPAL ]: " Fmt, ##__VA_ARGS__)
|
TRACE("[ BPAL ]: " Fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
/* HHDM request */
|
||||||
|
static struct limine_hhdm_response *HHDMResp = NULL;
|
||||||
|
static volatile struct limine_hhdm_request HHDMReq = {
|
||||||
|
.id = LIMINE_HHDM_REQUEST_ID,
|
||||||
|
.revision = 0
|
||||||
|
};
|
||||||
|
|
||||||
/* Bootloader information */
|
/* Bootloader information */
|
||||||
static struct limine_bootloader_info_response *LoaderInfoResp = NULL;
|
static struct limine_bootloader_info_response *LoaderInfoResp = NULL;
|
||||||
static volatile struct limine_bootloader_info_request LoaderInfoReq = {
|
static volatile struct limine_bootloader_info_request LoaderInfoReq = {
|
||||||
@@ -28,10 +35,11 @@ static struct limine_bootloader_performance_request LoaderPerReq = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
KeBpalLimineInit(VOID)
|
KeBpalLimineInit(BPAL_HANDLE *Handle)
|
||||||
{
|
{
|
||||||
LoaderInfoResp = LoaderInfoReq.response;
|
LoaderInfoResp = LoaderInfoReq.response;
|
||||||
LoaderPerfResp = LoaderPerReq.response;
|
LoaderPerfResp = LoaderPerReq.response;
|
||||||
|
HHDMResp = HHDMReq.response;
|
||||||
|
|
||||||
DTRACE(
|
DTRACE(
|
||||||
"slut handed control by %s %s\n",
|
"slut handed control by %s %s\n",
|
||||||
@@ -48,4 +56,6 @@ KeBpalLimineInit(VOID)
|
|||||||
"handoff took %d usec\n",
|
"handoff took %d usec\n",
|
||||||
LoaderPerfResp->exec_usec
|
LoaderPerfResp->exec_usec
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Handle->KernelBase = HHDMResp->offset;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user