software interrupts not getting called + bochs error
Posted: Mon Feb 11, 2013 8:49 am
GRUB2 is the bootloader.
I have the GDT set up.
I thought I had the IDT set up, but I am not sure if I did it right.
My i86_default_handler_asm just runs cli, hlt. In my kernel code, I divide by zero to trigger a software interrupt.
Another, possibly relevant, thing I noticed was in bochs's output:
It looks like something with the GDT. Could that be causing the problem?
Thanks.
I have the GDT set up.
I thought I had the IDT set up, but I am not sure if I did it right.
I am calling the above function to load the IDT.int i86_idt_initialize (uint16_t codeSel) {
// set up idtr for processor
_idtr.limit = sizeof (struct idt_descriptor) * I86_MAX_INTERRUPTS -1;
_idtr.base = (uint32_t)&_idt[0];
// null out the idt
memset((void*)&_idt[0], 0, sizeof(struct idt_descriptor) * I86_MAX_INTERRUPTS-1);
// register default handlers
int i;
for (i=0; i<I86_MAX_INTERRUPTS; i++)
i86_install_ir (i, I86_IDT_DESC_PRESENT | I86_IDT_DESC_BIT32,
codeSel, (I86_IRQ_HANDLER)i86_default_handler_asm);
// install our idt
idt_install ();
return 0;
}
My i86_default_handler_asm just runs cli, hlt. In my kernel code, I divide by zero to trigger a software interrupt.
Another, possibly relevant, thing I noticed was in bochs's output:
Code: Select all
00132630827e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x00)
00132630827e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
Thanks.