mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Provoke a page fault
This commit is contained in:
@@ -53,6 +53,9 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
||||
// initialize our IDT
|
||||
interrupts::init();
|
||||
|
||||
// provoke a page fault
|
||||
unsafe { *(0xdeadbeaf as *mut u64) = 42 };
|
||||
|
||||
fn divide_by_zero() {
|
||||
unsafe { asm!("mov dx, 0; div dx" ::: "ax", "dx" : "volatile", "intel") }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user