mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Move the testing code to the end of _start
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user