diff --git a/kernel-rs/src/lib.rs b/kernel-rs/src/lib.rs index 2a791bc2..43d10e56 100644 --- a/kernel-rs/src/lib.rs +++ b/kernel-rs/src/lib.rs @@ -35,8 +35,8 @@ pub extern fn kmain(multiboot_info_addr: usize) -> ! { let boot_info = unsafe { multiboot2::load(multiboot_info_addr) }; enable_write_protect_bit(); - vga::init(); memory::init(&boot_info); + vga::init(); use alloc::boxed::Box; let mut heap_test = Box::new(42); diff --git a/kernel-rs/src/memory/paging/mod.rs b/kernel-rs/src/memory/paging/mod.rs index 0e47014a..636f235d 100644 --- a/kernel-rs/src/memory/paging/mod.rs +++ b/kernel-rs/src/memory/paging/mod.rs @@ -118,7 +118,7 @@ impl ActivePageTable { // execute f in the new context f(self); - // TODO restore recursive mapping to original p2 table + // restore recursive mapping to original p2 table p2_table[1023].set(backup, EntryFlags::PRESENT | EntryFlags::WRITABLE); } @@ -207,12 +207,8 @@ pub fn remap_the_kernel(allocator: &mut A, boot_info: &BootInformation) }); let old_table = active_table.switch(new_table); - - let old_p2_page = Page::containing_address( - old_table.p2_frame.start_address() - ); + let old_p2_page = Page::containing_address(old_table.p2_frame.start_address()); active_table.unmap(old_p2_page, allocator); - active_table } diff --git a/kernel-rs/src/memory/paging/temporary_page.rs b/kernel-rs/src/memory/paging/temporary_page.rs index 77ef6440..e098fef3 100644 --- a/kernel-rs/src/memory/paging/temporary_page.rs +++ b/kernel-rs/src/memory/paging/temporary_page.rs @@ -74,6 +74,6 @@ impl FrameAllocator for TinyAllocator { return; } } - panic!("Tiny allcoator can only hold 1 frame."); + panic!("Tiny allocator can only hold 1 frame."); } }