OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Apr 29, 2024 12:47 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Page fault when returning from software interrupt
PostPosted: 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
Code:
_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:
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 */
      ...
   }
}


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.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group