aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi
diff options
context:
space:
mode:
authorLukas Oesch <lukasoesch20@gmail.com>2026-02-26 11:24:27 +0100
committerLukas Oesch <lukasoesch20@gmail.com>2026-03-17 16:42:10 +0100
commit035c8d6e38fd901e6769a81f67b8d9e1e3fcea20 (patch)
tree5ca549e23b86529fa65045e2f63cdc8411e165ba /kernel/kapi
parentea8172296fa5b56137f97c01650b8d392bdb897f (diff)
downloadteachos-035c8d6e38fd901e6769a81f67b8d9e1e3fcea20.tar.xz
teachos-035c8d6e38fd901e6769a81f67b8d9e1e3fcea20.zip
implemented boot_modules and boot_module_registry, init boot_modules in kernel main
Diffstat (limited to 'kernel/kapi')
-rw-r--r--kernel/kapi/boot_modules.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/kapi/boot_modules.cpp b/kernel/kapi/boot_modules.cpp
new file mode 100644
index 0000000..3f0f044
--- /dev/null
+++ b/kernel/kapi/boot_modules.cpp
@@ -0,0 +1,21 @@
+#include "kapi/boot_modules.hpp"
+
+#include "kapi/system.hpp"
+
+#include <optional>
+
+namespace kapi::boot_modules
+{
+
+ constinit auto static registry = std::optional<kapi::boot_modules::boot_module_registry>{};
+
+ auto set_boot_module_registry(boot_module_registry & registry) -> void
+ {
+ if (kapi::boot_modules::registry)
+ {
+ system::panic("[x86_64] Boot module registry has already been set.");
+ }
+
+ kapi::boot_modules::registry = registry;
+ }
+} // namespace kapi::boot_modules