diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-12-15 11:34:30 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-12-15 11:34:30 +0100 |
| commit | 40804526a58ddf2cc0df0750550c8dcfa7b7c57c (patch) | |
| tree | a0dff1f6a51c8819ccc6b81a3648e869c2e80bf8 /arch/x86_64/src/kapi | |
| parent | 2846867da7e88c3a665d0a8bed6ccec60e6476a1 (diff) | |
| download | teachos-40804526a58ddf2cc0df0750550c8dcfa7b7c57c.tar.xz teachos-40804526a58ddf2cc0df0750550c8dcfa7b7c57c.zip | |
x86_64/boot: use high-mem address of MBI
Diffstat (limited to 'arch/x86_64/src/kapi')
| -rw-r--r-- | arch/x86_64/src/kapi/memory.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86_64/src/kapi/memory.cpp b/arch/x86_64/src/kapi/memory.cpp index ae0401e..748893a 100644 --- a/arch/x86_64/src/kapi/memory.cpp +++ b/arch/x86_64/src/kapi/memory.cpp @@ -138,8 +138,8 @@ namespace teachos::memory { auto mbi_base = std::bit_cast<std::uintptr_t>(boot::bootstrap_information.mbi); auto mbi_size = boot::bootstrap_information.mbi->size_bytes(); - auto mbi_physical_start = physical_address{mbi_base}; - auto mbi_virtual_start = linear_address{mbi_base + std::bit_cast<std::uintptr_t>(&boot::x86_64::TEACHOS_VMA)}; + auto mbi_physical_start = physical_address{mbi_base & ~std::bit_cast<std::uintptr_t>(&boot::x86_64::TEACHOS_VMA)}; + auto mbi_virtual_start = linear_address{mbi_base}; auto mbi_block_count = (mbi_size + PLATFORM_FRAME_SIZE - 1) / PLATFORM_FRAME_SIZE; for (auto i = 0uz; i < mbi_block_count; ++i) @@ -148,8 +148,6 @@ namespace teachos::memory auto frame = frame::containing(mbi_physical_start) + 1; mapper.map(page, frame, page_mapper::flags::empty); } - - boot::bootstrap_information.mbi = std::bit_cast<multiboot2::information_view const *>(mbi_virtual_start.raw()); } } // namespace |
