From df8335f8c7942ccc5462ea932f7a164a4cce79a0 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 25 Apr 2019 18:08:48 +0200 Subject: [PATCH] Add a new blog_os::init function instead of calling init_idt directly --- src/lib.rs | 4 ++++ src/main.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0ba65aea..55f3b457 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,10 @@ pub mod interrupts; pub mod serial; pub mod vga_buffer; +pub fn init() { + interrupts::init_idt(); +} + pub fn test_runner(tests: &[&dyn Fn()]) { serial_println!("Running {} tests", tests.len()); for test in tests { diff --git a/src/main.rs b/src/main.rs index ea64dbf8..bf5529ad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use core::panic::PanicInfo; pub extern "C" fn _start() -> ! { println!("Hello World{}", "!"); - blog_os::interrupts::init_idt(); + blog_os::init(); // invoke a breakpoint exception x86_64::instructions::interrupts::int3();