mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
30 lines
516 B
Rust
30 lines
516 B
Rust
#![feature(panic_implementation)]
|
|
#![feature(const_fn)]
|
|
#![no_std]
|
|
#![cfg_attr(not(test), no_main)]
|
|
#![cfg_attr(test, allow(dead_code, unused_macros, unused_imports))]
|
|
|
|
#[macro_use]
|
|
extern crate blog_os;
|
|
|
|
use blog_os::exit_qemu;
|
|
use core::panic::PanicInfo;
|
|
|
|
#[cfg(not(test))]
|
|
#[no_mangle]
|
|
pub extern "C" fn _start() -> ! {
|
|
panic!();
|
|
}
|
|
|
|
#[cfg(not(test))]
|
|
#[panic_implementation]
|
|
#[no_mangle]
|
|
pub fn panic(_info: &PanicInfo) -> ! {
|
|
serial_println!("ok");
|
|
|
|
unsafe {
|
|
exit_qemu();
|
|
}
|
|
loop {}
|
|
}
|