Page 1 of 1
IDT exception 6 problem solved
Posted: Tue Apr 15, 2003 11:50 am
by slacker
i have been posting questions about theis problem for over a week now and have finally figured out the problem(well sorta). first of all in an ISR running in protected mode, the general purpose registers should be pushed and popped with PUSHAD and POPAD. Now the second part of this problem is what i dont understand. the exception 6 occurs when i pop ES,FS, or GS in my ISR? why does exception 6 occur because of this?
Re:IDT exception 6 problem solved
Posted: Tue Apr 15, 2003 3:08 pm
by Pype.Clicker
this shouldn't occur (correct me if i'm wrong, EXC6 is "invalid opcode", right ?) ... once you get the EXC6, check the memory that is around eip and make sure the bytes that are at the end of your code handler ARE the code for the handler...
i wouldn't be surprised if your "print" attempt had ruined some of your code (or maybe the return address ?) because of a bad initialized pointer ...
Re:IDT exception 6 problem solved
Posted: Tue Apr 15, 2003 6:30 pm
by slacker
pype.clicker: i had this code and got the exception 6:
so it wasnt my "call"
ISR20:
PUSHAD
PUSH DS
PUSH ES
PUSH FS
mov al, 0x20
mov dx, 0x20
OUT dx,al ;EOI
POP FS
POP ES
POP DS
POPAD
iret
Re:IDT exception 6 problem solved
Posted: Wed Apr 16, 2003 4:05 am
by Pype.Clicker
oops. sorry. i had in mind your handler was calling some "print" function ...
How do you know the handler is actually executed ? would you by any chance have an invalid offset in your IDT descriptor ?
Re:IDT exception 6 problem solved
Posted: Wed Apr 16, 2003 4:32 am
by Whatever5k
Is ISR20 the interrupt service routine for a IRQ? If yes, for which? Did you remap PICs correctly, and did you disable all those IRQs for which you do not have an ISR installed?
Re:IDT exception 6 problem solved
Posted: Wed Apr 16, 2003 6:35 am
by slacker
i did remap pics correctly but did NOT disable IRQs that did not have an ISR. BUT...if an IRQ fired and did not have a corresponding ISR the PC would reboot and cause another exception to occur which is NOT the case.
int 0x20 corresponds to IRQ0
Re:IDT exception 6 problem solved
Posted: Wed Apr 16, 2003 8:33 am
by Whatever5k
However, be sure what you are making. Why not disable all IRQs for you do not have an ISR installed? Then you can be sure that this is not the problem.