[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

@@ -80,11 +80,6 @@ struct efi_mem_map
iterator end() { return offset_ptr<desc>(entries, length); }
};
/// Get the memory map from UEFI.
/// \arg allocate If false, don't actually fetch the mappings, just
/// return a structure describing them.
efi_mem_map get_uefi_mappings(bool allocate, uefi::boot_services *bs);
/// Add the kernel's memory map as a module to the kernel args.
/// \returns The uefi memory map key for the version used to build
/// this map