Code: Select all
IDTR_s IDTR;
void reloadIDTR()
{
IDTR.limit= 256*(sizeof(IDT_s))-1;
IDTR.base= IDT_entry; // array of IDT_s entries
__asm__ __volatile__ ("LIDT (%0)": :"p"(&IDTR));
}
Code: Select all
IDTR_s *idtrptr= &IDTR;
__asm__ __volatile__ ("LIDT (%0)": :"p"(idtrptr));
An 'objdump' of the idt object file gives this
Code: Select all
000000f0 <reloadIDTR>:
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 83 ec 0c sub $0xc,%esp
f6: 66 c7 05 10 00 00 00 movw $0x7ff,0x10
fd: ff 07
ff: c7 05 12 00 00 00 00 movl $0x800,0x12
106: 08 00 00
109: 0f 01 1d 00 00 00 00 lidtl 0x0
110: 68 00 08 00 00 push $0x800
115: 68 ff 07 00 00 push $0x7ff
11a: 68 40 00 00 00 push $0x40
11f: e8 dc fe ff ff call 0 <loadInt>
124: 89 ec mov %ebp,%esp
126: 5d pop %ebp
127: c3 ret
128: 90 nop
Can anybody tell me what is wrong here? I've been sitting all night with this thing.