[boot] Fix several errors getting to kernel

* When using the non-allocating version of `get_uefi_mappings` the
  length was not getting set. Reworked this function.
* Having `build_kernel_mem_map` from `bootloader_main_uefi` caused it to
  get an out of date map key. Moved this function into `efi_main` right
  before exiting boot services.
This commit is contained in:
Justin C. Miller
2020-05-21 23:00:32 -07:00
parent 6ccc172f33
commit 6a538ad4f3
4 changed files with 34 additions and 43 deletions

View File

@@ -62,11 +62,11 @@ load(
console::print(L" Kernel section %d physical: 0x%lx\r\n", i, pages);
console::print(L" Kernel section %d virtual: 0x%lx\r\n", i, pheader->vaddr);
// TODO: map these pages into kernel args' page tables
// remember to set appropriate RWX permissions
// TODO: set appropriate RWX permissions
paging::map_pages(pml4, args, reinterpret_cast<uintptr_t>(pages), pheader->vaddr, pheader->mem_size);
}
console::print(L" Kernel entrypoint: 0x%lx\r\n", header->entrypoint);
return reinterpret_cast<kernel::entrypoint>(header->entrypoint);
}