Page fault when returning from software interrupt
Posted: Thu Mar 02, 2006 2:29 pm
I have just tried to make a connection between kernel and my clib using a software interrupt..
well it works so far that I get the interrupt and my service routine catch it and do what it is supposed to do. but then I get a page fault when returning.
Here is my NASM wrapper code
at the moment my ISR only prints the registers so I can see that it recived what I sent and then returns. and on returning I get a page fault if I halt (while(1)) I don't get any page fault.
well it works so far that I get the interrupt and my service routine catch it and do what it is supposed to do. but then I get a page fault when returning.
Here is my NASM wrapper code
Code: Select all
_isr50:
cli
push byte 0
push byte 50
jmp isr_common_stub
isr_common_stub:
pusha
push ds
push es
push fs
push gs
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, esp
push eax
mov eax, isr_handler
call eax
pop eax
pop gs
pop fs
pop es
pop ds
popa
add esp, 8
iret
Code: Select all
void isr_handler( struct regs *r )
{
if( isr_handlers[r->int_no] != NULL )
{
/* call ISR for this interrupt */
isr_handlers[r->int_no]( r );
}
else
{
/* Print error message and halt */
...
}
}