From e8bbb1ad850a362dfa25ba1ea7bdd838a379def8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 1 Dec 2024 07:46:20 +0000 Subject: Move heap virtual location and allocate multiple variables to test heap. --- arch/x86_64/include/arch/memory/heap/concept.hpp | 2 +- arch/x86_64/src/kernel/main.cpp | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/x86_64/include/arch/memory/heap/concept.hpp b/arch/x86_64/include/arch/memory/heap/concept.hpp index 8c8c887..52dba51 100644 --- a/arch/x86_64/include/arch/memory/heap/concept.hpp +++ b/arch/x86_64/include/arch/memory/heap/concept.hpp @@ -5,7 +5,7 @@ namespace teachos::arch::memory::heap { - std::size_t constexpr HEAP_START = 0x4000'0000; + std::size_t constexpr HEAP_START = 0x100000000; std::size_t constexpr HEAP_SIZE = 100 * 1024; template diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index 023327e..dd0a1d8 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -20,10 +20,15 @@ namespace teachos::arch::kernel memory::heap::HEAP_START + memory::heap::HEAP_SIZE}; auto test = heap_allocator.allocate(1024); auto test2 = new (test) memory::multiboot::memory_information{}; - auto test3 = *test2; - test3.kernel_end = 5000; - auto test4 = test3.kernel_end; - if (test || test2 || test3.kernel_end || test4) + test = static_cast(static_cast(test) + 1); + auto test3 = new (test) memory::multiboot::memory_information{}; + auto test4 = *test2; + auto test5 = *test3; + test4.kernel_end = 5000; + test5.kernel_end = 3000; + auto test6 = test4.kernel_end; + auto test7 = test5.kernel_end; + if (test6 && test7) { video::vga::text::write("Kernel remapping successfull", video::vga::text::common_attributes::green_on_black); } -- cgit v1.2.3