Code: Select all
void idt_set_gate(unsigned char num, unsigned long base,
unsigned short sel, unsigned char flags)
{
idt[num].base_lo = (base & 0xFFFF);
idt[num].base_hi = (base >> 16 & 0xFFFF);
idt[num].always0 = 0;
idt[num].sel = sel;
idt[num].flags = flags;
}
We'll leave you to try and code this function: take the argument 'base' and split it up into a high and low 16-bits, storing them in idt[num].base_hi and base_lo. The rest of the fields that you must set in idt[num] are fairly self- explanatory when it comes to setup.
Im not sure if it this correctly programmed, its based on GDT example of the same tutorial...