Print Hello World! to screen

This commit is contained in:
Philipp Oppermann
2019-01-25 12:42:21 +01:00
parent fd08b1a123
commit f9ffee92c7

View File

@@ -3,8 +3,19 @@
use core::panic::PanicInfo; use core::panic::PanicInfo;
static HELLO: &[u8] = b"Hello World!";
#[no_mangle] #[no_mangle]
pub extern "C" fn _start() -> ! { pub extern "C" fn _start() -> ! {
let vga_buffer = 0xb8000 as *mut u8;
for (i, &byte) in HELLO.iter().enumerate() {
unsafe {
*vga_buffer.offset(i as isize * 2) = byte;
*vga_buffer.offset(i as isize * 2 + 1) = 0xb;
}
}
loop {} loop {}
} }