summaryrefslogtreecommitdiff
path: root/kernel/src/io/vga_text.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/io/vga_text.rs')
-rw-r--r--kernel/src/io/vga_text.rs22
1 files changed, 4 insertions, 18 deletions
diff --git a/kernel/src/io/vga_text.rs b/kernel/src/io/vga_text.rs
index 890defb..e44d341 100644
--- a/kernel/src/io/vga_text.rs
+++ b/kernel/src/io/vga_text.rs
@@ -167,18 +167,12 @@ impl<'a> VgaTerminalControllerLock<'a> {
core::intrinsics::volatile_copy_memory(
self.start(),
self.start().offset(offset as isize),
- (self.area() - offset) * core::mem::size_of::<VgaChar>(),
+ self.area() - offset,
);
}
let pos = self.area() - offset;
*self.lock = unsafe { self.start().offset(pos as isize) };
- unsafe {
- core::intrinsics::volatile_set_memory(
- *self.lock,
- 0u8,
- offset * core::mem::size_of::<VgaChar>(),
- )
- }
+ unsafe { core::intrinsics::volatile_set_memory(*self.lock, 0u8, offset) }
}
pub fn set_color_state(&mut self, fg: Color, bg: Color) {
@@ -187,11 +181,7 @@ impl<'a> VgaTerminalControllerLock<'a> {
pub fn clear(&mut self) {
unsafe {
- core::intrinsics::volatile_set_memory(
- *self.lock,
- 0u8,
- self.area() * core::mem::size_of::<VgaChar>(),
- );
+ core::intrinsics::volatile_set_memory(*self.lock, 0u8, self.area());
*self.lock = self.start();
}
}
@@ -218,11 +208,7 @@ impl<'a> VgaTerminalControllerLock<'a> {
);
}
unsafe {
- core::intrinsics::volatile_copy_memory(
- *self.lock,
- chars.as_ptr(),
- core::mem::size_of::<VgaChar>() * chars.len(),
- );
+ core::intrinsics::volatile_copy_memory(*self.lock, chars.as_ptr(), chars.len());
*self.lock = self.lock.offset(chars.len() as isize);
}
}