Its a stupid question but i can't find anything to help. How do i set up the IDT. Can anyone help or point me in the right derection please. thanks.
-- Darkman
Set up the IDT
RE:Set up the IDT
It's quite simple, really. The IDT is an array of 8-byte descriptors, similar to the GDT or LDT.
The first 32 are reserved to the CPU, and the rest are available for general use. It is theoretically possible to only have entries through the double-fault interrupt, but nobody is nuts enough to do that. Most people have 48 entries (the 32 CPU interrupts and the 16 hardware interrupts).
Basically, you allocate the memory for the IDT, initialize it with interrupt gates pointing to your interrupt handlers, and execute LIDT with the address and size of the table.
I'd post sample code, but the only sample I have handy is from my OS, and it would be spectacularly unenlightening (I'll post it anyway if anyone asks).
Hope this helps.
The first 32 are reserved to the CPU, and the rest are available for general use. It is theoretically possible to only have entries through the double-fault interrupt, but nobody is nuts enough to do that. Most people have 48 entries (the 32 CPU interrupts and the 16 hardware interrupts).
Basically, you allocate the memory for the IDT, initialize it with interrupt gates pointing to your interrupt handlers, and execute LIDT with the address and size of the table.
I'd post sample code, but the only sample I have handy is from my OS, and it would be spectacularly unenlightening (I'll post it anyway if anyone asks).
Hope this helps.