yea obviously, but the question is why isnt this code generating the correct address?stlw wrote:Open Intel manual and read about LIDT instruction:yemista wrote:In that case, how do you load the idtr with a calculated linear offset that includes the base through ds? how can I make idtr 0x00100088 if I cant do it by lidt [ds:idt]?
Loads the values in the source operand into the interrupt descriptor table register (IDTR). The source operand specifies a 6-byte memory location that contains the base address (a linear address) and the limit (size of table in bytes) of the interrupt descriptor table (IDT).
pseudocode is trivial:
IDTR(Limit) ← SRC[0:15];
IDTR(Base) ← SRC[16:47];
and you decide what do you put in your memory location addressed by [ds:idt].
put there correct linear address as manual requires
Stanislav
Code: Select all
_idt:
%rep 51
make_idt_entry ;(32+16+3) ; exceptions+interrupts+syscall
%endrep
idt_end:
idtp: dw idt_end - _idt -1 ; IDT limit
dd _idt ; address of IDT
lidt [idtp]
Code: Select all
lidt [ds:idtp]