Add println!
This commit is contained in:
parent
bf576f23f1
commit
6bf87c3737
11
src/main.rs
11
src/main.rs
|
@ -11,10 +11,13 @@ fn panic(_info: &PanicInfo) -> ! {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
use core::fmt::Write;
|
||||
vga_buffer::WRITER.lock().write_str("Hello there\n").unwrap();
|
||||
writeln!(vga_buffer::WRITER.lock(), "General Kenobi").unwrap();
|
||||
pub extern "C" fn _start() {
|
||||
println!("Hello there{}", "!");
|
||||
println!();
|
||||
println!("General Kenobi!");
|
||||
println!();
|
||||
println!("You are a bold one");
|
||||
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
|
|
@ -128,3 +128,19 @@ lazy_static! {
|
|||
});
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => ($crate::vga_buffer::_print(format_args!($($arg)*)));
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! println {
|
||||
() => ($crate::print!("\n"));
|
||||
($($arg:tt)*) => ($crate::print!("{}\n", format_args!($($arg)*)));
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub fn _print(args: fmt::Arguments) {
|
||||
use core::fmt::Write;
|
||||
WRITER.lock().write_fmt(args).unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue