Page 2 of 2

Re:IRQs

Posted: Sun Dec 22, 2002 3:48 pm
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?

Re:IRQs

Posted: Sun Dec 22, 2002 3:53 pm
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.

Re:IRQs

Posted: Sun Dec 22, 2002 3:59 pm
by jrfritz
[attachment deleted by admin]

Re:IRQs

Posted: Sun Dec 22, 2002 4:01 pm
by jrfritz
And by the way...my PIT handler is called once before the GPF happends.

Re:IRQs

Posted: Mon Dec 23, 2002 4:48 pm
by jrfritz
Ok...I found part of the problem.

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

Re:IRQs

Posted: Tue Dec 24, 2002 4:37 am
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.

Re:IRQs

Posted: Tue Dec 24, 2002 12:26 pm
by jrfritz
Yea I saved all the registers.

Re:IRQs

Posted: Thu Dec 26, 2002 6:16 am
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)

Re:IRQs

Posted: Thu Dec 26, 2002 4:59 pm
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!