fix wrong module name in test
This commit is contained in:
parent
7f80df621d
commit
984a8259b2
|
@ -90,6 +90,28 @@ version = "1.0.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "component"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"component-macro",
|
||||
"inventory",
|
||||
"json",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "component-macro"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"json",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "controlled"
|
||||
version = "0.1.0"
|
||||
|
@ -103,6 +125,15 @@ dependencies = [
|
|||
name = "cpio-decoder"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "0.1.25"
|
||||
source = "git+https://github.com/sdww0/rust-ctor#a6ee5e7a69cb368f00e7df00108028635fdf3fbd"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.8.0"
|
||||
|
@ -115,6 +146,23 @@ version = "0.2.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e63201c624b8c8883921b1a1accc8916c4fa9dbfb15d122b26e4dde945b86bbf"
|
||||
|
||||
[[package]]
|
||||
name = "ghost"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41973d4c45f7a35af8753ba3457cc99d406d863941fd7f52663cff54a5ab99b3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.13.1"
|
||||
|
@ -124,6 +172,16 @@ dependencies = [
|
|||
"ahash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"hashbrown 0.12.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "intrusive-collections"
|
||||
version = "0.9.5"
|
||||
|
@ -133,6 +191,15 @@ dependencies = [
|
|||
"memoffset",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inventory"
|
||||
version = "0.3.3"
|
||||
source = "git+https://github.com/sdww0/inventory#6356dc79fb15ae4e72ddb6fe826a3ea76d9046a5"
|
||||
dependencies = [
|
||||
"ctor",
|
||||
"ghost",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.5"
|
||||
|
@ -147,10 +214,28 @@ name = "jinux"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bootloader",
|
||||
"component",
|
||||
"jinux-frame",
|
||||
"jinux-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinux-block"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"component",
|
||||
"jinux-frame",
|
||||
"jinux-pci",
|
||||
"jinux-util",
|
||||
"jinux-virtio",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"pod",
|
||||
"pod-derive",
|
||||
"spin 0.9.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinux-boot"
|
||||
version = "0.1.0"
|
||||
|
@ -173,6 +258,7 @@ dependencies = [
|
|||
"intrusive-collections",
|
||||
"lazy_static",
|
||||
"linked_list_allocator",
|
||||
"log",
|
||||
"pod",
|
||||
"pod-derive",
|
||||
"spin 0.9.4",
|
||||
|
@ -181,14 +267,34 @@ dependencies = [
|
|||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinux-input"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"component",
|
||||
"jinux-frame",
|
||||
"jinux-pci",
|
||||
"jinux-util",
|
||||
"jinux-virtio",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"pod",
|
||||
"pod-derive",
|
||||
"spin 0.9.4",
|
||||
"virtio-input-decoder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinux-pci"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"component",
|
||||
"jinux-frame",
|
||||
"jinux-util",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"pod",
|
||||
"pod-derive",
|
||||
"spin 0.9.4",
|
||||
|
@ -211,12 +317,13 @@ dependencies = [
|
|||
"bitflags",
|
||||
"controlled",
|
||||
"intrusive-collections",
|
||||
"jinux-block",
|
||||
"jinux-frame",
|
||||
"jinux-pci",
|
||||
"jinux-input",
|
||||
"jinux-rights-proc",
|
||||
"jinux-util",
|
||||
"jinux-virtio",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"lru",
|
||||
"pod",
|
||||
"pod-derive",
|
||||
|
@ -243,9 +350,11 @@ name = "jinux-virtio"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"component",
|
||||
"jinux-frame",
|
||||
"jinux-pci",
|
||||
"jinux-util",
|
||||
"log",
|
||||
"pod",
|
||||
"pod-derive",
|
||||
"spin 0.9.4",
|
||||
|
@ -315,9 +424,15 @@ version = "0.9.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17"
|
||||
dependencies = [
|
||||
"hashbrown",
|
||||
"hashbrown 0.13.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
version = "0.8.0"
|
||||
|
@ -401,6 +516,21 @@ version = "1.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.152"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
|
||||
|
||||
[[package]]
|
||||
name = "serde_spanned"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spin"
|
||||
version = "0.5.2"
|
||||
|
@ -433,9 +563,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.103"
|
||||
version = "1.0.109"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
|
||||
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -462,6 +592,40 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"toml_edit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_datetime"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.19.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typeflags"
|
||||
version = "0.1.0"
|
||||
|
@ -547,6 +711,15 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "faf09497b8f8b5ac5d3bb4d05c0a99be20f26fd3d5f2db7b0716e946d5103658"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x86_64"
|
||||
version = "0.14.10"
|
||||
|
|
|
@ -26,7 +26,7 @@ lazy_static! {
|
|||
irq.get().on_active(handle_serial_input);
|
||||
irq
|
||||
};
|
||||
pub static ref SERIAL_INPUT_CALLBACKS: Mutex<Vec<Arc<dyn Fn(u8) + Send + Sync + 'static>>> =
|
||||
static ref SERIAL_INPUT_CALLBACKS: Mutex<Vec<Arc<dyn Fn(u8) + Send + Sync + 'static>>> =
|
||||
Mutex::new(Vec::new());
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,10 @@ pub(crate) fn init() {
|
|||
out8(SERIAL_INT_EN, 0x01);
|
||||
}
|
||||
|
||||
pub fn register_serial_input_callback(f: impl Fn(u8) + Send + Sync + 'static) {
|
||||
SERIAL_INPUT_CALLBACKS.lock().push(Arc::new(f));
|
||||
}
|
||||
|
||||
pub(crate) fn register_serial_input_irq_handler<F>(callback: F)
|
||||
where
|
||||
F: Fn(&TrapFrame) + Sync + Send + 'static,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use jinux_frame::device::serial::SERIAL_INPUT_CALLBACKS;
|
||||
pub use jinux_frame::device::serial::register_serial_input_callback;
|
||||
|
||||
use crate::{
|
||||
prelude::*,
|
||||
|
@ -74,7 +74,5 @@ fn get_tty_driver() -> &'static TtyDriver {
|
|||
}
|
||||
|
||||
pub fn init() {
|
||||
SERIAL_INPUT_CALLBACKS
|
||||
.lock()
|
||||
.push(Arc::new(serial_input_callback));
|
||||
register_serial_input_callback(serial_input_callback);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ entry_point!(kernel_test_main);
|
|||
|
||||
fn kernel_test_main(boot_info: &'static mut BootInfo) -> ! {
|
||||
jinux_frame::init(boot_info);
|
||||
jinux_std::driver::console::init();
|
||||
jinux_std::driver::tty::init();
|
||||
test_main();
|
||||
loop {}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ fn panic(info: &PanicInfo) -> ! {
|
|||
fn test_input() {
|
||||
jinux_frame::enable_interrupts();
|
||||
println!("please input value into console to pass this test");
|
||||
jinux_std::driver::console::register_serial_input_callback(Arc::new(input_callback));
|
||||
jinux_std::driver::tty::register_serial_input_callback(input_callback);
|
||||
unsafe {
|
||||
while INPUT_VALUE == 0 {
|
||||
jinux_frame::hlt();
|
||||
|
|
Loading…
Reference in New Issue