From 48bdc0e58fa036d6551fe216daaa6dbb390b8c82 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 8 Jul 2014 18:13:26 +0200 Subject: some cleanup --- kernel/kernel.c | 134 ++++++++++++++++++++------------------------------------ 1 file changed, 48 insertions(+), 86 deletions(-) (limited to 'kernel/kernel.c') diff --git a/kernel/kernel.c b/kernel/kernel.c index 584b5c8..bdf1ec1 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,8 +1,19 @@ -#include +#include #include "kernel.h" // general kernel config #include "console.h" // this will allow us to write to screen +// garbage +int unhandled=0; + +char col=100; +char col2=0; + +int cursor=0; +char last_code=0; + +uint8_t kb_in; + //// interrupt stuff ///// // #define INT_MAX 255 @@ -28,23 +39,13 @@ static struct idt_desc } idtd; -int unhandled=0; - -char col=100; -char col2=0; - -int cursor=0; -char last_code=0; - -uint8_t kb_in; - void int_def_handler() { __asm__("pusha"); unhandled++; - // todo also the other pic! + // todo also the other pic!// TODO __asm__("mov $0x20, %al"); __asm__("out %al, $0x20"); @@ -61,7 +62,7 @@ void int_kb_handler() __asm__("in $0x60, %al"); __asm__("mov %%al, %0"::"m" (kb_in)); - int0(kb_in); + int0(kb_in); //TODO!! __asm__("mov $0x20, %al"); __asm__("out %al, $0x20"); @@ -76,17 +77,10 @@ void int_init(uint16_t sel) { int i; - /* - idtd.size=sizeof(struct int_desc)*INT_MAX-1; // why the -1 ?? - idtd.base=(uint32_t)&idt[0]; - */ - for(i=0; i "); - print_hex(idt_old[irq].addrLo); - print_string(" "); - print_hex(idt_old[irq].addrHi); - print_string(" "); - print_hex(idt_old[irq].sel); - print_nextline(); - } -*/ - + // kernel main loop while(1) { - // print_nextline(); // print_str_col(0,0,"ABC",col); -// print_str_col(1,SCR_HEIGHT,"(*)",col2++); + print_str_col(1,SCR_HEIGHT,"(*)",col2++); //int0(); } - print_hex(*(ptr3)); - print_nextline(); } + + +/// keyboard driver //// + void int0(uint8_t in) { int i=0; -- cgit v1.2.3