Move the testing code to the end of _start

This commit is contained in:
Philipp Oppermann
2019-01-26 12:57:32 +01:00
parent 7c07a67bf5
commit b184f7d996

View File

@@ -11,12 +11,6 @@ pub extern "C" fn _start() -> ! {
use blog_os::interrupts::PICS; use blog_os::interrupts::PICS;
use x86_64::structures::paging::PageTable; use x86_64::structures::paging::PageTable;
let level_4_table_ptr = 0xffff_ffff_ffff_f000 as *const PageTable;
let level_4_table = unsafe { &*level_4_table_ptr };
for i in 0..10 {
println!("Entry {}: {:?}", i, level_4_table[i]);
}
println!("Hello World{}", "!"); println!("Hello World{}", "!");
blog_os::gdt::init(); blog_os::gdt::init();
@@ -24,6 +18,12 @@ pub extern "C" fn _start() -> ! {
unsafe { PICS.lock().initialize() }; unsafe { PICS.lock().initialize() };
x86_64::instructions::interrupts::enable(); x86_64::instructions::interrupts::enable();
let level_4_table_ptr = 0xffff_ffff_ffff_f000 as *const PageTable;
let level_4_table = unsafe { &*level_4_table_ptr };
for i in 0..10 {
println!("Entry {}: {:?}", i, level_4_table[i]);
}
println!("It did not crash!"); println!("It did not crash!");
blog_os::hlt_loop(); blog_os::hlt_loop();
} }