@@ -25,4 +25,7 @@ typedef struct {
|
||||
*/
|
||||
VOID KeBpalInit(VOID);
|
||||
|
||||
/* Backend init functions */
|
||||
VOID KeBpalLimineInit(VOID);
|
||||
|
||||
#endif /* !_KE_BPAL_H_ */
|
||||
|
||||
@@ -8,17 +8,21 @@
|
||||
|
||||
#include <ex/trace.h>
|
||||
#include <ke/stos.h>
|
||||
#include <ke/bpal.h>
|
||||
#include <hal/serial.h>
|
||||
#include <stdef.h>
|
||||
|
||||
#define DTRACE(Fmt, ...) \
|
||||
TRACE("[ INIT ]: " Fmt, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Display a boot banner
|
||||
*/
|
||||
static VOID
|
||||
BootBanner(VOID)
|
||||
{
|
||||
TRACE("SystemPaw3 ~ %s\n", ST_VERSION);
|
||||
TRACE("Booting SystemPaw3 !! <3\n");
|
||||
TRACE("-- SystemPaw3 ~ %s --\n", ST_VERSION);
|
||||
DTRACE("booting SystemPaw3 !! <3\n");
|
||||
}
|
||||
|
||||
VOID
|
||||
@@ -29,4 +33,7 @@ KiKernelEntry(VOID)
|
||||
|
||||
/* Write the boot banner */
|
||||
BootBanner();
|
||||
|
||||
/* Initialize BPAL */
|
||||
KeBpalInit();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: Boot protocol abstraction layer
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#include <ke/bpal.h>
|
||||
#include <stdef.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _BOOT_PROTO
|
||||
#error "Boot protocol must be defined"
|
||||
#else
|
||||
#define BOOT_PROTO _BOOT_PROTO
|
||||
#endif /* !_BOOT_PROTO */
|
||||
|
||||
VOID
|
||||
KeBpalInit(VOID)
|
||||
{
|
||||
const CHAR *BootProto = BOOT_PROTO;
|
||||
|
||||
switch (*BootProto) {
|
||||
case 'l':
|
||||
if (RtlMemCmp(BootProto, "limine", 6) == 0) {
|
||||
KeBpalLimineInit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: PANIC HERE */
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: Boot protocol abstraction layer
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#include <ke/bpal.h>
|
||||
#include <ex/trace.h>
|
||||
#include <lib/limine.h>
|
||||
|
||||
#define DTRACE(Fmt, ...) \
|
||||
TRACE("[ BPAL ]: " Fmt, ##__VA_ARGS__)
|
||||
|
||||
/* Bootloader information */
|
||||
static struct limine_bootloader_info_response *LoaderInfoResp = NULL;
|
||||
static volatile struct limine_bootloader_info_request LoaderInfoReq = {
|
||||
.id = LIMINE_BOOTLOADER_INFO_REQUEST_ID,
|
||||
.revision = 0
|
||||
};
|
||||
|
||||
VOID
|
||||
KeBpalLimineInit(VOID)
|
||||
{
|
||||
LoaderInfoResp = LoaderInfoReq.response;
|
||||
|
||||
DTRACE(
|
||||
"slut handed control by %s %s\n",
|
||||
LoaderInfoResp->name,
|
||||
LoaderInfoResp->version
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user