Add and test a handler_with_error_code macro and a page fault handler

This commit is contained in:
Philipp Oppermann
2016-08-03 16:36:58 +02:00
parent df1e39edb2
commit 69f1b58bb0
2 changed files with 34 additions and 2 deletions

View File

@@ -52,8 +52,9 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
// initialize our IDT
interrupts::init();
// provoke a invalid opcode exception
unsafe { asm!("ud2") };
// provoke a page fault
unsafe { *(0xdeadbeaf as *mut u64) = 42 };
println!("It did not crash!");
loop {}