feat: start adding physical memory allocator

This commit is contained in:
Katharina 2026-06-28 16:19:21 +02:00
parent 8dc53f662e
commit e2ea22ad53
15 changed files with 440 additions and 38 deletions

View file

@ -17,3 +17,14 @@ void for_each_reserved_section(Fn&& fn) {
for (auto* s = __reserved_ranges_start__; s < __reserved_ranges_end__; ++s)
fn(*s);
}
inline bool is_in_reserved_section(paddr_t ptr, size_t size = 1) {
bool res = false;
for_each_reserved_section([&](const KernelSection& section) {
if (ptr.address < section.phys_end().address &&
section.phys_start().address < ptr.address + size) {
res = true;
}
});
return res;
}