X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcensus;a=blobdiff_plain;f=src%2Fkmain.c;fp=src%2Fkmain.c;h=6996908fd3cb80633fa35d52d96e309b829cf788;hp=f1533b237664d1ba23c93099faf17de1eef3c0fa;hb=a2f94f569a4c99204de02814a20098a71527e913;hpb=d1e8a437c1fab4535f82c4c214ec3330ac32e48d diff --git a/src/kmain.c b/src/kmain.c index f1533b2..6996908 100644 --- a/src/kmain.c +++ b/src/kmain.c @@ -1,11 +1,45 @@ #include +#include +#include "segm.h" +#include "intr.h" +#include "keyb.h" +#include "timer.h" #include "contty.h" -static int foo = 42; +void set_mode13h(void); +void logohack(void); void pcboot_main(void) { + init_segm(); + init_intr(); + kb_init(); con_init(); - printf("hello world: %d\n", foo); + /* initialize the timer */ + init_timer(); + + enable_intr(); + + printf("PCBoot kernel initialized\n"); + + for(;;) { + int c; + + halt_cpu(); + while((c = kb_getkey()) >= 0) { + if(c >= KB_F1 && c <= KB_F12) { + set_mode13h(); + logohack(); + } + if(isprint(c)) { + printf("key: %d '%c' \n", c, (char)c); + } else { + printf("key: %d \n", c); + } + } + if((nticks % 250) == 0) { + printf("ticks: %ld\r", nticks); + } + } }