Test the two-stage exception handler in code

This commit is contained in:
Philipp Oppermann
2016-07-17 17:06:22 +02:00
parent 9e45cf65bc
commit 9113a63f5e
2 changed files with 13 additions and 11 deletions

View File

@@ -12,6 +12,7 @@
#![feature(alloc, collections)]
#![feature(asm)]
#![feature(naked_functions)]
#![feature(core_intrinsics)]
#![no_std]
extern crate rlibc;
@@ -56,7 +57,7 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
unsafe { asm!("mov dx, 0; div dx" ::: "ax", "dx" : "volatile", "intel") }
}
//println!("{:?}", divide_by_zero());
println!("{:?}", divide_by_zero());
// provoke a page fault inside println
println!("{:?}", unsafe { *(0xdeadbeaf as *mut u64) = 42 });