aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorTianhao Wang <wth@riseup.net>2024-02-01 15:10:11 +0100
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:13:37 +0200
commitc01e440d014253fd4cae9f642c949720a54baf4b (patch)
tree68d9fc26ccf2f124702b2c2a000892c344f203fe /src/lib.rs
parent753955dbb4e6c77b9c56c659fe766a867c575023 (diff)
basic interrupt/PIC support
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5de826c..80d0146 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,6 +7,9 @@ mod io;
mod machine;
use core::panic::PanicInfo;
use machine::cgascr::CGAScreen;
+use machine::interrupt;
+use arch::x86_64::interrupt::pic_8259;
+use arch::x86_64::interrupt::pic_8259::PicDeviceInt;
#[cfg(not(test))]
#[panic_handler]
@@ -25,5 +28,9 @@ pub extern "C" fn _entry() -> ! {
println!(" `-.-' \\ )-`( , o o)");
println!(" `- \\`_`\"'-");
println!("it works!");
+
+ // testing interrupt/PIC
+ pic_8259::allow(PicDeviceInt::KEYBOARD);
+ interrupt::interrupt_enable();
loop {}
}