diff --git a/byteos.bin b/byteos.bin index ebb72258d2c591e065b574305e648752e7c5d0b8..f4ff6284142cf799883ed730b39e5d1dc3d5115e 100644 Binary files a/byteos.bin and b/byteos.bin differ diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 762eb001a0b18fcd9f5a99312c06d2dd8288136c..1517668dc35b3dcbfae3e71747da069fc2960cc0 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -17,12 +17,27 @@ use hal; use kalloc; use panic_handler as _; + +fn clear_bss() { + extern "C" { + fn sbss(); + fn ebss(); + } + unsafe { + core::slice::from_raw_parts_mut(sbss as usize as *mut u8, ebss as usize - sbss as usize) + .fill(0); + } +} + + #[no_mangle] fn main(hart_id: usize, device_tree: usize) { if hart_id != 0 { loop {} } + clear_bss(); + let str = include_str!("banner.txt"); println!("{}", str); @@ -48,7 +63,7 @@ fn main(hart_id: usize, device_tree: usize) { devices::prepare_devices(); // initialize filesystem - fs::init(); + // fs::init(); // init kernel threads and async executor tasks::init(); diff --git a/kernel/src/tasks/initproc.rs b/kernel/src/tasks/initproc.rs index c413dd68b2a51db8325a77e96d840bf33f783c98..ad72a9bfc01dea33bd18055ae0bd006111cbf64b 100644 --- a/kernel/src/tasks/initproc.rs +++ b/kernel/src/tasks/initproc.rs @@ -227,10 +227,10 @@ pub async fn initproc() { // command("busybox sh").await; // command("busybox sh busybox_testcode.sh").await; - run_libc_test().await; + // run_libc_test().await; // run_all().await; - // simple_shell().await; + simple_shell().await; // command("helloworld").await; // command("filelist").await; }