diff --git a/applications/cat/Cargo.toml b/applications/cat/Cargo.toml index f28bea3ae..726ec66bf 100644 --- a/applications/cat/Cargo.toml +++ b/applications/cat/Cargo.toml @@ -14,7 +14,7 @@ version = "0.4.8" [dependencies.app_io] -path = "../app_io" +path = "../../kernel/app_io" [dependencies.task] path = "../../kernel/task" diff --git a/applications/immediate_input_echo/Cargo.toml b/applications/immediate_input_echo/Cargo.toml index 078a30599..92f02a92d 100644 --- a/applications/immediate_input_echo/Cargo.toml +++ b/applications/immediate_input_echo/Cargo.toml @@ -11,7 +11,7 @@ core2 = { version = "0.3.2", default-features = false, features = ["alloc", "nig path = "../../libs/stdio" [dependencies.app_io] -path = "../app_io" +path = "../../kernel/app_io" [dependencies.log] version = "0.4.8" diff --git a/applications/input_echo/Cargo.toml b/applications/input_echo/Cargo.toml index 9d9bdb659..e215d2e82 100644 --- a/applications/input_echo/Cargo.toml +++ b/applications/input_echo/Cargo.toml @@ -8,7 +8,7 @@ build = "../../build.rs" core2 = { version = "0.3.2", default-features = false, features = ["alloc", "nightly"] } [dependencies.app_io] -path = "../app_io" +path = "../../kernel/app_io" [dependencies.log] version = "0.4.8" diff --git a/applications/keyboard_echo/Cargo.toml b/applications/keyboard_echo/Cargo.toml index d5beb0a48..4eee12707 100644 --- a/applications/keyboard_echo/Cargo.toml +++ b/applications/keyboard_echo/Cargo.toml @@ -11,7 +11,7 @@ core2 = { version = "0.3.2", default-features = false, features = ["alloc", "nig path = "../../kernel/scheduler" [dependencies.app_io] -path = "../app_io" +path = "../../kernel/app_io" [dependencies.log] version = "0.4.8" diff --git a/applications/less/Cargo.toml b/applications/less/Cargo.toml index 759aaa635..1dbfd337c 100644 --- a/applications/less/Cargo.toml +++ b/applications/less/Cargo.toml @@ -25,7 +25,7 @@ path = "../../libs/keycodes_ascii" path = "../../kernel/libterm" [dependencies.app_io] -path = "../app_io" +path = "../../kernel/app_io" [dependencies.stdio] path = "../../libs/stdio" diff --git a/applications/shell/Cargo.toml b/applications/shell/Cargo.toml index b521556ed..04b30b96d 100644 --- a/applications/shell/Cargo.toml +++ b/applications/shell/Cargo.toml @@ -65,7 +65,7 @@ features = ["spin_no_std"] version = "1.4.0" [dependencies.app_io] -path = "../app_io" +path = "../../kernel/app_io" [dependencies.fs_node] path = "../../kernel/fs_node" diff --git a/applications/app_io/Cargo.toml b/kernel/app_io/Cargo.toml similarity index 100% rename from applications/app_io/Cargo.toml rename to kernel/app_io/Cargo.toml diff --git a/applications/app_io/src/lib.rs b/kernel/app_io/src/lib.rs similarity index 94% rename from applications/app_io/src/lib.rs rename to kernel/app_io/src/lib.rs index 8f4f15c63..4bf032223 100644 --- a/applications/app_io/src/lib.rs +++ b/kernel/app_io/src/lib.rs @@ -1,16 +1,17 @@ -//! This crate is an application-level library that stores the IO queues and pointers to terminal instances for running applications. -//! It provides some APIs similar to std::io for applications to access those queues. +//! A simple library that handles stdio queues for applications running in terminal instances. +//! +//! This provides some APIs similar to Rust's `std::io` for applications to access those queues. //! //! Usage example: -//! 1. shell spawns a new app, and creates queues of `stdin`, `stdout` and `stderr` -//! 2. shell stores the reader of `stdin` and writer of `stdout` and `stderr` to `app_io`, -//! along with the reader of key event queue and the pointer to the running terminal instance. -//! 3. app calls app_io::stdin to get the reader of `stdin`, and can perform reading just like +//! 1. shell spawns a new app, and creates queues of `stdin`, `stdout`, and `stderr` for that app. +//! 2. shell stores the reader for `stdin` and writers for `stdout` and `stderr` to `app_io`, +//! along with the reader of the key events queue and references to the running terminal instance. +//! 3. app calls [`stdin()`] to get the reader of `stdin`, and can perform reading just like //! using the standard library -//! 4. app calls app_io::stdout to get the writer of `stdin`, and can perform output just like +//! 4. app calls [`stdout()`] to get the writer of `stdin`, and can perform output just like //! using the standard library -//! 5. after app exits, shell would set EOF flags to its `stdin`, `stdout` and `stderr` queues. -//! 6. if all apps in a job exit, app shell removes all the structure stored in `app_io` and +//! 5. after app exits, shell would set `EOF` flags to its `stdin`, `stdout`, and `stderr` queues. +//! 6. once all apps in a job exit, app shell removes all the structure stored in `app_io` and //! destructs all stdio queues #![no_std] diff --git a/tlibc/Cargo.toml b/tlibc/Cargo.toml index 6d1af392c..d6a4de6ea 100644 --- a/tlibc/Cargo.toml +++ b/tlibc/Cargo.toml @@ -25,7 +25,7 @@ path = "../kernel/memory" path = "../kernel/task" [dependencies.app_io] -path = "../applications/app_io" +path = "../kernel/app_io" ## Needed for building tlibc as a "staticlib" crate-type,