Add abort & update panic handler

This commit is contained in:
gil 2024-05-16 11:38:01 -05:00
parent c70be3fe1f
commit 6b697a4ca5

View file

@ -96,12 +96,24 @@ extern "C" fn start() -> ! {
} }
} }
#[panic_handler] #[no_mangle]
fn on_panic(info: &PanicInfo) -> ! { extern "C" fn eh_personality() {}
// print panic info and hang
println!("{}", info);
loop {} #[panic_handler]
fn panic(info: &PanicInfo) -> ! {
// print panic info and abort
println!("{}", info);
abort();
}
#[no_mangle]
extern "C" fn abort() -> ! {
use core::arch::asm;
loop {
unsafe {
asm!("wfi");
}
}
} }
// TODO unit testing // TODO unit testing