Hardened paging into a real VMM
This commit is contained in:
+3
-2
@@ -86,10 +86,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);
|
||||
// Switch off the firmware's page tables onto our own (with real permissions).
|
||||
arch.enablePaging(pmm.alloc, boot_info);
|
||||
con.print("\ndanos: paging enabled\n", .{});
|
||||
con.print(" page tables: CR3 = 0x{x:0>16}\n", .{arch.readCr3()});
|
||||
con.print(" kernel segs: {d} (mapped with W^X permissions)\n", .{boot_info.kernel_segment_count});
|
||||
|
||||
// Start the timer and unmask interrupts — the kernel now has a heartbeat.
|
||||
arch.startTimer();
|
||||
|
||||
Reference in New Issue
Block a user