[boot] Don't use custom UEFI memory types

The UEFI spec specifically calls out memory types with the high bit set
as being available for OS loaders' custom use. However, it seems many
UEFI firmware implementations don't handle this well. (Virtualbox, and
the firmware on my Intel NUC and Dell XPS laptop to name a few.)

So sadly since we can't rely on this feature of UEFI in all cases, we
can't use it at all. Instead, treat _all_ memory tagged as EfiLoaderData
as possibly containing data that's been passed to the OS by the
bootloader and don't free it yet.

This will need to be followed up with a change that copies anything we
need to save and frees this memory.

See: https://github.com/kiznit/rainbow-os/blob/master/boot/machine/efi/README.md
This commit is contained in:
Justin C. Miller
2021-01-08 22:40:30 -08:00
parent 8dbdebff3f
commit 12605843ce

View File

@@ -165,6 +165,7 @@ build_kernel_mem_map(kernel::args::header *args, uefi::boot_services *bs)
case uefi::memory_type::loader_data:
type = mem_type::pending;
break;
case uefi::memory_type::runtime_services_code:
case uefi::memory_type::runtime_services_data: