#![no_std] #![no_main] use core::panic::PanicInfo; #[unsafe(no_mangle)] pub extern "C" fn _start() -> ! { // 'k' print("kernel\n"); loop {} } fn print(s: &str) { let mut bytes = s.bytes(); while let Some(b) = bytes.next() { unsafe {core::arch::asm!( "out dx, al" , in("al") b )}; }; } #[panic_handler] fn panic(_: &PanicInfo) -> ! { print("panicked"); loop {} }