From a107c7acfc0e4dd34e55a3e43a9f48bda9644393 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Fri, 25 Oct 2019 21:16:04 +0200 Subject: Create a print function --- kernel/src/vga_text.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kernel/src/vga_text.rs') diff --git a/kernel/src/vga_text.rs b/kernel/src/vga_text.rs index ef488e9..5298da7 100644 --- a/kernel/src/vga_text.rs +++ b/kernel/src/vga_text.rs @@ -35,10 +35,11 @@ impl CharState { } } +#[no_mangle] #[derive(Clone, Copy)] pub struct VgaChar { + pub byte: u8, pub state: CharState, - pub byte: u8 } impl VgaChar { @@ -57,7 +58,7 @@ impl OStream { pub fn new() -> Self { Self { pos: (0, 0), - cursor: 0xb8000 as *mut VgaChar, + cursor: Self::at(0), state: CharState::from_colors(Color::White, Color::Black) } } @@ -85,7 +86,7 @@ impl OStream { self.compute_cursor() } - fn set_char(&mut self, c: VgaChar) { + pub fn set_char(&mut self, c: VgaChar) { unsafe {self.cursor.write_volatile(c)} } -- cgit v1.2.3-54-g00ecf