Files
blog_os/src/bin/test-panic.rs
2019-01-25 13:45:38 +01:00

24 lines
413 B
Rust

#![cfg_attr(not(test), no_std)]
#![cfg_attr(not(test), no_main)]
#![cfg_attr(test, allow(unused_imports))]
use blog_os::{exit_qemu, serial_println};
use core::panic::PanicInfo;
#[cfg(not(test))]
#[no_mangle]
pub extern "C" fn _start() -> ! {
panic!();
}
#[cfg(not(test))]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
serial_println!("ok");
unsafe {
exit_qemu();
}
loop {}
}