Mike wrote:If you are in protected mode (as it appears to be) and have not set up an IDT yet (and remap the PICs), then yes--it should crash.
This is where i want to get. I'm trying to setup a GDT and IDT. I'm following Tutorial 15, but i have to change a few lines of code to compile on GCC.
in idt.h i change
Code: Select all
typedef void (_cdecl *I86_IRQ_HANDLER)(void);
to this
typedef void(*I86_VECT_HANDLER)(void);
since the cdecl is a MSVC only definition, i think.
and i changed the inline asm to load gdt and idt, so in gdt.c and idt.c i got this.
Code: Select all
static void instalar_gdt()
{
__asm__ __volatile__ ("lgdt %0\n" : : "m" (_gdtr));
}
and
static void instalar_idt()
{
__asm__ __volatile__ ("lidt %0\n" : : "m" (_idtr));
}
the rest of the code its same as tutorial 15.
in my cpu_init() function, if i just call loadGDT() and loadIDT(0x8), it doesn't crash. but after i call these two functions and call an interrupt like this __asm__("int $0x15"); it crash the system without calling the i86_default_handler();
any ideas?