[boot] Fix call to exit_boot_services

Exiting boot services can't actually be done from inside
`bootloader_uefi_main`, because there are objects in that scope that run
code requiring boot services in their destructors.

Also added `support.cpp` with `memcpy` because clang will emit
references to `memcpy` even in freestanding mode.

Added a `debug_break` function to allow for faking breakpoints when
connecting to the bootloader with GDB.

Tags: debug
This commit is contained in:
Justin C. Miller
2020-05-13 02:08:47 -07:00
parent 2bd91c2d94
commit a6e4995963
7 changed files with 50 additions and 6 deletions

View File

@@ -67,6 +67,8 @@ init_pointer_fixup(uefi::boot_services *bs, uefi::runtime_services *rs)
status_line status(L"Initializing pointer virtualization event");
uefi::event event;
bs->set_mem(&fixup_pointers, sizeof(fixup_pointers), 0);
fixup_pointer_index = 0;
try_or_raise(
bs->create_event(