Add a print_something function to print an H in the lower left

This commit is contained in:
Philipp Oppermann
2017-04-12 19:21:54 +02:00
parent 46d47f8d2e
commit 6aa3f67331
2 changed files with 11 additions and 11 deletions

View File

@@ -11,17 +11,7 @@ mod vga_buffer;
pub extern fn rust_main() {
// ATTENTION: we have a very small stack and no guard page
let hello = b"Hello World!";
let color_byte = 0x1f; // white foreground, blue background
let mut hello_colored = [color_byte; 24];
for (i, char_byte) in hello.into_iter().enumerate() {
hello_colored[i*2] = *char_byte;
}
// write `Hello World!` to the center of the VGA text buffer
let buffer_ptr = (0xb8000 + 1988) as *mut _;
unsafe { *buffer_ptr = hello_colored };
vga_buffer::print_something();
loop{}
}