From 91ffde47281e615c3d68041eaeb58c93b11dbd97 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 18 Apr 2017 18:10:23 +0200 Subject: [PATCH] Trigger a double fault by causing a page fault --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 90b4512..3e9be37 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,11 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) { // invoke a breakpoint exception x86_64::instructions::interrupts::int3(); + // trigger a page fault + unsafe { + *(0xdeadbeaf as *mut u64) = 42; + }; + println!("It did not crash!"); loop {} }