I'm using GNU-Assembler in intel syntax to write my x86 initialization routines and want to set up an IDT. The IDT requires the target address to be split into two 16-bit parts.
Now my question is, is there a possibility to let the assembler do this? I would like to have the (absolute) addresses already stored in the binary, without the need to manually set up the individual IDT entries.
In practice I would like to be able to write the following code:
Code: Select all
.macro IGATE SEL FN TP
.word (\FN & 0xffff)
.word \SEL
.byte 0
.byte \TP
.word ((\FN & 0xffff0000) >> 16)
.endm
.align 16
idt:
IGATE 0x08 gate_1 0x8f
idt_end:
gate_1:
call C_function
iret
Is there a way around this? Or is it a limitation of the relocation mechanism of stitching together different object files, so that as cannot emit a request for the upper/lower part of the symbol location to be stored at this place?