summaryrefslogtreecommitdiff
path: root/src/vga/buffer.rs
diff options
context:
space:
mode:
authorChristian Cunningham <c@localhost>2022-08-23 20:56:57 -0700
committerChristian Cunningham <c@localhost>2022-08-23 20:56:57 -0700
commite83717b454722b8c61844686377c2ac58f18454f (patch)
tree3f243026dd102ccc9117481e795e6d8e938fc39b /src/vga/buffer.rs
parent526abb3e5b3175008cb60f78b645d5e2c0f5072a (diff)
Migrate the processor-independent code
Due to the similarity with my ARM-based OS ghOSt, I am migrating similar code out to a common crate Not all has been moved out yet
Diffstat (limited to 'src/vga/buffer.rs')
-rw-r--r--src/vga/buffer.rs38
1 files changed, 3 insertions, 35 deletions
diff --git a/src/vga/buffer.rs b/src/vga/buffer.rs
index 1ae4ff8..2512123 100644
--- a/src/vga/buffer.rs
+++ b/src/vga/buffer.rs
@@ -86,36 +86,6 @@ impl VgaWriter {
}
}
-impl NullLock<VgaWriter> {
- #[allow(dead_code)]
- pub fn write_byte(&self, byte: u8) {
- self.lock(|writer| {
- writer.write_byte(byte);
- });
- }
-
- #[allow(dead_code)]
- fn new_line(&self) {
- self.lock(|writer| {
- writer.new_line();
- });
- }
-
- #[allow(dead_code)]
- fn clear_row(&self, row: usize) {
- self.lock(|writer| {
- writer.clear_row(row);
- });
- }
-
- #[allow(dead_code)]
- pub fn write_string(&self, s: &str) {
- self.lock(|writer| {
- writer.write_string(s);
- });
- }
-}
-
impl fmt::Write for VgaWriter {
fn write_str(&mut self, s: &str) -> fmt::Result {
self.write_string(s);
@@ -123,11 +93,9 @@ impl fmt::Write for VgaWriter {
}
}
-impl NullLock<VgaWriter> {
- pub fn init(&self) {
- self.lock(|writer| {
- writer.buffer = Some(unsafe { &mut *(0xb8000 as *mut Buffer) });
- })
+impl crate::sync::interface::Initializable for VgaWriter {
+ fn init(&mut self) {
+ self.buffer = Some(unsafe { &mut *(0xb8000 as *mut Buffer) });
}
}