IDT question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
SystemHalted

IDT question

Post by SystemHalted »

Ive been reading tutorials on IDTs IRQs and ISRs now all I need is to know how to put my ISRs into the ITDs. Please Help.
Xenos

RE:IDT question

Post by Xenos »

You need segment:offset of each ISR to create IDT entries. Each IDT entry is 8 bytes long (it starts, say at my_idt_entry). Put the lower word of the ISR offset to [my_idt_entry], the higher word to [my_idt_entry+6]. The segment goes to [my_idt_entry+2]. The word at [my_idt_entry+4] contains information about what kind of descriptor it is. Put 0x0e00 here for an interrupt gate (IF is cleared automatically on entry, nice for IRQs) or 0x0f00 for a trap gate (IF is not cleared, used for traps like int3 etc.). That's it!
SystemHalted

RE:IDT question

Post by SystemHalted »

Great. Thanks
Post Reply