The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: allynm on May 20, 2011, 06:35:02 PM

Title: How to read the GDT, LDT, and IDT
Post by: allynm on May 20, 2011, 06:35:02 PM
Hello everyone,

I have spent the last couple of days trying to untangle how the GDT, LDT, and IDT work.  I thought it would be helpful to figuring them out if there was some asm code that would allow the fields in these tables to be read and displayed.  Since there is at least one debugger out there (Bochs) that can display this info, it must be possible.   I have searched on the internet and on this forum, but haven't found anything, although there are posts that do discuss these structures.  There seems to be no Windows API that does this job, as far as I can tell.

I was hoping that someone here might be able to share with me a snippet or two that would illustrate how to read these fields, or at least give some guidance on how to do it.  I'm not trying to set or change them, merely to read them.


Regards,

Mark Allyn
Title: Re: How to read the GDT, LDT, and IDT
Post by: dedndave on May 21, 2011, 10:14:48 AM
the intel manuals explain things
Title: Re: How to read the GDT, LDT, and IDT
Post by: Tedd on May 21, 2011, 11:07:01 AM
All details are in the Intel Manuals, Volume 3 "System Programming Guide"
And at http://wiki.osdev.org/GDT (and related articles.)

There's no Windows API because they don't want you fiddling with it :P
Title: Re: How to read the GDT, LDT, and IDT
Post by: allynm on May 21, 2011, 11:45:06 AM
Good morning 'Dave and Tedd,

Thank you.  As I mentioned, I don't want to fiddle, just to read the notes.

Regards,
Mark