Page 1 of 1

Triple Page Fault Error ?

Posted: Thu Sep 11, 2003 12:10 pm
by x_man
hello all,
i'm new to os. my interrupt works fine, but it generates triple fault error "13 (3rd) Exception with no resolution". What is this error and why does it restarts my system after i call the interrupt ?

thanks in advance

Re:Triple Page Fault Error ?

Posted: Thu Sep 11, 2003 12:32 pm
by Pype.Clicker
if it generates a tripple fault, then it means your interrupt does *not* work fine.
Check QuickLinkz:

tripple fault: the CPU didn't manage to invoke an exception handler. This is probably due to a bad IDT register content, or a bad IDT descriptor. Sometimes (but less frequent), it can also be due to a severe bug in an exception handler code. Check your exception works with things like 'idiv 0', or 'push 0xf001; pop ds; mov ax, [ds:0x12345678]'

Re:Triple Page Fault Error ?

Posted: Thu Sep 11, 2003 1:56 pm
by x_man
my interrupt handlers are installed properly and it works fine. but, the error occurs when it returns to the normal coding. should i have to clear any interrupt when it returns from the handler ?

Re:Triple Page Fault Error ?

Posted: Thu Sep 11, 2003 2:16 pm
by Pype.Clicker
this is typical from a bug in your stub. While you tried to return from the interrupt routine, you mis-popped something from the stack (a segment selector probably) and your General Protection Fault handler didn't like this.

oh, btw, you haven't stored a pointer to a C function in your IDT, have you ?

Re:Triple Page Fault Error ?

Posted: Thu Sep 11, 2003 2:55 pm
by x_man
i haven't used C coding to set IDT. i made everything in asm. i have pushed and popped everything in correct order. but still my system restarts

Re:Triple Page Fault Error ?

Posted: Fri Sep 12, 2003 1:16 am
by Pype.Clicker
if your BOCHS build has been ./configure'd to --enable-debug, you can try to call dump_cpu at the time the fault occurs to get more info about the location, register contents, etc.

Maybe if you post your ISR, we'll be able to track the problem better.

Re:Triple Page Fault Error ?

Posted: Mon Sep 15, 2003 11:08 am
by The_Pro
i've given my IDT structure and the interrupt handler.


idt:

%rep 0x9
   dw   int_0
   dw   20h
   db   0
   db   8eh
   dw   0
%endrep

idt_end:

idt_descriptor:
size   dw   idt_end - idt - 1
   dd   idt

----------------------------------------------------------------------
Interrupt Handler :

int_0:
   pusha
   push   ss
   push   gs
   push   ds
   push   fs

   mov   ax, 18h
   mov   gs, ax
   mov   byte [gs:0],'a'

   mov   al, 0x20
   out   0x20, al
   cli

   pop   fs
   pop   ds
   pop   gs
   pop   ss
   popa
   iret

----------------------------------------------------------------------
   when i call the interrupt 0, the character 'a' is printed on the screen, but, the interrupt is again called when it executes the iret instruction. should i have to clear any flag after handling the interrupt ?


Thanks

Re:Triple Page Fault Error ?

Posted: Tue Sep 16, 2003 12:42 am
by distantvoices
1. as stated somewhere else maybe by Pype: you don't need to issue cli/sti in an isr. This is done "automatically"

2. if you tell the processor to cli before iret, this is kinda carrying the owls to Athens: It just lacks sense. Tell him to 'hlt' and it will hlt for your further examination in the bochs.

ha ... of course, the interrupt will be fired again, provided you have maped it to the timer.

stay safe ];->