feat: initial locking etc.

This commit is contained in:
2021-03-01 21:07:53 +01:00
parent ebe006a8ba
commit 990b850c43
14 changed files with 427 additions and 14 deletions

View File

@@ -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)) {