aboutsummaryrefslogtreecommitdiff
path: root/src/int/idt.h
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-04-12 10:13:21 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-04-12 10:13:21 +0200
commit39713a3736145483dd3310c3605f940ca34f05c3 (patch)
treed4dcdf0f3b667a5d706aa4b04501a71facf186bd /src/int/idt.h
parent6edeba8fe208fb019aec00fdc72b97407a8078d3 (diff)
Refactoring
Diffstat (limited to 'src/int/idt.h')
-rw-r--r--src/int/idt.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/int/idt.h b/src/int/idt.h
new file mode 100644
index 0000000..17c5cfa
--- /dev/null
+++ b/src/int/idt.h
@@ -0,0 +1,32 @@
+#ifndef IDT_H
+#define IDT_H
+
+#include "core/types.h"
+#include "core/mem.h"
+
+#define IDT_MAX_ENTRY 200
+#define IDT_INT_GATE 0x8E00
+#define IDT_TRAP_GATE 0xEF00
+
+typedef struct IDT_ENTRY {
+ u16 segment;
+ u32 offset;
+ u16 type;
+} IDT_ENTRY;
+
+struct IDT_REGISTER {
+ u16 limit;
+ u32 base;
+} __attribute__((packed));
+
+/**
+ * Copy IDT into memory and load it
+ */
+void idt_init();
+
+/**
+ * Write an IDT entry into memory
+ */
+void idt_write_entry(IDT_ENTRY entry,int id);
+
+#endif \ No newline at end of file