Make keyboard lock-free (and fix Doom deadlock) by only pushing

scancodes to a spsc queue from the interrupts and only process them
inside syscalls. Also make CURRENT_PID atomic to use less locking
This commit is contained in:
csd4ni3l
2026-04-19 18:22:16 +02:00
parent 2b8a965c92
commit f4c2657b94
11 changed files with 218 additions and 131 deletions

48
kernel/Cargo.lock generated
View File

@@ -7,11 +7,13 @@ name = "XunilOS"
version = "0.1.0"
dependencies = [
"font8x8",
"heapless",
"lazy_static",
"limine",
"pc-keyboard",
"pic8259",
"spin 0.10.0",
"static_cell",
"x86_64",
]
@@ -27,6 +29,12 @@ version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "const_fn"
version = "0.4.12"
@@ -39,6 +47,25 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "875488b8711a968268c7cf5d139578713097ca4635a76044e8fe8eedf831d07e"
[[package]]
name = "hash32"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
dependencies = [
"byteorder",
]
[[package]]
name = "heapless"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af2455f757db2b292a9b1768c4b70186d443bcb3b316252d6b540aec1cd89ed"
dependencies = [
"hash32",
"stable_deref_trait",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@@ -81,6 +108,12 @@ dependencies = [
"x86_64",
]
[[package]]
name = "portable-atomic"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
[[package]]
name = "rustversion"
version = "1.0.22"
@@ -108,6 +141,21 @@ dependencies = [
"lock_api",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
[[package]]
name = "static_cell"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0530892bb4fa575ee0da4b86f86c667132a94b74bb72160f58ee5a4afec74c23"
dependencies = [
"portable-atomic",
]
[[package]]
name = "volatile"
version = "0.4.6"