My name is Risc and I'm new to these forums.
I am developing a small real mode kernel in Turbo C (v2 i think... the first 'blue' version) and have run into a problem.
This piece of code is driving me nuts. The INT_0 interrupt function is never called when I divide by zero. The system just hangs.
Code: Select all
void interrupt INT_0()
{
printf("Interrupt 0\r\n");
}
void install_interrupts()
{
int int0 = (int)INT_0;
/* I have tried with:
int* int0 = (int*)INT_0; */
/* Zero extra segment */
asm xor ax, ax
asm mov es, ax
/* Intel-specific interrupts */
asm mov dx, int0
asm mov WORD [es:0x0], dx /* Add the Interrupt procedure location to the IVT */
asm mov WORD [es:0x02], cs /* Segment containing the procedure */
asm sti
}
Thanks.
/Risc