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]
fn on_panic(info: &PanicInfo) -> ! {
// print panic info and hang
println!("{}", info);
#[no_mangle]
extern "C" fn eh_personality() {}
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