stos: bpal: Add kernel command line request

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-23 03:00:06 +00:00
parent 03a68ddd39
commit 6c297030ad
3 changed files with 17 additions and 0 deletions
+1
View File
@@ -12,3 +12,4 @@ randomize_hhdm_base: yes
protocol: limine
kernel_path: boot():/boot/stoskrnl.sys
module_path: boot():/boot/pbi.hole
cmdline: bootcons=false
+2
View File
@@ -75,12 +75,14 @@ typedef struct {
* @Framebuffer: Framebuffer info
* @MemEntryIdx: Callback to get memory map entry by index
* @ModuleLookup: Lookup a module
* @CommandLine: Kernel command line
*/
typedef struct {
UPTR KernelBase;
BPAL_FRAMEBUFFER Framebuffer;
ST_STATUS(*MemEntryIdx)(USIZE Idx, MEMMAP_ENTRY *Result);
ST_STATUS(*ModuleLookup)(CHAR *Path, BPAL_MODULE *Result);
const CHAR *CommandLine;
} BPAL_HANDLE;
/*
+14
View File
@@ -58,6 +58,13 @@ static volatile struct limine_module_request ModReq = {
.revision = 0
};
/* Command line request */
static struct limine_executable_cmdline_response *CmdLineResp = NULL;
static struct limine_executable_cmdline_request CmdLineReq = {
.id = LIMINE_EXECUTABLE_CMDLINE_REQUEST_ID,
.revision = 0
};
static ST_STATUS
LimineModuleLookup(CHAR *Path, BPAL_MODULE *Result)
{
@@ -136,6 +143,7 @@ KeBpalLimineInit(BPAL_HANDLE *Handle)
ModResp = ModReq.response;
FbResp = FbReq.response;
MapResp = MapReq.response;
CmdLineResp = CmdLineReq.response;
DTRACE(
"slut handed control by %s %s\n",
@@ -153,6 +161,12 @@ KeBpalLimineInit(BPAL_HANDLE *Handle)
LoaderPerfResp->exec_usec
);
Handle->CommandLine = CmdLineResp->cmdline;
DTRACE(
"kernel parameters : %s\n",
Handle->CommandLine
);
BpalInitFramebuffer(Handle);
Handle->KernelBase = HHDMResp->offset;
Handle->MemEntryIdx = LimineMemEntryIdx;