diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-03-16 10:49:53 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-03-16 10:49:53 +0100 |
| commit | f85d95627cf2bfed4f399fdac167e9877fe8e87c (patch) | |
| tree | 0f19a55c8b7d029f098b800bcf4dcd9b2526b72a | |
| parent | 80ae75bf039820ecb332ae1ab86ef6ce4e2675e4 (diff) | |
| download | teachos-f85d95627cf2bfed4f399fdac167e9877fe8e87c.tar.xz teachos-f85d95627cf2bfed4f399fdac167e9877fe8e87c.zip | |
kernel/memory: add more logging statements
| -rw-r--r-- | kernel/src/memory.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/src/memory.cpp b/kernel/src/memory.cpp index 3bc86f3..0f614f0 100644 --- a/kernel/src/memory.cpp +++ b/kernel/src/memory.cpp @@ -6,6 +6,8 @@ #include "kernel/memory/block_list_allocator.hpp" #include "kernel/memory/heap_allocator.hpp" +#include <kstd/print> + #include <atomic> #include <cstddef> #include <new> @@ -22,10 +24,14 @@ namespace kernel::memory [[nodiscard]] auto allocate(std::size_t, std::align_val_t) noexcept -> void * override { + kstd::print(kstd::print_sink::stderr, "Tried to allocate memory without an active heap!"); return nullptr; } - auto deallocate(void *) noexcept -> void override {} + auto deallocate(void *) noexcept -> void override + { + kstd::print(kstd::print_sink::stderr, "Tried to deallocate memory without an active heap!"); + } }; constinit null_allocator null_allocator::instance{}; @@ -45,11 +51,12 @@ namespace kernel::memory if (is_initialized.test_and_set()) { - kapi::system::panic("[OS] The heap has already been initialized."); + kapi::system::panic("[OS:MEM] The heap has already been initialized."); } auto & instance = basic_allocator.emplace(base); active_heap_allocator = &instance; + kstd::println("[OS:MEM] Heap initialized. Dynamic memory available."); } } // namespace kernel::memory
\ No newline at end of file |
