forked from LowLevelDevs/FoundryOS
setup but not working
This commit is contained in:
@@ -13,3 +13,9 @@
|
||||
[submodule "lib/lib_alloc"]
|
||||
path = lib/lib_alloc
|
||||
url = https://git.zxq5.dev/OsDev/FoundryOS-lib_alloc.git
|
||||
[submodule "lib/lib_async"]
|
||||
path = lib/lib_async
|
||||
url = https://git.zxq5.dev/OsDev/FoundryOS-lib_async.git
|
||||
[submodule "lib/lib_keyboard"]
|
||||
path = lib/lib_keyboard
|
||||
url = https://git.zxq5.dev/OsDev/FoundryOS-lib_keyboard.git
|
||||
|
||||
Generated
+94
@@ -29,14 +29,52 @@ dependencies = [
|
||||
"shlex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8"
|
||||
dependencies = [
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-queue",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.3.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
||||
|
||||
[[package]]
|
||||
name = "foundry_os"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"lib_alloc",
|
||||
"lib_application",
|
||||
"lib_ascii",
|
||||
"lib_async",
|
||||
"lib_framebuffer",
|
||||
"lib_keyboard",
|
||||
"lib_serial",
|
||||
"limine",
|
||||
"pc-keyboard",
|
||||
@@ -45,6 +83,30 @@ dependencies = [
|
||||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
||||
|
||||
[[package]]
|
||||
name = "futures-task"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
|
||||
|
||||
[[package]]
|
||||
name = "futures-util"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-task",
|
||||
"pin-project-lite",
|
||||
"pin-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
@@ -79,6 +141,15 @@ dependencies = [
|
||||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lib_async"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"crossbeam",
|
||||
"spin",
|
||||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lib_framebuffer"
|
||||
version = "0.1.0"
|
||||
@@ -87,6 +158,17 @@ dependencies = [
|
||||
"spin",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lib_keyboard"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"crossbeam",
|
||||
"futures-util",
|
||||
"lib_ascii",
|
||||
"pc-keyboard",
|
||||
"spin",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lib_serial"
|
||||
version = "0.1.0"
|
||||
@@ -139,6 +221,18 @@ dependencies = [
|
||||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
|
||||
|
||||
[[package]]
|
||||
name = "pin-utils"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.19"
|
||||
|
||||
+3
-1
@@ -1,11 +1,13 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"kernel",
|
||||
"lib/lib_framebuffer",
|
||||
"lib/lib_serial",
|
||||
"lib/lib_ascii",
|
||||
"kernel",
|
||||
"lib/lib_application",
|
||||
"lib/lib_alloc",
|
||||
"lib/lib_async",
|
||||
"lib/lib_keyboard",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
}
|
||||
|
||||
Submodule
+1
Submodule lib/lib_async added at 5e74d22e25
Submodule
+1
Submodule lib/lib_keyboard added at b475480d8f
Reference in New Issue
Block a user