how can i access lidt with the gcc inline assembler best
and can somebody give me a link to a site with a
good tutorial for the idtcreating with c...
thx for help
idt probs
RE:idt probs
>On 2001-09-07 04:46:19, rockey wrote:
>how can i access lidt with the gcc inline assembler best
>and can somebody give me a link to a site with a
>good tutorial for the idtcreating with c...
>thx for help
First, you need to declare a local variable with the limit and offset
of the IDT:
struct
{
unsigned short Limit; /* 16 bit */
unsigned long * Offset; /* 32 bit */
} __attribute__((packed)) IDTR;
The ((packed)) attribute is important. If you don't use it, GCC will
insert 2 invisible bytes between Limit and Offset to align the Offset field
on a 32-bit boundary.
Now assign the fields:
extern unsigned long * IDT[];
IDTR.Limit = 2047; /* 256 entries */
IDTR.Offset = IDT;
Now you can load the IDT:
asm("lidt %0"
: /* no output */
: "m" (IDTR) /* memory operand */);
Hope this helps...
Marc Schuetz ([email protected])
>how can i access lidt with the gcc inline assembler best
>and can somebody give me a link to a site with a
>good tutorial for the idtcreating with c...
>thx for help
First, you need to declare a local variable with the limit and offset
of the IDT:
struct
{
unsigned short Limit; /* 16 bit */
unsigned long * Offset; /* 32 bit */
} __attribute__((packed)) IDTR;
The ((packed)) attribute is important. If you don't use it, GCC will
insert 2 invisible bytes between Limit and Offset to align the Offset field
on a 32-bit boundary.
Now assign the fields:
extern unsigned long * IDT[];
IDTR.Limit = 2047; /* 256 entries */
IDTR.Offset = IDT;
Now you can load the IDT:
asm("lidt %0"
: /* no output */
: "m" (IDTR) /* memory operand */);
Hope this helps...
Marc Schuetz ([email protected])