Add print! and println! macros and a clear_screen function

This commit is contained in:
Philipp Oppermann
2017-04-12 19:35:08 +02:00
parent 40aed4fa0f
commit 59b8133396
2 changed files with 22 additions and 4 deletions

View File

@@ -8,16 +8,15 @@ extern crate rlibc;
extern crate volatile;
extern crate spin;
#[macro_use]
mod vga_buffer;
#[no_mangle]
pub extern fn rust_main() {
// ATTENTION: we have a very small stack and no guard page
use core::fmt::Write;
vga_buffer::WRITER.lock().write_str("Hello again");
write!(vga_buffer::WRITER.lock(), ", some numbers: {} {}", 42, 1.337);
vga_buffer::clear_screen();
println!("Hello World{}", "!");
loop{}
}