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);
|
||||
|
||||
/*
|
||||
* Obtain the boot protocol handle
|
||||
*
|
||||
* @Result: Result is written here
|
||||
*/
|
||||
VOID KeBpalGetHandle(BPAL_HANDLE *Result);
|
||||
|
||||
/* Backend init functions */
|
||||
VOID KeBpalLimineInit(VOID);
|
||||
VOID KeBpalLimineInit(BPAL_HANDLE *Handle);
|
||||
|
||||
#endif /* !_KE_BPAL_H_ */
|
||||
|
||||
+13
-1
@@ -16,6 +16,18 @@
|
||||
#define BOOT_PROTO _BOOT_PROTO
|
||||
#endif /* !_BOOT_PROTO */
|
||||
|
||||
static BPAL_HANDLE BpalHandle;
|
||||
|
||||
VOID
|
||||
KeBpalGetHandle(BPAL_HANDLE *Result)
|
||||
{
|
||||
if (Result == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
*Result = BpalHandle;
|
||||
}
|
||||
|
||||
VOID
|
||||
KeBpalInit(VOID)
|
||||
{
|
||||
@@ -24,7 +36,7 @@ KeBpalInit(VOID)
|
||||
switch (*BootProto) {
|
||||
case 'l':
|
||||
if (RtlMemCmp(BootProto, "limine", 6) == 0) {
|
||||
KeBpalLimineInit();
|
||||
KeBpalLimineInit(&BpalHandle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
#define DTRACE(Fmt, ...) \
|
||||
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 */
|
||||
static struct limine_bootloader_info_response *LoaderInfoResp = NULL;
|
||||
static volatile struct limine_bootloader_info_request LoaderInfoReq = {
|
||||
@@ -28,10 +35,11 @@ static struct limine_bootloader_performance_request LoaderPerReq = {
|
||||
};
|
||||
|
||||
VOID
|
||||
KeBpalLimineInit(VOID)
|
||||
KeBpalLimineInit(BPAL_HANDLE *Handle)
|
||||
{
|
||||
LoaderInfoResp = LoaderInfoReq.response;
|
||||
LoaderPerfResp = LoaderPerReq.response;
|
||||
HHDMResp = HHDMReq.response;
|
||||
|
||||
DTRACE(
|
||||
"slut handed control by %s %s\n",
|
||||
@@ -48,4 +56,6 @@ KeBpalLimineInit(VOID)
|
||||
"handoff took %d usec\n",
|
||||
LoaderPerfResp->exec_usec
|
||||
);
|
||||
|
||||
Handle->KernelBase = HHDMResp->offset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user