forked from LowLevelDevs/FoundryOS
setup but not working
This commit is contained in:
@@ -9,6 +9,10 @@ lib_framebuffer = { path = "../lib/lib_framebuffer" }
|
||||
lib_serial = { path = "../lib/lib_serial" }
|
||||
lib_ascii = { path = "../lib/lib_ascii" }
|
||||
lib_alloc = { path = "../lib/lib_alloc" }
|
||||
lib_application = { path = "../lib/lib_application" }
|
||||
lib_async = { path = "../lib/lib_async" }
|
||||
lib_keyboard = { path = "../lib/lib_keyboard" }
|
||||
|
||||
x86_64 = "0.15.2"
|
||||
spin = "0.9.8"
|
||||
pic8259 = "0.11.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use lib_ascii::{print, println_log};
|
||||
use lib_ascii::{print, println, println_log};
|
||||
use lib_serial::serial_println;
|
||||
use x86_64::instructions::port::Port;
|
||||
use x86_64::registers::control::Cr2;
|
||||
@@ -85,10 +85,10 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
|
||||
use spin::Mutex;
|
||||
use x86_64::instructions::port::Port;
|
||||
|
||||
static KEYBOARD: Lazy<Mutex<Keyboard<layouts::Us104Key, ScancodeSet1>>> = Lazy::new(|| {
|
||||
static KEYBOARD: Lazy<Mutex<Keyboard<layouts::Uk105Key, ScancodeSet1>>> = Lazy::new(|| {
|
||||
Mutex::new(Keyboard::new(
|
||||
ScancodeSet1::new(),
|
||||
layouts::Us104Key,
|
||||
layouts::Uk105Key,
|
||||
HandleControl::Ignore,
|
||||
))
|
||||
});
|
||||
@@ -97,14 +97,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
|
||||
let mut port = Port::new(0x60);
|
||||
|
||||
let scancode: u8 = unsafe { port.read() };
|
||||
if let Ok(Some(key_event)) = keyboard.add_byte(scancode) {
|
||||
if let Some(key) = keyboard.process_keyevent(key_event) {
|
||||
match key {
|
||||
DecodedKey::Unicode(character) => print!("{}", character),
|
||||
DecodedKey::RawKey(key) => print!("{:?}", key),
|
||||
}
|
||||
}
|
||||
}
|
||||
lib_keyboard::add_scancode(scancode);
|
||||
|
||||
unsafe {
|
||||
PICS.lock()
|
||||
|
||||
@@ -6,6 +6,8 @@ extern crate alloc;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use foundry_os::{println, println_log};
|
||||
use lib_async::task::{Executor, Task};
|
||||
use lib_keyboard::print_keypresses;
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn kmain() -> ! {
|
||||
@@ -46,5 +48,9 @@ unsafe extern "C" fn kmain() -> ! {
|
||||
"
|
||||
);
|
||||
|
||||
let mut executor = Executor::new();
|
||||
executor.spawn(Task::new(print_keypresses()));
|
||||
executor.try_run();
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user