Add correct sleep which works now because interrupts are re-enabled

using sti in syscalls, remove a bunch of old imports and code, move
keyboard scancode handling to keyboard.rs, add a new KeyboardEvent based
layout where press/release and unicode is handled, add a kbd_read
syscall which writes kbd events to a userspace buffer, add a usercopy
file which provides safe copying functions to userspace
This commit is contained in:
csd4ni3l
2026-04-10 12:48:00 +02:00
parent d60f80c8a4
commit c81bed2a4e
22 changed files with 198 additions and 126 deletions
+6 -3
View File
@@ -1,6 +1,8 @@
use crate::{arch::x86_64::paging::XunilFrameAllocator, mm::address_space::AddressSpace};
use alloc::vec::Vec;
enum ProcessState {
use crate::{driver::keyboard::KeyboardEvent, mm::address_space::AddressSpace};
pub enum ProcessState {
Ready,
Running,
Blocked,
@@ -10,10 +12,10 @@ enum ProcessState {
pub struct Process {
pub pid: u64,
pub state: ProcessState,
// cpu_ctx: &[u8],
pub stack_top: u64,
pub heap_base: u64,
pub heap_end: u64,
pub kbd_buffer: Vec<KeyboardEvent>,
pub address_space: AddressSpace,
pub user_entry: u64,
}
@@ -33,6 +35,7 @@ impl Process {
state: ProcessState::Ready,
heap_base,
heap_end,
kbd_buffer: Vec::new(),
address_space,
user_entry,
})