diff --git a/arch/x86/kernel/entry.asm b/arch/x86/kernel/entry.asm index a9d85364..f24b33dd 100644 --- a/arch/x86/kernel/entry.asm +++ b/arch/x86/kernel/entry.asm @@ -103,14 +103,7 @@ gdt_flush: flush2: ret -; Loads the IDT defined in '_idtp' into the processor. -; This is declared in C as 'extern void idt_load();' -global idt_load -extern idtp -idt_load: - lidt [idtp] - ret - +; determines the current instruction pointer (after the jmp) global read_eip read_eip: pop eax ; Get the return address diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index 20f620a1..0f231931 100644 --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -43,10 +43,7 @@ typedef struct { * "Unhandled Interrupt" exception */ static idt_entry_t idt[256] = {[0 ... 255] = {0, 0, 0, 0, 0}}; -idt_ptr_t idtp; - -/* This exists in 'start.asm', and is used to load our IDT */ -extern void idt_load(void); +static idt_ptr_t idtp; /* * Use this function to set an entry in the IDT. Alot simpler @@ -81,5 +78,5 @@ void idt_install(void) IDT_FLAG_PRESENT|IDT_FLAG_RING3|IDT_FLAG_32BIT|IDT_FLAG_TRAPGATE); /* Points the processor's internal register to the new IDT */ - idt_load(); + asm volatile("lidt %0" : : "m" (idtp)); }