Skip to content

Commit

Permalink
Move app_io crate to the kernel/ (#480)
Browse files Browse the repository at this point in the history
Necessary for future usage by in-kernel WASM components, e.g., #472
  • Loading branch information
kevinaboos committed Jan 12, 2022
1 parent 05f1213 commit 9115bb0
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion applications/cat/Cargo.toml
Expand Up @@ -14,7 +14,7 @@ version = "0.4.8"


[dependencies.app_io]
path = "../app_io"
path = "../../kernel/app_io"

[dependencies.task]
path = "../../kernel/task"
Expand Down
2 changes: 1 addition & 1 deletion applications/immediate_input_echo/Cargo.toml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion applications/input_echo/Cargo.toml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion applications/keyboard_echo/Cargo.toml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion applications/less/Cargo.toml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion applications/shell/Cargo.toml
Expand Up @@ -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"
Expand Down
File renamed without changes.
19 changes: 10 additions & 9 deletions applications/app_io/src/lib.rs → 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]
Expand Down
2 changes: 1 addition & 1 deletion tlibc/Cargo.toml
Expand Up @@ -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,
Expand Down

0 comments on commit 9115bb0

Please sign in to comment.