Add a comment
This commit is contained in:
parent
ef07d172ff
commit
aaf64d0a2d
|
@ -73,8 +73,10 @@ extern "C" fn start() -> ! {
|
||||||
unsafe { uart::init_console(0x1000_0000) };
|
unsafe { uart::init_console(0x1000_0000) };
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
|
|
||||||
|
// print current hartid
|
||||||
println!("hartid: {}", riscv::register::mhartid::read());
|
println!("hartid: {}", riscv::register::mhartid::read());
|
||||||
|
|
||||||
|
// poll console for input and print characters back
|
||||||
loop {
|
loop {
|
||||||
let c = uart::CONSOLE.lock().as_mut().and_then(uart::Device::get);
|
let c = uart::CONSOLE.lock().as_mut().and_then(uart::Device::get);
|
||||||
if let Some(c) = c {
|
if let Some(c) = c {
|
||||||
|
@ -85,6 +87,7 @@ extern "C" fn start() -> ! {
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
fn on_panic(info: &PanicInfo) -> ! {
|
fn on_panic(info: &PanicInfo) -> ! {
|
||||||
|
// print panic info and hang
|
||||||
println!("{}", info);
|
println!("{}", info);
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
|
|
Loading…
Reference in a new issue