summaryrefslogtreecommitdiff
path: root/kernel/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/lib.rs')
-rw-r--r--kernel/src/lib.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs
index cbc9915..8ec68e5 100644
--- a/kernel/src/lib.rs
+++ b/kernel/src/lib.rs
@@ -1,13 +1,13 @@
#![no_main]
#![feature(compiler_builtins_lib)]
#![feature(custom_test_frameworks)]
+#![feature(abi_x86_interrupt)]
#![feature(panic_info_message)]
#![test_runner(crate::test_runner)]
#![reexport_test_harness_main = "test_main"]
#![no_std]
-extern crate compiler_builtins;
-
+mod interrupts;
mod io;
use core::fmt::Write;
@@ -26,6 +26,7 @@ pub fn test_runner(tests: &[&dyn Fn(&mut OStream)]) {
#[no_mangle]
pub extern "C" fn _start() -> ! {
+ interrupts::table::init();
if cfg!(test) {
#[cfg(test)]
test_main();
@@ -39,6 +40,7 @@ pub extern "C" fn _start() -> ! {
core::iter::successors(Some(0), |n| Some(n + 1))
.for_each(|n| write!(&mut stdout, "hello world {}!", n).unwrap());
+ x86_64::instructions::interrupts::int3();
loop {}
}
@@ -64,8 +66,12 @@ pub extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! {
vga_text::Color::Red,
));
stderr.set_centered(true);
- write!(&mut stderr, "{:?}", info.message()
- .unwrap_or(&format_args!("no panic information obtainable")));
+ write!(
+ &mut stderr,
+ "{:?}",
+ info.message()
+ .unwrap_or(&format_args!("no panic information obtainable"))
+ );
//loop{}
stderr.set_centered(false);
if cfg!(test) {