diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-11-26 09:49:06 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-11-26 09:49:06 +0000 |
| commit | d2aa4fbf948a56df5328e0f1b8ec3dfd52b16e13 (patch) | |
| tree | 8a6e8ffcb1f92af994103055a47de10c0a7bbd3d /arch/x86_64/src/kernel | |
| parent | eada7bbb150fd81e6fbf71b1df28c8dc19393cfa (diff) | |
| download | teachos-d2aa4fbf948a56df5328e0f1b8ec3dfd52b16e13.tar.xz teachos-d2aa4fbf948a56df5328e0f1b8ec3dfd52b16e13.zip | |
Make bump allocator atomic and therefore thread safe
Diffstat (limited to 'arch/x86_64/src/kernel')
| -rw-r--r-- | arch/x86_64/src/kernel/main.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp index 13526f4..023327e 100644 --- a/arch/x86_64/src/kernel/main.cpp +++ b/arch/x86_64/src/kernel/main.cpp @@ -20,9 +20,10 @@ 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{}; - test2->kernel_end = 5000; - auto test3 = test2->kernel_end; - if (test || test2 || test3) + auto test3 = *test2; + test3.kernel_end = 5000; + auto test4 = test3.kernel_end; + if (test || test2 || test3.kernel_end || test4) { video::vga::text::write("Kernel remapping successfull", video::vga::text::common_attributes::green_on_black); } @@ -31,7 +32,5 @@ namespace teachos::arch::kernel // allocator.allocate_frame still works? // TODO: Fix unmapping old level 4 page table and turn it into guard page, use Stack Probes for stack allocation if // possible. - - // TODO: Align up and down for the bump allocator. https://os.phil-opp.com/kernel-heap/#a-bump-allocator } } // namespace teachos::arch::kernel |
