From 39713a3736145483dd3310c3605f940ca34f05c3 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 12 Apr 2021 10:13:21 +0200 Subject: Refactoring --- src/int/8042.c | 4 +-- src/int/8042.h | 2 +- src/int/idt.c | 39 +++++++++++++++++++++++ src/int/idt.h | 32 +++++++++++++++++++ src/int/int.S | 72 ++++++++++++++++++++++++++++++++++++++++++ src/int/pic.c | 99 ++++------------------------------------------------------ src/int/pic.h | 22 +++---------- 7 files changed, 156 insertions(+), 114 deletions(-) create mode 100644 src/int/idt.c create mode 100644 src/int/idt.h (limited to 'src/int') diff --git a/src/int/8042.c b/src/int/8042.c index f0a987f..5446f11 100644 --- a/src/int/8042.c +++ b/src/int/8042.c @@ -1,6 +1,6 @@ #include "8042.h" -#include "utils/framebuffer.h" -#include "utils/asm.h" +#include "core/framebuffer.h" +#include "core/asm.h" DEFINE_AZERTY; diff --git a/src/int/8042.h b/src/int/8042.h index e35e5a0..5e61ffd 100644 --- a/src/int/8042.h +++ b/src/int/8042.h @@ -1,7 +1,7 @@ #ifndef _8042_H #define _8042_H -#include "utils/types.h" +#include "core/types.h" void _8042_keypress(); diff --git a/src/int/idt.c b/src/int/idt.c new file mode 100644 index 0000000..e3e71e8 --- /dev/null +++ b/src/int/idt.c @@ -0,0 +1,39 @@ +#include "idt.h" + +struct IDT_REGISTER IDTR={ + 8*IDT_MAX_ENTRY, + 0x0 +}; + +// Interrupt functions (cf int.S) +extern u32 +INT_DEFAULT, +INT_PAGE_FAULT, +INT_CLOCK, +INT_KEYPRESS, +INT_SYSCALL; + + +void idt_init(){ + // Map first default 32 entries + for(int i=0;i