aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Oesch <lukasoesch20@gmail.com>2026-02-27 19:27:41 +0100
committerLukas Oesch <lukasoesch20@gmail.com>2026-03-17 16:42:14 +0100
commite84c7fbf336847d3ff62aac10ed8f6d04a06cbe8 (patch)
tree32e1f6abcafed484767bd217e72f99defc644c8e
parent144c3fb3845eb9deb1093c3348af5e02cb2cbbb8 (diff)
downloadteachos-e84c7fbf336847d3ff62aac10ed8f6d04a06cbe8.tar.xz
teachos-e84c7fbf336847d3ff62aac10ed8f6d04a06cbe8.zip
use linear_address instead of size_t
-rw-r--r--arch/x86_64/kapi/boot_modules.cpp4
-rw-r--r--kapi/include/kapi/boot_module/boot_module.hpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86_64/kapi/boot_modules.cpp b/arch/x86_64/kapi/boot_modules.cpp
index 5d06eb5..ba01285 100644
--- a/arch/x86_64/kapi/boot_modules.cpp
+++ b/arch/x86_64/kapi/boot_modules.cpp
@@ -3,6 +3,7 @@
#include "kapi/boot.hpp"
#include "kapi/boot_module/boot_module.hpp"
#include "kapi/boot_module/boot_module_registry.hpp"
+#include "kapi/memory.hpp"
#include "kapi/system.hpp"
#include "arch/boot/boot.hpp"
@@ -41,7 +42,8 @@ namespace kapi::boot_modules
std::ranges::for_each(modules, [](auto const & module) {
registry->add_boot_module(kapi::boot_modules::boot_module{
.name = module.string(),
- .start_address = module.start_address + std::bit_cast<std::uintptr_t>(&arch::boot::TEACHOS_VMA),
+ .start_address =
+ memory::linear_address{module.start_address + std::bit_cast<std::uintptr_t>(&arch::boot::TEACHOS_VMA)},
.size = module.end_address - module.start_address,
});
});
diff --git a/kapi/include/kapi/boot_module/boot_module.hpp b/kapi/include/kapi/boot_module/boot_module.hpp
index f2d97ae..729efc9 100644
--- a/kapi/include/kapi/boot_module/boot_module.hpp
+++ b/kapi/include/kapi/boot_module/boot_module.hpp
@@ -1,6 +1,8 @@
#ifndef TEACHOS_KAPI_BOOT_MODULE_BOOT_MODULE_HPP
#define TEACHOS_KAPI_BOOT_MODULE_BOOT_MODULE_HPP
+#include "kapi/memory.hpp"
+
#include <cstddef>
#include <string_view>
@@ -13,7 +15,7 @@ namespace kapi::boot_modules
struct boot_module
{
std::string_view name;
- size_t start_address;
+ memory::linear_address start_address{};
size_t size;
};
} // namespace kapi::boot_modules