diff options
author | Tyler Murphy <=> | 2023-07-22 11:05:30 -0400 |
---|---|---|
committer | Tyler Murphy <=> | 2023-07-22 11:05:30 -0400 |
commit | da094d011f52a8f1ce879810cd1a4bbbe34f08d4 (patch) | |
tree | 4649b04705b49c2eb5f8691a5d9951351f65df04 /kernel/src/main.c | |
parent | refactoring (diff) | |
download | finix-da094d011f52a8f1ce879810cd1a4bbbe34f08d4.tar.gz finix-da094d011f52a8f1ce879810cd1a4bbbe34f08d4.tar.bz2 finix-da094d011f52a8f1ce879810cd1a4bbbe34f08d4.zip |
Diffstat (limited to '')
-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(); } } |