From abe0c17661cdecf40ded564d2ef471e073a31f8a Mon Sep 17 00:00:00 2001 From: zhangxinyu <840317537@qq.com> Date: Fri, 9 Jun 2023 10:37:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch5/os/src/main.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ch5/os/src/main.rs b/ch5/os/src/main.rs index d54541f..2b608c6 100644 --- a/ch5/os/src/main.rs +++ b/ch5/os/src/main.rs @@ -23,6 +23,22 @@ pub mod mm; #[path = "boards/qemu.rs"] mod board; +static OS_LOGO:&'static str = r#" + + ___ ___ ___ + / /\ __ / /\ / /\ + / /::| | |\ / /::\ / /::\ + / /:|:| | |:| / /:/\:\ /__/:/\:\ + / /:/|:|__ | |:| / /:/ \:\ _\_ \:\ \:\ + /__/:/_|::::\ |__|:|__ /__/:/ \__\:\ /__/\ \:\ \:\ + \__\/ /~~/:/ / /::::\ \ \:\ / /:/ \ \:\ \:\_\/ + / /:/ / /:/~~~~ \ \:\ /:/ \ \:\_\:\ + / /:/ /__/:/ \ \:\/:/ \ \:\/:/ + /__/:/ \__\/ \ \::/ \ \::/ + \__\/ \__\/ \__\/ + +"#; + // 汇编脚本引入, 调整内核的内存布局之后, 会跳入到 rust_main中执行 @@ -55,10 +71,11 @@ pub fn rust_main(){ trap::init(); trap::enable_timer_interrupt(); // 允许定时器中断 timer::set_next_trigger(); // 在进入用户态之前, 设置一个时钟中断, 防止第一个用户任务死循环 - loader::list_apps(); task::add_initproc(); - task::run_tasks(); + println!("{}", OS_LOGO); + loader::list_apps(); + task::run_tasks(); panic!("Disable run here") }