Log in

View Full Version : SIDT - Explanation


xHorunge
April 20th, 2009, 12:34
Hello!

I've been reading about the instruction SIDT(Store Interrupt Descriptor Table).

I have trouble using the right datatypes/storing the data from it in a structure, since it doesn't make sense to me. I have seen ready-made structures, but I want a better understanding of the "output" of the instruction. So in short, the question is, maybe someone could help me/explain this a bit better, and maybe how i could understand the syntax in the pdf and convert it to the correct datatype:
"Intel® 64 and IA-32 Architectures Software Developer’s Manual".

The point of this is to locate the pointer to a interrupt in the interrupt table. So any explanation on that will help also. This is all on linux, the structures i found is:

ELSE (* 32-bit Operand Size *)
DEST[0:15] IDTR(Limit);
DEST[16:47] IDTR(Base); (* full 32-bit base address loaded *)
FI;

struct idt
{
unsigned short limit;
unsigned short base;
} __attribute__((packed));


struct idt_desc
{
unsigned short base_lo;
unsigned short nvm1;
unsigned char nvm2;
unsigned char nvm3;
unsigned short base_hi;
} __attribute__((packed));

Seems everyone uses the same "sample" code to locate the right entry in the table. I understand the part where they multiply the "address" with the entry you want. But ive seen some right shifting that I didnt find a explanation on either.

*Mildly confused*.

I usually dont have problem with these kinds of stuff, this is just cryptic for me atm.

evlncrn8
April 21st, 2009, 14:17
no real point, access to the idt is now restricted to ring 0, accessing the area you get from the sidt command will result in an exception on most windows versions except 9x, me and possibly 2k