From c8a195e1eb19d346c03c1dfa6ed66c6215caefa2 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Mon, 2 Feb 2015 21:48:38 -0500 Subject: Refactor, begin writing a PS/2 driver --- kernel/main.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c index 63ba635..119cf15 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -1,30 +1,40 @@ +#include #include "gdt.h" #include "idt.h" #include "isr.h" #include "irq.h" +#include "ps2.h" +#include "timer.h" #include "tty.h" -#include - -void interrupt(struct regs_t regs) -{ -} void main(struct multiboot_header *hdr, uint32_t magic) { + /* init the terminal first so we can get some output */ tty_init(); + /* then the descriptor tables so we can do more useful stuff */ gdt_init(); idt_init(); + /* install all the interrupt stubs */ isr_init(); irq_init(); - for(int i=0;i<256;++i) - set_interrupt_handler(i, interrupt); + /* initialize other drivers */ + timer_init(); + ps2_init(); asm("sti"); - printf("Boot finished.!\n"); + for(;;) + { + ps2_set_leds(0x01); + ps2_set_leds(0x02); + ps2_set_leds(0x04); + ps2_set_leds(0x02); + } + + printf("Boot finished.\n"); while(1) ; } -- cgit v1.1