summaryrefslogtreecommitdiff
path: root/kernel/src/tty/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/tty/term.c')
-rw-r--r--kernel/src/tty/term.c11
1 files changed, 9 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();
+}