summaryrefslogtreecommitdiff
path: root/kernel/src/interrupts/interrupt_handlers.rs
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2019-11-27 01:46:33 +0100
committerDennis Kobert <dennis@kobert.dev>2019-11-27 01:46:33 +0100
commit2701fe07b4c8c9b6a36112c98fbfc900acbd6cf3 (patch)
treed8b6d0c2ba3f79110a5c3b0c885749a14b8de25d /kernel/src/interrupts/interrupt_handlers.rs
parent0cb231bd3de9bcd4c39064399211fbd2fbc6237e (diff)
Implement proto Keyboard handlingHEADmaster
Diffstat (limited to 'kernel/src/interrupts/interrupt_handlers.rs')
-rw-r--r--kernel/src/interrupts/interrupt_handlers.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/src/interrupts/interrupt_handlers.rs b/kernel/src/interrupts/interrupt_handlers.rs
index 4624723..e7af0e1 100644
--- a/kernel/src/interrupts/interrupt_handlers.rs
+++ b/kernel/src/interrupts/interrupt_handlers.rs
@@ -1,11 +1,21 @@
use super::InterruptType;
use crate::io::qemu;
+use core::fmt::Write;
use x86_64::structures::idt::{InterruptStackFrame, PageFaultErrorCode};
+use x86_64::structures::port;
pub extern "x86-interrupt" fn timer_handler(stack_frame: &mut InterruptStackFrame) {
- panic!("Timer interrupt recieved\n\n");
+ write!(crate::io::vga_text::OStream::new(), "Timer");
if let Some(apic) = unsafe { super::apic::get_local_apic() } {
apic.end_of_interrupt()
}
}
+
+pub extern "x86-interrupt" fn keyboard_handler(stack_frame: &mut InterruptStackFrame) {
+ let code: u8 = unsafe { port::PortRead::read_from_port(0x60) };
+ write!(crate::io::vga_text::OStream::new(), "{}", code);
+ if let Some(apic) = unsafe { super::apic::get_local_apic() } {
+ apic.end_of_interrupt()
+ }
+}