Reorganize early debug printing; initialize kernel stacks when needed
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#include <xtkmapi.h>
|
||||
#include <xtos.h>
|
||||
|
||||
|
||||
/**
|
||||
@@ -23,14 +23,34 @@ XTAPI
|
||||
VOID
|
||||
KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
|
||||
{
|
||||
/* Use XTLDR provided DbgPrint() routine for early printing to serial console */
|
||||
VOID (*DbgPrint)(IN PWCHAR Format, IN ...) = Parameters->LoaderInformation.DbgPrint;
|
||||
/* Check if debugging enabled and if boot loader provided routine for debug printing */
|
||||
if(DBG && Parameters->LoaderInformation.DbgPrint)
|
||||
{
|
||||
/* Use loader's provided DbgPrint() routine for early printing to serial console */
|
||||
LdrPrint = Parameters->LoaderInformation.DbgPrint;
|
||||
}
|
||||
|
||||
/* Make sure kernel boot stack is initialized */
|
||||
if(!Parameters->KernelBootStack)
|
||||
{
|
||||
/* Initialize kernel boot stack */
|
||||
LDRPRINT(L"Initializing kernel boot stack\n");
|
||||
Parameters->KernelBootStack = (ULONG_PTR)&KepKernelBootStackData[KERNEL_STACK_SIZE];
|
||||
}
|
||||
|
||||
/* Make sure kernel fault stack is initialized */
|
||||
if(!Parameters->KernelFaultStack)
|
||||
{
|
||||
/* Initialize kernel fault stack */
|
||||
LDRPRINT(L"Initializing kernel fault stack\n");
|
||||
Parameters->KernelFaultStack = (ULONG_PTR)&KepKernelFaultStackData[KERNEL_STACK_SIZE];
|
||||
}
|
||||
|
||||
/* Print some message to serial console */
|
||||
DbgPrint(L"Hello world from ExectOS kernel!\n");
|
||||
LDRPRINT(L"Hello world from ExectOS kernel!\n");
|
||||
|
||||
/* Test kernel parameters */
|
||||
DbgPrint(L"\n\n------ Kernel parameters block ------\n"
|
||||
LDRPRINT(L"\n\n------ Kernel parameters block ------\n"
|
||||
L"Loader block size: %lu\n"
|
||||
L"Loader block version: %lu\n"
|
||||
L"EFI Revision: %lu\n"
|
||||
|
Reference in New Issue
Block a user