[boot] Virtualize memory in the bootloader

Finish updating the page tables, call UEFI's `set_virtual_address_map`
and jump to the kernel!
This commit is contained in:
Justin C. Miller
2020-05-21 23:49:49 -07:00
parent 6a538ad4f3
commit b491a09686
6 changed files with 89 additions and 74 deletions

View File

@@ -189,12 +189,15 @@ efi_main(uefi::handle image_handle, uefi::system_table *st)
kernel::args::header *args =
bootloader_main_uefi(image_handle, st, con, &kentry);
size_t map_key = memory::build_kernel_mem_map(args, st->boot_services);
memory::efi_mem_map map =
memory::build_kernel_mem_map(args, st->boot_services);
try_or_raise(
st->boot_services->exit_boot_services(image_handle, map_key),
st->boot_services->exit_boot_services(image_handle, map.key),
L"Failed to exit boot services");
memory::virtualize(args->pml4, map, st->runtime_services);
kentry(args);
debug_break();
return uefi::status::unsupported;