From c0f304559fb6d6c99e2a095ae8a683ac90587f41 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sat, 23 Jan 2021 20:30:09 -0800 Subject: [PATCH] [boot] Send module addresses as physical This makes the job of the kernel easier when marking module pages as used in the frame allocator. This will also help when sending modules over to the init process. --- src/boot/main.cpp | 5 ----- src/kernel/main.cpp | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/boot/main.cpp b/src/boot/main.cpp index eae7100..500b692 100644 --- a/src/boot/main.cpp +++ b/src/boot/main.cpp @@ -152,11 +152,6 @@ uefi_preboot(uefi::handle image, uefi::system_table *st) loader::load_program(program, desc.name, buf, bs); } - for (unsigned i = 0; i < args->num_modules; ++i) { - args::module &mod = args->modules[i]; - change_pointer(mod.location); - } - return args; } diff --git a/src/kernel/main.cpp b/src/kernel/main.cpp index a50b785..7c049d3 100644 --- a/src/kernel/main.cpp +++ b/src/kernel/main.cpp @@ -98,9 +98,11 @@ kernel_main(args::header *header) for (size_t i = 0; i < header->num_modules; ++i) { args::module &mod = header->modules[i]; + void *virt = memory::to_virtual(mod.location); + switch (mod.type) { case args::mod_type::symbol_table: - new symbol_table {mod.location, mod.size}; + new symbol_table {virt, mod.size}; break; default: