diff options
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/boot/gdt.h | 3 | ||||
-rw-r--r-- | kernel/include/boot/interrupts.h (renamed from kernel/include/boot/idt.h) | 19 |
2 files changed, 13 insertions, 9 deletions
diff --git a/kernel/include/boot/gdt.h b/kernel/include/boot/gdt.h index 237628c..60baab8 100644 --- a/kernel/include/boot/gdt.h +++ b/kernel/include/boot/gdt.h @@ -86,6 +86,9 @@ ((base >> 24) & 0xff) /* base_high */ \ } +#define GDT_KERNEL_CODE_OFFSET 0x8 +#define GDT_KERNEL_DATA_OFFSET 0x10 + namespace GDT { diff --git a/kernel/include/boot/idt.h b/kernel/include/boot/interrupts.h index bb424e9..42a0ba9 100644 --- a/kernel/include/boot/idt.h +++ b/kernel/include/boot/interrupts.h @@ -16,22 +16,23 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __boot_idt_h -#define __boot_idt_h +#ifndef __boot_interrupts_h +#define __boot_interrupts_h +#include <boot/gdt.h> #include <common.h> #include <stdint.h> #define IDT_ENTRY(isr, attributes) \ { \ - (isr & 0xffff), /* isr_low */ \ - 0x08, /* segment_selector */ \ - 0, /* reserved */ \ - attributes, /* attributes */ \ - (isr >> 16) /* isr_high */ \ + (isr & 0xffff), /* isr_low */ \ + GDT_KERNEL_CODE_OFFSET, /* segment_selector */ \ + 0, /* reserved */ \ + attributes, /* attributes */ \ + (isr >> 16) /* isr_high */ \ } -namespace IDT +namespace Interrupts { typedef struct { @@ -47,7 +48,7 @@ typedef struct { entry_t *ptr; /* Address of IDT */ } PACKED descriptor_t; -void load(void); +void load_idt(void); extern "C" NORETURN void exception_handler(void); } |