IRQs

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.
jrfritz

Re:IRQs

Post by jrfritz »

When I sti, now I get this:

fetch_raw_discriptor: LDTR.valid=0

And I didn't load a LDTR.
Why does it do this?
DarylD

Re:IRQs

Post by DarylD »

I would hazard a guess based on your last couple of comments that your GDT is not setup right or you are not using selectors properly.

I.e. you get "iret: AR byte indicated non code segment
", this indicates to me that your CS selector is not set properly, it should be something like 0x8 pointing to a correct GDT entry"

The ldtr message is related I believe to using a bad selector.
jrfritz

Re:IRQs

Post by jrfritz »

[attachment deleted by admin]
jrfritz

Re:IRQs

Post by jrfritz »

And by the way...my PIT handler is called once before the GPF happends.
jrfritz

Re:IRQs

Post by jrfritz »

Ok...I found part of the problem.

My PIT handler ... just after it Irets ( or before ) I get a GPF...any help?
DarylD

Re:IRQs

Post by DarylD »

Are you saving all the registers???

Either that or somehow the stack got corrupted and it could be popping off a bad selector/eip address.
jrfritz

Re:IRQs

Post by jrfritz »

Yea I saved all the registers.
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:IRQs

Post by Pype.Clicker »

it really seems that your handler code is messing up the stack ... you're probably trying to perform an IRET on something that isn't the interrupt stack frame (get an ASM version of your code using gcc -S and check your push/pop pairs)
jrfritz

Re:IRQs

Post by jrfritz »

My IDT is working 100%!!! The PIT is working!

There where two probs:

My GDT CodeSel was not good...and:

Pype.Clicker was right about the IDT IRQs in Asm!
Post Reply