feat: initial locking etc.
This commit is contained in:
@@ -70,13 +70,29 @@ int print_char(char character, int col, int row, char attributes) {
|
||||
offset = get_cursor_offset();
|
||||
}
|
||||
|
||||
if (character == '\n') {
|
||||
row = get_offset_row(offset);
|
||||
offset = get_offset(0, row + 1);
|
||||
} else {
|
||||
_vga_character_memory[offset] = character;
|
||||
_vga_character_memory[offset + 1] = attributes;
|
||||
offset += 2;
|
||||
switch (character) {
|
||||
case '\n':
|
||||
row = get_offset_row(offset);
|
||||
offset = get_offset(0, row + 1);
|
||||
break;
|
||||
case '\t':
|
||||
col = (col + 4) & (~0b11);
|
||||
if (col > VGA_COL_MAX) {
|
||||
row = get_offset_row(offset);
|
||||
offset = get_offset(0, row + 1);
|
||||
} else {
|
||||
offset = get_offset(col, row);
|
||||
}
|
||||
break;
|
||||
case '\r':
|
||||
row = get_offset_row(offset);
|
||||
offset = get_offset(0, row);
|
||||
break;
|
||||
default:
|
||||
_vga_character_memory[offset] = character;
|
||||
_vga_character_memory[offset + 1] = attributes;
|
||||
offset += 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (offset >= (VGA_COL_MAX * 2 * VGA_ROW_MAX)) {
|
||||
|
||||
Reference in New Issue
Block a user