Test the vga buffer module through a print_something function

This commit is contained in:
Philipp Oppermann
2019-01-25 12:26:05 +01:00
parent 27f2c4c2ff
commit d71e6a7cb6
2 changed files with 13 additions and 10 deletions

View File

@@ -3,20 +3,11 @@
use core::panic::PanicInfo;
static HELLO: &[u8] = b"Hello World!";
mod vga_buffer;
#[no_mangle]
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;
}
}
vga_buffer::print_something();
loop {}
}