diff options
Diffstat (limited to 'kernel/src/main.c')
-rw-r--r-- | kernel/src/main.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/kernel/src/main.c b/kernel/src/main.c index 33e4cea..674d2c1 100644 --- a/kernel/src/main.c +++ b/kernel/src/main.c @@ -3,12 +3,15 @@ #include <drivers/ps2mouse.h> #include <panic.h> #include <print.h> -#include <sys.h> +#include <stddef.h> +#include <arch.h> #include <math.h> #include <stdint.h> #include <stdlib.h> #include <term.h> +#define WIDTH 30 +static char buf[WIDTH]; static double x = 0, y = 0; void kernel_main(void *boot_info) { @@ -23,7 +26,6 @@ void kernel_main(void *boot_info) { while(1) { arch_wait_int(); - arch_update(); struct Keycode code = ps2kb_get(); if(code.key != KEY_NONE) { @@ -52,6 +54,20 @@ void kernel_main(void *boot_info) { printk(" x%d y%d\n", (int)x, (int)y); } + uint32_t state = term_save(); + + term_setfg(VGA_LIGHT_GREEN); + term_setpos(TERM_W - WIDTH - 1, 0); + for (size_t i = 0; i < WIDTH; i++) putchar(' '); + term_setpos(TERM_W - WIDTH - 1, 0); + + struct Time t = get_localtime(); + timetostr(&t, "%a %b %d %Y %H:%M:%S", buf, WIDTH); + printk("%s", buf); + + term_load(state); + + arch_update(); term_flush(); } } |