Switch kernel stack and move boot structures initialization into separate routine

This commit is contained in:
2023-01-08 10:35:49 +01:00
parent 6255165f10
commit 12b8c5f539
7 changed files with 149 additions and 1 deletions

View File

@@ -45,6 +45,27 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
);
/* Initialize kernel boot structures */
KepInitializeBootStructures(Parameters);
/* Switch boot stack alligning it to 4 byte boundary */
KepSwitchBootStack(KeInitializationBlock->KernelBootStack & ~0x3);
}
/**
* Initializes boot structures needed by the kernel startup code.
*
* @param Parameters
* Supplies a pointer to memory area containing parameters passed to kernel by bootloader.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
KepInitializeBootStructures(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
{
/* Make sure kernel boot stack is initialized */
if(!Parameters->KernelBootStack)
{