diff --git a/src/lib.rs b/src/lib.rs index a8e4050..4d4f55b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,8 @@ #![no_std] #![no_main] -mod vga; mod serial; +mod vga; use core::panic::PanicInfo; use vga::Color; @@ -15,8 +15,7 @@ fn panic_handler(info: &PanicInfo) -> ! { #[no_mangle] pub extern "C" fn julios_main() -> ! { - println!("Hello World!"); - println!("{}", "***JuliOS***"); - serial_println!("Test serial"); + println!("***JuliOS***"); + serial_println!("Hello serial"); panic!("Kernel end of flow"); } diff --git a/src/serial.rs b/src/serial.rs index cd9d7c3..68dc509 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -1,6 +1,6 @@ use core::fmt; -use spin::Mutex; use lazy_static::lazy_static; +use spin::Mutex; use x86_64::instructions::port::Port; const COM1: u16 = 0x3f8; @@ -22,7 +22,10 @@ lazy_static! { #[doc(hidden)] pub fn _print(args: ::core::fmt::Arguments) { use core::fmt::Write; - SERIAL1.lock().write_fmt(args).expect("Printing to serial failed"); + SERIAL1 + .lock() + .write_fmt(args) + .expect("Printing to serial failed"); } /// Prints to the host through the serial interface. @@ -49,7 +52,7 @@ pub struct SerialPort { impl SerialPort { pub fn new(port: u16) -> SerialPort { SerialPort { - base: Port::new(port) + base: Port::new(port), } } @@ -65,8 +68,7 @@ impl SerialPort { } } - fn init(&mut self) { - } + fn init(&mut self) {} } impl fmt::Write for SerialPort {