aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.c
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-02-02 21:48:38 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-02-02 21:48:38 -0500
commitc8a195e1eb19d346c03c1dfa6ed66c6215caefa2 (patch)
tree3096ea08f7f213d7efe56a86391ab79b27333d40 /kernel/main.c
parent5c84e678defa9333aefcdcd0870564fb945a8c61 (diff)
downloadkappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.zip
kappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.tar.gz
kappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.tar.bz2
kappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.tar.xz
Refactor, begin writing a PS/2 driver
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c26
1 files changed, 18 insertions, 8 deletions
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 <stdio.h>
#include "gdt.h"
#include "idt.h"
#include "isr.h"
#include "irq.h"
+#include "ps2.h"
+#include "timer.h"
#include "tty.h"
-#include <stdio.h>
-
-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)
;
}