Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/csmwrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,22 @@ EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
gBS = SystemTable->BootServices;
gRT = SystemTable->RuntimeServices;

printf("%s", banner);

for (uintptr_t i = 0; i < 0x100000; i += EFI_PAGE_SIZE) {
uintptr_t j = i;
if (gBS->AllocatePages(AllocateAddress, EfiLoaderData, 1, &j) != EFI_SUCCESS) {
if (i < 0xa0000) {
printf("warning: Early AllocatePages() failed for address %p\n", i);
}
}
}

if (gRT->GetTime(&gTimeAtBoot, NULL) != EFI_SUCCESS) {
printf("Failed to query current time\n");
return -1;
}

printf("%s", banner);

gBS->RaiseTPL(TPL_NOTIFY);
gBS->SetWatchdogTimer(0, 0, 0, NULL);

if (unlock_bios_region()) {
Expand Down