You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
399 B
Rust
25 lines
399 B
Rust
#![no_std]
|
|
#![no_main]
|
|
|
|
use core::arch::asm;
|
|
use core::panic::PanicInfo;
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn main() -> ! {
|
|
panic!();
|
|
}
|
|
|
|
#[panic_handler]
|
|
fn panic(_info: &PanicInfo) -> ! {
|
|
unsafe {
|
|
asm!(
|
|
"1: cli",
|
|
" hlt",
|
|
" jmp 1b", // NMI may resume the CPU or something, idk
|
|
options(att_syntax)
|
|
);
|
|
}
|
|
|
|
unreachable!()
|
|
}
|