diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-01-16 13:55:51 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-01-16 13:55:51 +0100 |
| commit | 159bdd2cac3f967c31c2f416fbc542e0277ec860 (patch) | |
| tree | 328f69d3490a4a7e95bb86fe2ccdc7a8bd877890 | |
| parent | f3362a5e486582854c4e85ea54d2357d3b3b2f60 (diff) | |
| download | teachos-159bdd2cac3f967c31c2f416fbc542e0277ec860.tar.xz teachos-159bdd2cac3f967c31c2f416fbc542e0277ec860.zip | |
kapi/system: introduce memory_initialized hook
| -rw-r--r-- | arch/x86_64/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | arch/x86_64/kapi/system.cpp | 14 | ||||
| -rw-r--r-- | kapi/include/kapi/system.hpp | 4 | ||||
| -rw-r--r-- | kernel/src/main.cpp | 1 |
4 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86_64/CMakeLists.txt b/arch/x86_64/CMakeLists.txt index 413b5aa..9ea10e9 100644 --- a/arch/x86_64/CMakeLists.txt +++ b/arch/x86_64/CMakeLists.txt @@ -15,6 +15,7 @@ target_sources("x86_64" PRIVATE "kapi/cio.cpp" "kapi/cpu.cpp" "kapi/memory.cpp" + "kapi/system.cpp" # Low-level bootstrap "src/boot/boot32.S" diff --git a/arch/x86_64/kapi/system.cpp b/arch/x86_64/kapi/system.cpp new file mode 100644 index 0000000..5bcae4d --- /dev/null +++ b/arch/x86_64/kapi/system.cpp @@ -0,0 +1,14 @@ +#include "kapi/system.hpp" + +#include <kstd/print> + +namespace kapi::system +{ + + auto memory_initialized() -> void + { + kstd::println("[x86_64:SYS] TODO: initialize Interrupt Descriptor Table."); + kstd::println("[x86_64:SYS] TODO: reload Global Descriptor Table."); + } + +} // namespace kapi::system
\ No newline at end of file diff --git a/kapi/include/kapi/system.hpp b/kapi/include/kapi/system.hpp index 6c5683a..e5c43c5 100644 --- a/kapi/include/kapi/system.hpp +++ b/kapi/include/kapi/system.hpp @@ -15,6 +15,10 @@ namespace kapi::system //! @param message The message associated with the panic [[noreturn]] auto panic(std::string_view message, std::source_location = std::source_location::current()) -> void; + //! @qualifier platform-defined + //! A hook that runs once the memory subsystem has been initialized. + auto memory_initialized() -> void; + } // namespace kapi::system #endif diff --git a/kernel/src/main.cpp b/kernel/src/main.cpp index 8732fa2..d69903d 100644 --- a/kernel/src/main.cpp +++ b/kernel/src/main.cpp @@ -11,6 +11,7 @@ auto main() -> int kapi::memory::init(); kstd::println("[OS] Memory subsystem initialized."); + kapi::system::memory_initialized(); kapi::system::panic("Returning from kernel main!"); } |
