aboutsummaryrefslogtreecommitdiff
path: root/src/idt/interruptgate.cc
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-02-28 22:39:25 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-02-28 22:39:25 +0200
commitae4265ea5d77b68757af39d73fe47df1a3563b42 (patch)
tree7282e3d43c471b195bb5a4742ed911c7b7626dcb /src/idt/interruptgate.cc
parentFix interrupts causing exception 0xd (diff)
downloadkernel.cpp-ae4265ea5d77b68757af39d73fe47df1a3563b42.tar.xz
Add keyboard driver
Diffstat (limited to 'src/idt/interruptgate.cc')
-rw-r--r--src/idt/interruptgate.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/idt/interruptgate.cc b/src/idt/interruptgate.cc
new file mode 100644
index 0000000..0dbcce2
--- /dev/null
+++ b/src/idt/interruptgate.cc
@@ -0,0 +1,10 @@
+#include "../idt.h"
+
+static_assert(sizeof(IDT::Entry) == 8); // size of IDT::Entry in protected mode is 64 bits
+
+IDT::Entry::Entry(void (*handler)(), uint16_t select, IDT::InterruptType t) {
+ offset_0_15 = reinterpret_cast<uint32_t>(handler) & 0xffff;
+ offset_16_31 = (reinterpret_cast<uint32_t>(handler) >> 16) & 0xffff;
+ selector = select;
+ type = t;
+}