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
Triple Page Fault Error ?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Triple Page Fault Error ?
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]'
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 ?
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 ?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Triple Page Fault Error ?
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 ?
oh, btw, you haven't stored a pointer to a C function in your IDT, have you ?
Re:Triple Page Fault Error ?
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
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Triple Page Fault Error ?
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.
Maybe if you post your ISR, we'll be able to track the problem better.
Re:Triple Page Fault Error ?
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
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
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Triple Page Fault Error ?
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 ];->
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 ];->
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image