Skip to content

Commit

Permalink
Move app_io crate to the kernel/ (theseus-os#480)
Browse files Browse the repository at this point in the history
Necessary for future usage by in-kernel WASM components, e.g., theseus-os#472
  • Loading branch information
kevinaboos authored and vikrammullick committed Jan 12, 2022
1 parent 9525aca commit a3ede4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions 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 a3ede4f

Please sign in to comment.