Page 6 of 9

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 7:57 am
by DarylD
Berserk,

What books have you bought? What does it explain in there about IDT's? Maybe we can clarify if the books description is not very clear.

Daryl.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 9:05 am
by Pype.Clicker
Berserk wrote: Could Somebody PLEASE, PLEASE explain to me, WHAT IS AN IDT! and What does it do??

;D
okay, Bersek. What if you stop bugging ppl with repeated questions and ask GOOGLE instead ? Get the Intel manuals
(alt: special low bandwidth plain text copy)

and check sections 9.4 and 9.5 about interrupt descriptor tables.
Thanks in advance.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 10:08 am
by jrfritz
I am in PMode when I setup my stack and I use bits 32 before I setup my stack.

If I put 0xFFFFFFFF in ESP ( in Pmode ) BOCHS says it's running in "bogus" memory and my computer tripple faults when I run it out of BOCHS.


How do I make my stack 0xFFFFFFFF?

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 11:20 am
by beyondsociety
Have you tried changing the registers mainly the ax register which is 16 bit to a 32 bit register?

Code: Select all

mov ax,0x10
mov ss,ax
mov esp,0xFFFFFFFF
To

Code: Select all

mov eax,0x10
mov ss,eax  
mov esp,0xFFFFFFFF

Not sure if there is a 32 bit register for the stack. I not sure if this would help. Its worth a try.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 11:22 am
by jrfritz
Ok...i'll try...at least my GPF handler is working...

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 11:33 am
by jrfritz
Nope...didn't work.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 11:33 am
by Unexpected
Hi,
I still have a bugs with my handlers ;)
In every code what I had been saw, the handlers look diference. Can anyone post a simple handler?
Witch looks like this:

Code: Select all

IRQ0:
... some pushs?...
CALL _C_Function   ; For example with one variable
...some pops?...
IRET
Thnx!

P.S. - Sorry for my terrible english ;)

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 11:47 am
by jrfritz
I'm not sure if this works but:

IDThan0:
pusha
call C code
popa
iret

Also...that eax stuff didn't work.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:12 pm
by beyondsociety
Tom, post your code so I can have a look at it. If I can't figure out your problem, at least maybe someone else can.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:16 pm
by jrfritz

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:20 pm
by beyondsociety
I was referring to your non-working code, I.E the IDT in C and the other asm code thats giving you problems.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:22 pm
by DarylD
Have you got the top of the virtual address space mapped? Otherwise won't setting esp to 0xFFFFFFFF just cause a page fault?

Daryl.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:27 pm
by jrfritz
beyondsociety...my IDT is working now! I'm having stack problems now!
Have you got the top of the virtual address space mapped? Otherwise won't setting esp to 0xFFFFFFFF just cause a page fault?
:-[ That sounds scary...how do I fix this?

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:29 pm
by beyondsociety
Sorry. Could I at least look at your asm code thats giving you the stack problem.

Re:Some IDT Code...in C

Posted: Wed Dec 18, 2002 12:31 pm
by jrfritz
::) It's in the file link I gave you...

And I would still like to know how to do that virtual address thing.