[BOOT] Execution contexts and more refactoring

This commit is contained in:
2024-10-05 15:44:25 -04:00
parent 7c3dafc051
commit 24a31cab26
13 changed files with 317 additions and 118 deletions

View File

@@ -13,9 +13,12 @@ Abstract:
--*/
#include <ntrtl.h>
#include "bootlib.h"
#include "efi.h"
BOOT_FIRMWARE_DATA EfiFirmwareData;
PBOOT_FIRMWARE_DATA EfiFirmwareParameters;
EFI_SYSTEM_TABLE *EfiST;
EFI_BOOT_SERVICES *EfiBS;
EFI_RUNTIME_SERVICES *EfiRT;
@@ -36,7 +39,10 @@ Routine Description:
Arguments:
Stage - 0 or 1.
Stage - Which stage of initialization to perform.
Stage 0: Initialize global firmware-related data and pointers.
Once this stage is complete, ConsolePrint() and ConsolePrintf() can be used.
FirmwareData - Pointer to BOOT_FIRMWARE_DATA.
@@ -53,6 +59,9 @@ Return Value:
}
if (Stage == 0) {
RtlCopyMemory(&EfiFirmwareData, FirmwareData, sizeof(BOOT_FIRMWARE_DATA));
EfiFirmwareParameters = &EfiFirmwareData;
EfiST = FirmwareData->SystemTable;
EfiBS = EfiST->BootServices;
EfiRT = EfiST->RuntimeServices;
@@ -60,5 +69,9 @@ Return Value:
EfiConIn = EfiST->ConIn;
}
//
// TODO: Implement stage 1 initialization.
//
return STATUS_SUCCESS;
}