aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-04-01 11:38:00 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-08-12 10:13:59 +0300
commita6c1174b3fb598cd59c1668cfc4d4746ab688079 (patch)
tree85e2c3e37ef0c9602c56873332b98311e655e6e5 /src
parentInitial commit (diff)
downloadkernel-a6c1174b3fb598cd59c1668cfc4d4746ab688079.tar.xz
lidt
Diffstat (limited to 'src')
-rw-r--r--src/isr.c35
-rw-r--r--src/kernel.c7
2 files changed, 42 insertions, 0 deletions
diff --git a/src/isr.c b/src/isr.c
new file mode 100644
index 0000000..c94d37e
--- /dev/null
+++ b/src/isr.c
@@ -0,0 +1,35 @@
+/*
+ * Interrupt Service Routines
+ */
+
+#include <idt.h>
+#include <stdio.h>
+#include <sys/control.h>
+
+__attribute__((interrupt)) void
+abort_handler(struct interrupt_frame *frame)
+{
+ printf("abort\n");
+ abort();
+}
+
+__attribute__((interrupt)) void
+interrupt_handler(struct interrupt_frame *frame)
+{
+ printf("interrupt\n");
+ abort();
+}
+
+__attribute__((interrupt)) void
+interrupt_handler_e(struct interrupt_frame *frame, uint32_t error)
+{
+ printf("interrupt\n");
+ abort();
+}
+
+__attribute__((interrupt)) void
+syscall_handler(struct interrupt_frame *frame)
+{
+ printf("interrupt\n");
+ abort();
+}
diff --git a/src/kernel.c b/src/kernel.c
index b84d7ee..f7f9d6d 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -1,13 +1,18 @@
#include "mem.h"
#include <gdt.h>
+#include <idt.h>
#include <stdio.h>
+#include "devices/pic.h"
#include "devices/uart_16550.h"
#include "devices/vga.h"
void kmain() {
+ pic_init();
+
gdt_install();
+ idt_install();
if (uart_init(COM1) != 0) printf("UART self-test failed.\r\n");
@@ -19,6 +24,8 @@ void kmain() {
char *c = (char *)0xc0700000;
if (*c == 0) printf("c is 0\r\n");
+ asm volatile("int $0x80");
+
while (1)
;
}