Built paging / the kernel's own page tables (with a TSS+IST)

This commit is contained in:
2026-07-03 12:23:55 +01:00
parent 0cc71ec8aa
commit 9cf135302d
10 changed files with 283 additions and 13 deletions
+6
View File
@@ -36,6 +36,7 @@ fn kmain(boot_info: *const BootInfo) noreturn {
arch.init();
con.write("danos: framebuffer console online\n");
con.write("danos: cpu tables online (GDT, IDT, TSS)\n");
con.print(" resolution : {d}x{d}\n", .{ fb.width, fb.height });
con.print(" pitch : {d} bytes\n", .{fb.pitch});
con.print(" format : {s}\n", .{@tagName(fb.format)});
@@ -81,6 +82,11 @@ fn kmain(boot_info: *const BootInfo) noreturn {
if (f2) |p| pmm.free(p);
con.print(" after free : {d} frames free\n", .{pmm.stats().free_frames});
// Switch off the firmware's page tables onto our own.
arch.enablePaging(pmm.alloc);
con.print("\ndanos: paging enabled\n", .{});
con.print(" page tables: CR3 = 0x{x:0>16}\n", .{arch.readCr3()});
con.write("\nkernel initialised; nothing left to do, halting.\n");
arch.halt();