From 93aff8cfa8fd5ae868351a33a618ec2891a073dc Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 18 Apr 2017 15:17:43 +0200 Subject: [PATCH] Test our exception handler by invoking a breakpoint exception --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 8377011..90b4512 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,12 +48,17 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) { HEAP_ALLOCATOR.lock().init(HEAP_START, HEAP_START + HEAP_SIZE); } + // initialize our IDT + interrupts::init(); + for i in 0..10000 { format!("Some String"); } - println!("It did not crash!"); + // invoke a breakpoint exception + x86_64::instructions::interrupts::int3(); + println!("It did not crash!"); loop {} }