From 799b77d11ac8ecfb42a13c5cd30a4fefa9f3859d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 13 Aug 2016 19:08:40 -0600 Subject: [PATCH] Interrupt handling! --- src/arch/x86_64/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/arch/x86_64/main.rs b/src/arch/x86_64/main.rs index d257f2e..4efbc67 100644 --- a/src/arch/x86_64/main.rs +++ b/src/arch/x86_64/main.rs @@ -7,13 +7,13 @@ use super::idt::{IDTR, IDT}; #[naked] #[no_mangle] -pub unsafe extern fn kmain() { +pub unsafe extern "C" fn kmain() { asm!("xchg bx, bx" : : : : "intel", "volatile"); for entry in IDT.iter_mut() { entry.attribute = 1 << 7 | 0xE; entry.selector = 8; - entry.set_offset(&blank as *const _ as usize); + entry.set_offset(blank as usize); entry.zero = 0; entry.zero2 = 0; } @@ -30,7 +30,7 @@ pub unsafe extern fn kmain() { } #[naked] -pub unsafe extern fn blank() { +pub unsafe extern "C" fn blank() { asm!("xchg bx, bx" : : : : "intel", "volatile"); asm!("iretq" : : : : "intel", "volatile"); }