Add first user program hello_world.rs

This commit is contained in:
Yifan Wu 2020-11-18 14:48:13 +08:00
parent c701cd00ce
commit db0c174f52
79 changed files with 343 additions and 0 deletions

10
user/src/lang_items.rs Normal file
View file

@ -0,0 +1,10 @@
#[panic_handler]
fn panic_handler(panic_info: &core::panic::PanicInfo) -> ! {
let err = panic_info.message().unwrap();
if let Some(location) = panic_info.location() {
println!("Panicked at {}:{}, {}", location.file(), location.line(), err);
} else {
println!("Panicked: {}", err);
}
loop {}
}