aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/main.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 1b80056..748fc7f 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -4,6 +4,7 @@
#include "idt.h"
#include "isr.h"
#include "irq.h"
+#include "log.h"
#include "multiboot.h"
#include "pcspkr.h"
#include "ps2.h"
@@ -13,9 +14,23 @@
void main(struct multiboot_info_t *hdr, uint32_t magic)
{
- /* init the terminal first so we can get some output */
+ klog("main() called\n");
+
+ /* initialize the TTY first, no real harm can be done */
tty_init();
+ klog("tty done, magic %x\n", magic);
+ if(magic != 0x2BADB002)
+ {
+ panic("Multiboot magic invalid");
+ }
+
+ vga_init((struct vbe_info_t*)hdr->vbe_mode_info);
+
+ klog("multiboot header address: %x\n", hdr);
+ klog("multiboot vbe info struct address: %x\n", hdr->vbe_mode_info);
+ klog("multiboot framebuffer: %x\n", ((struct vbe_info_t*)hdr->vbe_mode_info)->physbase);
+
/* then the descriptor tables so we can do more useful stuff */
gdt_init();
idt_init();
@@ -31,16 +46,18 @@ void main(struct multiboot_info_t *hdr, uint32_t magic)
asm("sti");
printf("Boot finished.\n");
+ printf("Testing keyboard LED's...\n");
+ for(int i=0;i<50;++i)
+ vga_drawpixel(i, i, 0x80808080);
while(1)
{
- ps2_set_leds(0x01);
- for(int i=0;i<5000000;++i);
- ps2_set_leds(0x02);
- for(int i=0;i<5000000;++i);
- ps2_set_leds(0x04);
- for(int i=0;i<5000000;++i);
- ps2_set_leds(0x02);
- for(int i=0;i<5000000;++i);
+ ps2_set_leds(PS2_NUM_LOCK);
+ for(int i=0;i<50000000;++i);
+ ps2_set_leds(PS2_CAPS_LOCK);
+ for(int i=0;i<50000000;++i);
+ ps2_set_leds(PS2_SCROLL_LOCK);
+ for(int i=0;i<50000000;++i);
+ ps2_set_leds(PS2_CAPS_LOCK);
+ for(int i=0;i<50000000;++i);
}
-
}