mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 23:07:50 +00:00
Initialize the IDT and provoke a page fault
This commit is contained in:
10
src/lib.rs
10
src/lib.rs
@@ -46,15 +46,13 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
|||||||
// set up guard page and map the heap pages
|
// set up guard page and map the heap pages
|
||||||
memory::init(boot_info);
|
memory::init(boot_info);
|
||||||
|
|
||||||
use alloc::boxed::Box;
|
// initialize our IDT
|
||||||
let heap_test = Box::new(42);
|
interrupts::init();
|
||||||
|
|
||||||
for i in 0..10000 {
|
// provoke a page fault by writing to some random address
|
||||||
format!("Some String");
|
unsafe{ *(0xdeadbeaf as *mut u64) = 42 };
|
||||||
}
|
|
||||||
|
|
||||||
println!("It did not crash!");
|
println!("It did not crash!");
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user