@ GDT_KERNEL_CODE
Kernel code segment selector.
void idt_init(void)
Initialize the IDT structure in memory.
idt_attributes_t
IDT gate attributes.
void idt_cpu_load(void)
Load the IDT on the current CPU.
@ IDT_ATTR_PRESENT
Must be set for the entry to be valid.
@ IDT_ATTR_RING0
Can be invoked from ring 0 or hardware only.
@ IDT_ATTR_INTERRUPT
Interrupt gate, will disable interrupts when invoked.
void * vectorTable[INTERRUPT_AMOUNT]
Pointers to functions to handle each vector.
interrupt_t
CPU vector identifiers.
tss_ist_t
Interrupt Stack Table indices.
#define TSS_IST_INTERRUPT
The IST index to use for other interrupts.
#define TSS_IST_EXCEPTION
The IST index to use for exceptions.
#define TSS_IST_DOUBLE_FAULT
The IST index to use for double faults.
#define ALIGNED(alignment)
GCC aligned attribute.
#define PAGE_SIZE
Memory page size.
static idt_gate_t idt_gate(void *vectorHandler, idt_attributes_t attr, tss_ist_t ist)
void idt_load_descriptor(idt_desc_t *descriptor)
IDT descriptor structure.
uint16_t size
Size of the IDT in bytes - 1.
uint64_t offset
Address of the IDT.
uint8_t attributes
Type and attributes, see idt_attributes_t.
uint8_t ist
Interrupt Stack Table offset, 0 = dont use IST, see tss_t.
uint16_t offsetLow
Lower 16 bits of handler function address.
uint32_t offsetHigh
Upper 32 bits of handler function address.
uint16_t codeSegment
Code segment selector in the GDT.
uint16_t offsetMid
Middle 16 bits of handler function address.