Created
August 4, 2018 20:29
-
-
Save itto-ki/eff30cbbebb05721dc283331e2052400 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(panic_implementation)] | |
#![no_std] | |
use core::panic::PanicInfo; | |
#[panic_implementation] | |
#[no_mangle] | |
pub extern "C" fn panic(_info: &PanicInfo) -> ! { | |
loop {} | |
} | |
#[no_mangle] | |
pub extern fn kernel_main() -> ! { | |
let vga_buffer = 0xb8000 as *mut u8; | |
let hello: &[u8] = b"SawayakanaAsa"; | |
for (i, &byte) in hello.iter().enumerate() { | |
unsafe { | |
*vga_buffer.offset(i as isize * 2) = byte; | |
*vga_buffer.offset(i as isize * 2 + 1) = 0x0b; | |
} | |
} | |
loop {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment