Skip to content

Commit b82341a

Browse files
committed
Moved debugging functionality into its own function
Signed-off-by: SlyMarbo <[email protected]>
1 parent 7e0a797 commit b82341a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

kernel/src/main.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,25 @@ fn kmain() {
5858
println!("Kernel running on unknown CPU.");
5959
}
6060

61-
unsafe { memory::vmm::debug(memory::kernel_pml4().level_4_table()) };
62-
memory::pmm::debug();
6361
pci::init();
64-
pci::debug();
62+
63+
debug();
6564

6665
kernel::shutdown_qemu();
6766
}
6867

68+
#[allow(dead_code)]
69+
fn debug() {
70+
// Virtual memory.
71+
unsafe { memory::vmm::debug(memory::kernel_pml4().level_4_table()) };
72+
73+
// Physical memory.
74+
memory::pmm::debug();
75+
76+
// Unclaimed PCI devices.
77+
pci::debug();
78+
}
79+
6980
// Testing framework.
7081

7182
/// This function is called on panic

0 commit comments

Comments
 (0)