mirror of https://github.com/vinc/moros.git
Improve setup process (#596)
* Use error and warning for late boot messages * Remove diskless mode message * Add option to install system in memory
This commit is contained in:
parent
f29b7b1f9f
commit
4922b2efa8
|
@ -5,7 +5,9 @@ extern crate alloc;
|
|||
|
||||
use bootloader::{entry_point, BootInfo};
|
||||
use core::panic::PanicInfo;
|
||||
use moros::{debug, hlt_loop, print, println, sys, usr};
|
||||
use moros::{
|
||||
debug, error, warning, hlt_loop, eprint, eprintln, print, println, sys, usr
|
||||
};
|
||||
|
||||
entry_point!(main);
|
||||
|
||||
|
@ -30,11 +32,10 @@ fn user_boot() {
|
|||
usr::shell::main(&["shell", script]).ok();
|
||||
} else {
|
||||
if sys::fs::is_mounted() {
|
||||
println!("Could not find '{}'", script);
|
||||
error!("Could not find '{}'", script);
|
||||
} else {
|
||||
println!("MFS not found, run 'install' to setup the system");
|
||||
warning!("MFS not found, run 'install' to setup the system");
|
||||
}
|
||||
println!("Running console in diskless mode");
|
||||
usr::shell::main(&["shell"]).ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -299,12 +299,17 @@ pub fn main(args: &[&str]) -> Result<(), ExitCode> {
|
|||
if !sys::fs::is_mounted() {
|
||||
println!("{}Listing disks ...{}", csi_color, csi_reset);
|
||||
usr::shell::exec("disk list").ok();
|
||||
println!("/dev/mem RAM DISK");
|
||||
println!();
|
||||
|
||||
println!("{}Formatting disk ...{}", csi_color, csi_reset);
|
||||
print!("Enter path of disk to format: ");
|
||||
let pathname = io::stdin().read_line();
|
||||
usr::shell::exec(&format!("disk format {}", pathname.trim_end()))?;
|
||||
let path = io::stdin().read_line();
|
||||
if path.trim_end() == "/dev/mem" {
|
||||
usr::shell::exec(&format!("memory format"))?;
|
||||
} else {
|
||||
usr::shell::exec(&format!("disk format {}", path.trim_end()))?;
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue