diff options
Diffstat (limited to 'kernel/src/tty')
-rw-r--r-- | kernel/src/tty/term.c | 11 | ||||
-rw-r--r-- | kernel/src/tty/term.h | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/kernel/src/tty/term.c b/kernel/src/tty/term.c index 4f75788..231d38b 100644 --- a/kernel/src/tty/term.c +++ b/kernel/src/tty/term.c @@ -9,7 +9,8 @@ #include "color.h" #include "cursor.h" -uint16_t *buffer; +uint16_t buffer[TERM_W * TERM_H * sizeof(uint16_t)]; +uint16_t *front; uint8_t x, y; uint8_t color; @@ -27,7 +28,7 @@ static void term_clear_line(int y) { void term_init (void) { x = 0; y = 0; - buffer = (uint16_t*) 0xb8000; + front = (uint16_t*) 0xb8000; term_setfg(VGA_WHITE); term_setbg(VGA_BLACK); term_clear(); @@ -129,3 +130,9 @@ void putchar(int c) { bool term_newline(void) { return x == 0; } + +void term_flush(void) { + int_disable(); + memcpy(front, buffer, TERM_W * TERM_H * sizeof(uint16_t)); + int_enable(); +} diff --git a/kernel/src/tty/term.h b/kernel/src/tty/term.h index f6eb555..ceda255 100644 --- a/kernel/src/tty/term.h +++ b/kernel/src/tty/term.h @@ -25,3 +25,5 @@ uint16_t term_save_col(void); void term_load_col(uint16_t color); bool term_newline(void); + +void term_flush(void); |