loader: initial loader code

This commit is contained in:
Loïc Grégoire
2026-07-16 19:48:01 -04:00
parent 26ec72fb36
commit a79c7a07cb
35 changed files with 1197 additions and 548 deletions
+1 -7
View File
@@ -117,11 +117,5 @@ pub fn is_leaf_level_enabled(level: usize) bool {
}
pub fn init_kernel() void {
mi.kernel_space.pmap.root_pa = mi.phys.early_alloc();
const table_ptr: [*]Pte = @ptrFromInt(mm.p2v(mi.kernel_space.pmap.root_pa));
@memset(table_ptr[0..512], Pte.zero());
for (256..512) |i| {
table_ptr[i] = make_table_pte(mi.phys.early_alloc());
}
mi.kernel_space.pmap.root_pa = amd64.read_cr(3);
}