Page 1 of 1

GDT, IDT

Posted: Mon Feb 25, 2002 6:11 pm
by K.J.
Okay, I think that I have this right, your OS doesn't have sevral GDTs it has one GDT with several descriptors in it. Right?

Also, does anyone know where I can find a good example of setting up a IDT?

Thanks in advance,
K.J.

Re: GDT, IDT

Posted: Tue Feb 26, 2002 11:15 am
by K.J.
Could someone please at least confirm the first part?

Thanks,
K.J.

Re: GDT, IDT

Posted: Tue Feb 26, 2002 5:09 pm
by Chris Giese
>Okay, I think that I have this right, your OS doesn't have sevral GDTs it has one GDT with several descriptors in it. Right?

Right.

>Also, does anyone know where I can find a good example of setting up a IDT?

This (NASM) code sets up handlers for all 256 INTs. There are also setvect() and getvect() functions to change the handlers from C:
http://www.execpc.com/~geezer/osd/code/osd6/kstart.asm

Similar code:
http://www.execpc.com/~geezer/osd/intr/x86-32.zip

In the current version of my Cosmos OS, there is no setvect() or getvect(): all interrupts go through one handler. This is simpler, but slower:
http://www.execpc.com/~geezer/os/index.htm#cosmos

Re: GDT, IDT

Posted: Tue Feb 26, 2002 6:18 pm
by K.J.
Thanks, that was just what I needed. :)

K.J.

Re: GDT, IDT

Posted: Wed Mar 06, 2002 10:17 am
by K.J.
Could you maybe give me an example of using the getvect() and setvect functions please(from kstart.asm)?

Thanks,
K.J.

Re: GDT, IDT

Posted: Wed Mar 06, 2002 4:29 pm
by Chris Giese
>Could you maybe give me an example of using the getvect() and setvect functions please(from kstart.asm)?

http://www.execpc.com/~geezer/osd/code/osd6/main.c

down at the bottom, in main()

Re: GDT, IDT

Posted: Wed Mar 06, 2002 6:23 pm
by K.J.
Thanks, that's what I needed. However, your link to the file didn't work, but I found it in osd.zip.

Thanks,
K.J.