ptos: ke: Add BPAL layer groundwork
Signed-off-by: Chloe M. <chloe@yiffware.org>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: BPAL init logic
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#include <ke/bpal.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _BOOT_PROTO
|
||||
#error "Boot protocol is undefined"
|
||||
#else
|
||||
#define BOOT_PROTO _BOOT_PROTO
|
||||
#endif /* !_BOOT_PROTO */
|
||||
|
||||
/* Globals */
|
||||
static BPAL_HANDLE BpalHandle;
|
||||
|
||||
PT_STATUS
|
||||
KeBpalGetHandle(BPAL_HANDLE *Result)
|
||||
{
|
||||
if (Result == NULL) {
|
||||
return STATUS_INVALID_PARAM;
|
||||
}
|
||||
|
||||
*Result = BpalHandle;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
KeBpalInit(VOID)
|
||||
{
|
||||
const CHAR *BootProto = BOOT_PROTO;
|
||||
|
||||
switch (*BootProto) {
|
||||
case 'l':
|
||||
if (RtlStrEq(BootProto, "limine")) {
|
||||
KeBpalLimineInit(&BpalHandle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Bugcheck here */
|
||||
}
|
||||
Reference in New Issue
Block a user