vga text output and libc expansion
[3sys] / sys1 / kern / src / main.c
index b89a98b..f0441e5 100644 (file)
@@ -1,22 +1,22 @@
+#include <stdio.h>
 #include <string.h>
 #include <stdint.h>
-
-void clearscr(void)
-{
-       memset((void*)0xb8000, 0, 80 * 25 * 2);
-}
+#include "vga.h"
 
 void drawtext(int x, int y, const char *s)
 {
-       uint16_t *vptr = (uint16_t*)0xb8000 + y * 80 + x;
-
        while(*s) {
-               *vptr++ = 0x0c00 | *s++;
+               vga_drawchar(x++, y, *s++);
        }
 }
 
 void kmain(void)
 {
-       clearscr();
-       drawtext(10, 5, "3sys kernel 1");
+       char buf[64];
+
+       vga_reset();
+       vga_setcolor(VGA_YELLOW | VGA_BRIGHT, VGA_BLACK);
+
+       sprintf(buf, "kmain addr: %p", (void*)kmain);
+       drawtext(10, 5, buf);
 }