summaryrefslogtreecommitdiff
path: root/kernel/src/main.c
diff options
context:
space:
mode:
authorTyler Murphy <=>2023-07-22 11:05:30 -0400
committerTyler Murphy <=>2023-07-22 11:05:30 -0400
commitda094d011f52a8f1ce879810cd1a4bbbe34f08d4 (patch)
tree4649b04705b49c2eb5f8691a5d9951351f65df04 /kernel/src/main.c
parentrefactoring (diff)
downloadfinix-da094d011f52a8f1ce879810cd1a4bbbe34f08d4.tar.gz
finix-da094d011f52a8f1ce879810cd1a4bbbe34f08d4.tar.bz2
finix-da094d011f52a8f1ce879810cd1a4bbbe34f08d4.zip
paging is not very funHEADmain
Diffstat (limited to '')
-rw-r--r--kernel/src/main.c20
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();
}
}