Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move app_io to the kernel/ #480

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/cat/Cargo.toml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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