X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=sys1%2Fkern%2Fsrc%2Fmain.c;h=3c93cab9380c3aba7926f5266dc0a67be60794e9;hb=HEAD;hp=f0441e587454a56bb320222b85721dfe0c03c55b;hpb=d49aa763f9b7c4ae66cf80f0cbfc3456789fc0ac;p=3sys diff --git a/sys1/kern/src/main.c b/sys1/kern/src/main.c index f0441e5..3c93cab 100644 --- a/sys1/kern/src/main.c +++ b/sys1/kern/src/main.c @@ -1,22 +1,34 @@ #include #include #include +#include "con.h" #include "vga.h" - -void drawtext(int x, int y, const char *s) -{ - while(*s) { - vga_drawchar(x++, y, *s++); - } -} +#include "mem.h" +#include "intr.h" void kmain(void) { - char buf[64]; + int i, line; - vga_reset(); - vga_setcolor(VGA_YELLOW | VGA_BRIGHT, VGA_BLACK); + con_init(); - sprintf(buf, "kmain addr: %p", (void*)kmain); - drawtext(10, 5, buf); + mem_init(); + intr_init(); + + line = 0; + for(;;) { + printf("line %d", line++); + + con_pushcur(); + con_setcur(30, 0); + for(i=0; i<65536 * 300; i++) { + if((i & 0xfffff) == 0) { + con_setcolor(VGA_BRIGHT | (line & 7), VGA_BLACK); + con_putchar('>'); + } + } + con_setcolor(VGA_WHITE, VGA_BLACK); + con_popcur(); + con_putchar('\n'); + } }