Some IDT Code...in C

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

Re:Some IDT Code...in C

Post 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.
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:Some IDT Code...in C

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

Re:Some IDT Code...in C

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

Re:Some IDT Code...in C

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

Re:Some IDT Code...in C

Post by jrfritz »

Ok...i'll try...at least my GPF handler is working...
jrfritz

Re:Some IDT Code...in C

Post by jrfritz »

Nope...didn't work.
Unexpected

Re:Some IDT Code...in C

Post 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 ;)
jrfritz

Re:Some IDT Code...in C

Post by jrfritz »

I'm not sure if this works but:

IDThan0:
pusha
call C code
popa
iret

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

Re:Some IDT Code...in C

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

Re:Some IDT Code...in C

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

Re:Some IDT Code...in C

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

Re:Some IDT Code...in C

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

Re:Some IDT Code...in C

Post by beyondsociety »

Sorry. Could I at least look at your asm code thats giving you the stack problem.
jrfritz

Re:Some IDT Code...in C

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