Skip to content

Commit

Permalink
keyboard input with os_terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyukai0403 committed Jan 23, 2025
1 parent c145687 commit 586f40b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/src/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ pub extern "x86-interrupt" fn handler3(_: InterruptStackFrame) {
}

pub extern "x86-interrupt" fn handler4(_: InterruptStackFrame) {
print!("A");
unsafe {
let _: u8 = x86_64::instructions::port::PortReadOnly::new(0x60).read();
let scancode: u8 = x86_64::instructions::port::PortReadOnly::new(0x60).read();
let mut lock = crate::console::TERMINAL.lock();
if let Some(s) = lock.handle_keyboard(scancode) {
lock.process(s.as_bytes());
}
}
crate::apic::local::eoi();
}
Expand Down

0 comments on commit 586f40b

Please sign in to comment.