src/gdt.c
/* Use this function to set an entry in the IDT. Alot simpler
*  than twiddling with the GDT ;) */
Use this function to set an entry in the IDT. Alot simpler
than twiddling with the GDT ;)
Use this function to set an entry in the IDT . Alot simpler than twiddling with the GDT ; )
void idt_set_gate(uchar num, u32 base, u16 sel, uchar flags)
{
    idt[num].base_lo    = base & 0xffff;
    idt[num].base_hi    = (base >> 16) & 0xffff;
    idt[num].sel        = sel;
    idt[num].flags      = flags;
    idt[num].always0    = 0xff;
}
void idt_set_gate ( uchar num , u32 base , u16 sel , uchar flags ) { idt [ num ] . base_lo = base & 0xffff ; idt [ num ] . base_hi = ( base >> 16 ) & 0xffff ; idt [ num ] . sel = sel ; idt [ num ] . flags = flags ; idt [ num ] . always0 = 0xff ; }
Use this function to set an entry in the IDT.
Use this function to set an entry in the IDT .
/* 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 */