diff options
author | Marvin Borner | 2019-09-25 22:57:33 +0200 |
---|---|---|
committer | Marvin Borner | 2019-09-25 22:57:33 +0200 |
commit | 8ebf584bbb43584b671b79d5166e00268a7c9661 (patch) | |
tree | 466abea4e6da201e7b432d7394e1bf21cbbe1d98 /src/kernel/graphics/vga.c | |
parent | 16b8a48d1de16a5982cf983a282832fd4ed01f85 (diff) |
Fixed several TTY bugs and improved VESA detection
Diffstat (limited to 'src/kernel/graphics/vga.c')
-rw-r--r-- | src/kernel/graphics/vga.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/kernel/graphics/vga.c b/src/kernel/graphics/vga.c index 3e910f1..fa1f330 100644 --- a/src/kernel/graphics/vga.c +++ b/src/kernel/graphics/vga.c @@ -107,15 +107,10 @@ void terminal_put_char(char c) { } else if (c == '\r') { terminal_column = 0; } else if (c == '\n') { - if (irq_is_installed(1)) exec_command(text); - memory_set(text, 0, sizeof(text)); - terminal_column = 0; terminal_row++; + terminal_column = 0; terminal_scroll(); - terminal_put_entry_at('$', terminal_color, terminal_column, terminal_row); - terminal_column = 2; } else if (c >= ' ') { // Any printable character - strcat(text, &c); terminal_put_entry_at(c, terminal_color, terminal_column, terminal_row); terminal_column++; } @@ -135,12 +130,25 @@ void terminal_write(const char *data, size_t size) { terminal_put_char(data[i]); } +void terminal_put_keyboard_char(char c) { + terminal_put_char(c); + if (c == '\n' && irq_is_installed(1)) { + exec_command(text); + memory_set(text, 0, sizeof(text)); + terminal_column = 0; + terminal_row++; + terminal_scroll(); + terminal_put_entry_at('$', terminal_color, terminal_column, terminal_row); + terminal_column = 2; + terminal_update_cursor(); + } else if (c >= ' ' && irq_is_installed(1)) strcat(text, &c); +} + void terminal_write_string(const char *data) { terminal_write(data, strlen(data)); } void terminal_write_line(const char *data) { - terminal_row++; terminal_column = 0; terminal_write_string(data); terminal_column = 0; |