diff options
Diffstat (limited to 'src/idt/idt.c')
-rw-r--r-- | src/idt/idt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/idt/idt.c b/src/idt/idt.c index 3c0c246..c442044 100644 --- a/src/idt/idt.c +++ b/src/idt/idt.c @@ -21,6 +21,18 @@ struct idt_ptr idtp; // Defined in boot.asm extern void idt_load(); +void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags) { + // Specify the interrupt routine's base address + idt[num].base_lo = (base & 0xFFFF); + idt[num].base_hi = (base >> 16) & 0xFFFF; + + // Set selector/segment of IDT entry + idt[num].sel = sel; + idt[num].always0 = 0; + idt[num].flags = flags; +} + + // Install IDT void idt_install() { // Set IDT pointer and limit |