Interrupt Descriptor Table.
More...
|
enum | idt_entry_type_t {
TASK_32 = 0x5,
INTR_16,
TRAP_16,
INTR_32 = 0xE,
TRAP_32
} |
| Different types of interrupt vectors. More...
|
|
Interrupt Descriptor Table.
The IDT maps interrupt vectors to interrupt service routines (ISRs) to allow handling of exceptions, IRQs (Interrupt Requests) and system calls. Here all interrupt vectors are mapped to the same common interrupt handler.
- See also
- http://wiki.osdev.org/Interrupts
-
http://wiki.osdev.org/IDT
-
http://wiki.osdev.org/8259_PIC
-
http://wiki.osdev.org/Interrupt_Service_Routines
-
http://wiki.osdev.org/Selector
Number of entries in the IDT.
Only the entries 0x00-0x30 are actually used.
Definition at line 11 of file idt.h.
Value:extern void isr_intr_##nr();
\ static void idt_init_entry_isr(size_t entry, void(*func)(), uint8_t dpl)
Shorthand for initializing an ISR.
shorthand for initializing an ISR
- See also
- isr_intr in isr_asm.S
Definition at line 25 of file idt.c.
Different types of interrupt vectors.
Here we only use 32-bit interrupt gates.
Definition at line 35 of file idt.c.
Initializes the IDT.
Sets up all the exceptions and IRQs as kernel-only (RING0) interrupts.
Sets up 0x30 as a syscall interrupt which might be called from RING3.
Definition at line 99 of file idt.c.
static void idt_init_entry |
( |
size_t |
entry, |
|
|
uintptr_t |
func, |
|
|
uint32_t |
selector, |
|
|
idt_entry_type_t |
type, |
|
|
uint8_t |
st, |
|
|
uint8_t |
dpl, |
|
|
uint8_t |
pr |
|
) |
| |
|
static |
Initializes an IDT entry.
- Parameters
-
entry | index into the IDT |
func | pointer to ISR |
selector | code segment of ISR, usually the kernel code segment |
type | interrupt vector type, usually a 32-bit interrupt gate |
st | storage segment flag |
dpl | maximum allowed privilege level (0=kernel, 3=user space) |
pr | present flag |
Definition at line 69 of file idt.c.
static void idt_init_entry_isr |
( |
size_t |
entry, |
|
|
void(*)() |
func, |
|
|
uint8_t |
dpl |
|
) |
| |
|
static |
Shorthand for initializing an ISR.
- Parameters
-
entry | index into the IDT |
func | pointer to ISR |
dpl | maximum allowed privilege level (0=kernel, 3=user space) |
Definition at line 87 of file idt.c.
The IDT itself.
Like the GDT, it is located inside the kernel. It is important that the IDT is always mapped into the same place in memory when using paging, otherwise interrupts lead to triple faults.
- See also
- vmm_init
Definition at line 57 of file idt.c.