I would like to know how to input text, process it, and output the result. Here is an attempt I made, but it doesn't seem to work correctly:
use std::io;
[cfg(target_os = "hermit")]
use hermit as _;
fn main() {
let mut input = String::new();
// Reads the input from STDIN and places it in the String named input.
println!("Enter a value:");
io::stdin().read_line(&mut input).expect("Failed to read line");
print!("'{}'", input);
}
Printing is straightforward, but I'm having trouble with inputting text from the keyboard in the QEMU shell. Could you please guide me on how to do this correctly?
Thank you for your help!
P.S. This is a question, and I apologize if this is not the right place to ask.
Error Message: [0][WARN] Unable to read entropy! Fallback to a naive implementation! Enter a value: thread 'main' panicked at src/main.rs:11:39: Failed to read line: Kind(Uncategorized) note: run withRUST_BACKTRACE=1` environment variable to display a backtrace
Number of interrupts
[0][INFO] shutting down with code -1
hello_hermit on master [?] is 📦 v0.1.0 via 🦀 v1.83.0-nightly
❯
`
Without the input code it works verry well.
Hello,
I would like to know how to input text, process it, and output the result. Here is an attempt I made, but it doesn't seem to work correctly:
use std::io;
[cfg(target_os = "hermit")]
use hermit as _;
fn main() { let mut input = String::new();
} Printing is straightforward, but I'm having trouble with inputting text from the keyboard in the QEMU shell. Could you please guide me on how to do this correctly?
Thank you for your help!
P.S. This is a question, and I apologize if this is not the right place to ask. Error Message:
[0][WARN] Unable to read entropy! Fallback to a naive implementation! Enter a value: thread 'main' panicked at src/main.rs:11:39: Failed to read line: Kind(Uncategorized) note: run with
RUST_BACKTRACE=1` environment variable to display a backtrace Number of interrupts[0][INFO] shutting down with code -1
hello_hermit on master [?] is 📦 v0.1.0 via 🦀 v1.83.0-nightly ❯ ` Without the input code it works verry well.