3966e697da
- reorganised the entire project so that the entire kernel is a single codebase rather than a kernel and a libk.
50 lines
2.0 KiB
Rust
50 lines
2.0 KiB
Rust
// use x86_64::registers::rflags::read;
|
|
|
|
use crate::arch::x86_64::drivers::ascii::clear_screen;
|
|
use crate::prelude::*;
|
|
use crate::std::application::Application;
|
|
use crate::std::io::stdin::read_line;
|
|
use crate::util::editor::Editor;
|
|
use alloc::vec::Vec;
|
|
|
|
static FETCH: &str = "
|
|
$$$$$$$$\\ $$\\
|
|
$$ _____| $$ |
|
|
$$ | $$$$$$\\ $$\\ $$\\ $$$$$$$\\ $$$$$$$ | $$$$$$\\ $$\\ $$\\
|
|
$$$$$\\ $$ __$$\\ $$ | $$ |$$ __$$\\ $$ __$$ |$$ __$$\\ $$ | $$ |
|
|
$$ __|$$ / $$ |$$ | $$ |$$ | $$ |$$ / $$ |$$ | \\__|$$ | $$ |
|
|
$$ | $$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ | $$ |
|
|
$$ | \\$$$$$$ |\\$$$$$$ |$$ | $$ |\\$$$$$$$ |$$ | \\$$$$$$$ |
|
|
\\__| \\______/ \\______/ \\__| \\__| \\_______|\\__| \\____$$ |
|
|
$$$$$$\\ $$$$$$\\ $$\\ $$\\ $$\\ $$\\ $$ |
|
|
$$ __$$\\ $$ __$$\\ $$ | $$ |$$$$ | \\$$$$$$ |
|
|
$$ / $$ |$$ / \\__| $$ | $$ |\\_$$ | \\______/
|
|
$$ | $$ |\\$$$$$$\\ \\$$\\ $$ | $$ |
|
|
$$ | $$ | \\____$$\\ \\$$\\$$ / $$ |
|
|
$$ | $$ |$$\\ $$ | \\$$$ / $$ |
|
|
$$$$$$ |\\$$$$$$ | \\$ / $$$$$$\\
|
|
\\______/ \\______/ \\_/ \\______|
|
|
";
|
|
|
|
pub async fn shell() {
|
|
println!("{}", FETCH);
|
|
|
|
loop {
|
|
print!(" Shell> ");
|
|
let line = read_line().await;
|
|
match line.as_str() {
|
|
"fetch" => {
|
|
println!("{}", FETCH);
|
|
}
|
|
"editor" => {
|
|
let mut editor = Editor::new();
|
|
editor.run(Vec::new()).await.unwrap();
|
|
}
|
|
"clear" => clear_screen(),
|
|
_ => {
|
|
println!("Unknown command: {}", line);
|
|
}
|
|
}
|
|
}
|
|
}
|