32 lines
908 B
C
32 lines
908 B
C
|
/******************************************************************
|
||
|
* idt.h - INTERRUPT DESCRIPTOR TABLE *
|
||
|
* Contains structures and function declarations for IDT *
|
||
|
******************************************************************/
|
||
|
|
||
|
#ifndef __IDT_H
|
||
|
#define __IDT_H
|
||
|
|
||
|
/* Defines an IDT entry */
|
||
|
struct idt_entry
|
||
|
{
|
||
|
unsigned short base_lo;
|
||
|
unsigned short sel;
|
||
|
unsigned char always0;
|
||
|
unsigned char flags;
|
||
|
unsigned short base_hi;
|
||
|
} __attribute__((packed));
|
||
|
|
||
|
struct idt_ptr
|
||
|
{
|
||
|
unsigned short limit;
|
||
|
unsigned int base;
|
||
|
} __attribute__((packed));
|
||
|
|
||
|
|
||
|
/* This exists in 'start.asm', and is used to load our IDT */
|
||
|
extern void i86_idt_load();
|
||
|
extern void i86_idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags);
|
||
|
extern struct idt_entry* i86_idt_get_gate(unsigned char num);
|
||
|
extern void i86_idt_install();
|
||
|
|
||
|
#endif
|