From 9915d1fc1b15247e4f4c9b19342a48f9f53ad526 Mon Sep 17 00:00:00 2001 From: Sriram Shanmuga <40335840+RaamyPi@users.noreply.github.com> Date: Tue, 21 Jul 2020 18:52:31 +0530 Subject: [PATCH 1/2] Updated idt.h `18-interrupts` Fix to get rid any possible multiple definition errors in `18-interrupts` --- 18-interrupts/cpu/idt.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/18-interrupts/cpu/idt.h b/18-interrupts/cpu/idt.h index 27bfac5a..e8549a36 100644 --- a/18-interrupts/cpu/idt.h +++ b/18-interrupts/cpu/idt.h @@ -28,9 +28,8 @@ typedef struct { } __attribute__((packed)) idt_register_t; #define IDT_ENTRIES 256 -idt_gate_t idt[IDT_ENTRIES]; -idt_register_t idt_reg; - +extern idt_gate_t idt[IDT_ENTRIES]; +extern idt_register_t idt_reg; /* Functions implemented in idt.c */ void set_idt_gate(int n, u32 handler); From 231a854b3de9fa3782e49149b1f80142985575ef Mon Sep 17 00:00:00 2001 From: Sriram Shanmuga <40335840+RaamyPi@users.noreply.github.com> Date: Tue, 21 Jul 2020 18:53:59 +0530 Subject: [PATCH 2/2] Updated idt.c `18-interrupts` Fix to get rid any possible multiple definition errors in `18-interrupts` --- 18-interrupts/cpu/idt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/18-interrupts/cpu/idt.c b/18-interrupts/cpu/idt.c index 999d0c94..cdb7e99b 100644 --- a/18-interrupts/cpu/idt.c +++ b/18-interrupts/cpu/idt.c @@ -1,6 +1,9 @@ #include "idt.h" #include "../kernel/util.h" +idt_gate_t idt[IDT_ENTRIES]; +idt_register_t idt_reg; + void set_idt_gate(int n, u32 handler) { idt[n].low_offset = low_16(handler); idt[n].sel = KERNEL_CS;