stos: bpal: Add kernel command line request
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user