|
|
|
@ -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")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|