From 2e094d08bc2f3f14def1e792589ba5bea0b3a87a Mon Sep 17 00:00:00 2001 From: equation314 Date: Mon, 29 Oct 2018 13:41:25 +0800 Subject: [PATCH] common: add a logo --- kernel/src/arch/aarch64/mod.rs | 2 ++ kernel/src/fs.rs | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/kernel/src/arch/aarch64/mod.rs b/kernel/src/arch/aarch64/mod.rs index 0dfddc3..ac14adb 100644 --- a/kernel/src/arch/aarch64/mod.rs +++ b/kernel/src/arch/aarch64/mod.rs @@ -19,6 +19,8 @@ pub extern "C" fn rust_main() -> ! { // First init log mod, so that we can print log info. ::logging::init(); + super::fs::show_logo(); + loop { print!(">> "); loop { diff --git a/kernel/src/fs.rs b/kernel/src/fs.rs index 4dcaa14..d682236 100644 --- a/kernel/src/fs.rs +++ b/kernel/src/fs.rs @@ -14,7 +14,21 @@ _binary_user_riscv_img_start: _binary_user_riscv_img_end: "#); +const LOGO: &str = r#" + ____ __ ____ _____ + / __ \ __ __ _____ / /_ / __ \/ ___/ + / /_/ // / / // ___// __// / / /\__ \ + / _, _// /_/ /(__ )/ /_ / /_/ /___/ / +/_/ |_| \__,_//____/ \__/ \____//____/ +"#; + +pub fn show_logo() { + println!("{}", LOGO); +} + pub fn shell() { + show_logo(); + #[cfg(target_arch = "riscv32")] let device = { extern { @@ -97,4 +111,4 @@ impl BlockedDevice for &'static ide::DISK1 { let buf = unsafe { slice::from_raw_parts(buf.as_ptr() as *mut u32, ide::BLOCK_SIZE / 4) }; self.0.lock().write(block_id as u64, 1, buf).is_ok() } -} \ No newline at end of file +}