Browse Source

vga_console: bounds-check move_cursor()

master
3moon 8 years ago
parent
commit
e0380c6b0a
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/arch/x86_64/device/vga_console.rs

+ 3
- 0
src/arch/x86_64/device/vga_console.rs View File

@ -121,6 +121,9 @@ impl Writer {
/// Move the _console cursor_ (blinky bar) to (row, col).
fn move_cursor(&mut self, row: usize, col: usize) {
assert!(row < BUFFER_HEIGHT, "attempted out-of-bounds (row) cursor move");
assert!(col < BUFFER_WIDTH, "attempted out-of-bounds (col) cursor move");
let pos: u16 = ((row * 80) + col) as u16;
// Lovingly ripped off from wiki.osdev.org/Text_Mode_Cursor
unsafe {


Loading…
Cancel
Save