IDT exception 6 problem solved

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
slacker

IDT exception 6 problem solved

Post 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?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:IDT exception 6 problem solved

Post 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 ...
slacker

Re:IDT exception 6 problem solved

Post 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
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:IDT exception 6 problem solved

Post 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 ?
Whatever5k

Re:IDT exception 6 problem solved

Post 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?
slacker

Re:IDT exception 6 problem solved

Post 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
Whatever5k

Re:IDT exception 6 problem solved

Post 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.
Post Reply