diff options
author | natrixaeria <upezu@student.kit.edu> | 2019-10-25 21:16:04 +0200 |
---|---|---|
committer | natrixaeria <upezu@student.kit.edu> | 2019-10-25 21:16:04 +0200 |
commit | a107c7acfc0e4dd34e55a3e43a9f48bda9644393 (patch) | |
tree | 4a4d04dc7dad3e9683dd9eef2802686885374f6e /kernel/src/vga_text.rs | |
parent | 9a21c47ff84eed1001acec3b492105cdc2d9220b (diff) |
Create a print function
Diffstat (limited to 'kernel/src/vga_text.rs')
-rw-r--r-- | kernel/src/vga_text.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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)} } |