stos: bpal: Add kernel command line request
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -12,3 +12,4 @@ randomize_hhdm_base: yes
|
|||||||
protocol: limine
|
protocol: limine
|
||||||
kernel_path: boot():/boot/stoskrnl.sys
|
kernel_path: boot():/boot/stoskrnl.sys
|
||||||
module_path: boot():/boot/pbi.hole
|
module_path: boot():/boot/pbi.hole
|
||||||
|
cmdline: bootcons=false
|
||||||
|
|||||||
@@ -75,12 +75,14 @@ typedef struct {
|
|||||||
* @Framebuffer: Framebuffer info
|
* @Framebuffer: Framebuffer info
|
||||||
* @MemEntryIdx: Callback to get memory map entry by index
|
* @MemEntryIdx: Callback to get memory map entry by index
|
||||||
* @ModuleLookup: Lookup a module
|
* @ModuleLookup: Lookup a module
|
||||||
|
* @CommandLine: Kernel command line
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UPTR KernelBase;
|
UPTR KernelBase;
|
||||||
BPAL_FRAMEBUFFER Framebuffer;
|
BPAL_FRAMEBUFFER Framebuffer;
|
||||||
ST_STATUS(*MemEntryIdx)(USIZE Idx, MEMMAP_ENTRY *Result);
|
ST_STATUS(*MemEntryIdx)(USIZE Idx, MEMMAP_ENTRY *Result);
|
||||||
ST_STATUS(*ModuleLookup)(CHAR *Path, BPAL_MODULE *Result);
|
ST_STATUS(*ModuleLookup)(CHAR *Path, BPAL_MODULE *Result);
|
||||||
|
const CHAR *CommandLine;
|
||||||
} BPAL_HANDLE;
|
} BPAL_HANDLE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ static volatile struct limine_module_request ModReq = {
|
|||||||
.revision = 0
|
.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
|
static ST_STATUS
|
||||||
LimineModuleLookup(CHAR *Path, BPAL_MODULE *Result)
|
LimineModuleLookup(CHAR *Path, BPAL_MODULE *Result)
|
||||||
{
|
{
|
||||||
@@ -136,6 +143,7 @@ KeBpalLimineInit(BPAL_HANDLE *Handle)
|
|||||||
ModResp = ModReq.response;
|
ModResp = ModReq.response;
|
||||||
FbResp = FbReq.response;
|
FbResp = FbReq.response;
|
||||||
MapResp = MapReq.response;
|
MapResp = MapReq.response;
|
||||||
|
CmdLineResp = CmdLineReq.response;
|
||||||
|
|
||||||
DTRACE(
|
DTRACE(
|
||||||
"slut handed control by %s %s\n",
|
"slut handed control by %s %s\n",
|
||||||
@@ -153,6 +161,12 @@ KeBpalLimineInit(BPAL_HANDLE *Handle)
|
|||||||
LoaderPerfResp->exec_usec
|
LoaderPerfResp->exec_usec
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Handle->CommandLine = CmdLineResp->cmdline;
|
||||||
|
DTRACE(
|
||||||
|
"kernel parameters : %s\n",
|
||||||
|
Handle->CommandLine
|
||||||
|
);
|
||||||
|
|
||||||
BpalInitFramebuffer(Handle);
|
BpalInitFramebuffer(Handle);
|
||||||
Handle->KernelBase = HHDMResp->offset;
|
Handle->KernelBase = HHDMResp->offset;
|
||||||
Handle->MemEntryIdx = LimineMemEntryIdx;
|
Handle->MemEntryIdx = LimineMemEntryIdx;
|
||||||
|
|||||||
Reference in New Issue
Block a user