From 8ebf584bbb43584b671b79d5166e00268a7c9661 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 25 Sep 2019 22:57:33 +0200 Subject: Fixed several TTY bugs and improved VESA detection --- src/kernel/graphics/vga.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/kernel/graphics/vga.c') 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; -- cgit v1.2.3