summaryrefslogtreecommitdiff
path: root/kernel/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kernel.c')
-rw-r--r--kernel/kernel.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 7d9b848..2dd57fd 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -25,13 +25,14 @@ void int_test_handler_worker()
{
// this can not be called directly from interrupt handler
// due to optional parameters (...) probably!
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"irq 88");
+ panic(FOOLOS_MODULE_NAME,"unhandled EXCEPTION!");
}
void int_test_handler()
{
X86_IRQ_BEGIN
int_test_handler_worker();
sleep(30);
+ while(1); // hang!
X86_IRQ_END
}
@@ -55,17 +56,23 @@ void kernel_main()
// while the last one is set in the Makefile. The font binary
// is integrated in the kernel image.
//
- vesa_init(0x8300,0x8400,0x7200);
+ // this function returns the physical base address of
+ // our video memory
+ //
+ uint32_t vesa_physbase=vesa_init(0x8300,0x8400,0x7200);
//
// PIT config (timer)
timer_init();
+
// we know that here, the bootloader placed the mamory map!
mem_init(0x7c00+0x400,*((uint16_t *)(0x7c00+0x600)));
- // paging (Todo)
- vmem_init();
+ // paging (pass the vesa physbase address for identity mapping)
+ vmem_init(vesa_physbase);
+
+ //
// init and interrupt decriptor table
int_init(0x08);
@@ -90,10 +97,15 @@ void kernel_main()
// install test software interrupt handler
int_install_ir(88, 0b10001110, 0x08,&int_test_handler);
+
+ for(int i=0;i<19;i++)
+ int_install_ir(i, 0b10001110, 0x08,&int_test_handler);
// now we can enable interrupts back again
int_enable();
+// int x=10/0;
+
// pci
pci_init();
@@ -116,6 +128,15 @@ void kernel_main()
log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"test mem %x",*(memtest2+1));
*/
+ /* stack pointer test?
+ uint32_t *esp=0x90000;
+ for(int i=0;i<10;i++)
+ {
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"esp: %x",*esp);
+ esp--;
+ }
+ */
+
while(1); // never ending loop