diff options
Diffstat (limited to 'arch/x86_64/src')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 18 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/heap/bump_allocator.cpp (renamed from arch/x86_64/src/memory/heap/allocator.cpp) | 7 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/main.cpp | 2 |
3 files changed, 15 insertions, 12 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index cbd6e68..ce13723 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -1,6 +1,9 @@ #include "arch/kernel/main.hpp" +#include "arch/memory/heap/bump_allocator.hpp" +#include "arch/memory/heap/concept.hpp" #include "arch/memory/main.hpp" +#include "arch/memory/multiboot/reader.hpp" #include "arch/video/vga/text.hpp" namespace teachos::arch::kernel @@ -13,15 +16,16 @@ namespace teachos::arch::kernel memory::initialize_memory_management(); - // heap::bump_allocator heap_allocator{memory::heap::HEAP_START, heap::HEAP_START + memory::heap::HEAP_SIZE}; - // auto test = heap_allocator.allocate(1024); + memory::heap::bump_allocator heap_allocator{memory::heap::HEAP_START, + memory::heap::HEAP_START + memory::heap::HEAP_SIZE}; + auto test = heap_allocator.allocate(1024); - // auto test2 = new (test) multiboot::memory_information{}; + auto test2 = new (test) memory::multiboot::memory_information{}; - // if (test || test2) - // { - // video::vga::text::write("Kernel remapping successfull", video::vga::text::common_attributes::green_on_black); - // } + if (test || test2) + { + video::vga::text::write("Kernel remapping successfull", video::vga::text::common_attributes::green_on_black); + } // TODO: Why is identity mapping multiboot2 information structure with new kernel not required and // allocator.allocate_frame still works? diff --git a/arch/x86_64/src/memory/heap/allocator.cpp b/arch/x86_64/src/memory/heap/bump_allocator.cpp index bb61be4..486ece8 100644 --- a/arch/x86_64/src/memory/heap/allocator.cpp +++ b/arch/x86_64/src/memory/heap/bump_allocator.cpp @@ -1,4 +1,4 @@ -#include "arch/memory/heap/allocator.hpp" +#include "arch/memory/heap/bump_allocator.hpp" #include "arch/exception_handling/assert.hpp" @@ -17,10 +17,9 @@ namespace teachos::arch::memory::heap return reinterpret_cast<void *>(alloc_start); } - auto bump_allocator::deallocate(uint8_t * pointer) -> void + auto bump_allocator::deallocate(uint8_t * pointer, std::size_t size) -> void { - // Not implemented; leaking memory - if (pointer) + if (pointer || size) { } } diff --git a/arch/x86_64/src/memory/main.cpp b/arch/x86_64/src/memory/main.cpp index 80242cc..34ce113 100644 --- a/arch/x86_64/src/memory/main.cpp +++ b/arch/x86_64/src/memory/main.cpp @@ -4,7 +4,7 @@ #include "arch/memory/allocator/area_frame_allocator.hpp" #include "arch/memory/cpu/control_register.hpp" #include "arch/memory/cpu/msr.hpp" -#include "arch/memory/heap/allocator.hpp" +#include "arch/memory/heap/concept.hpp" #include "arch/memory/paging/active_page_table.hpp" #include "arch/memory/paging/kernel_mapper.hpp" |
