summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/gdt.c3
-rw-r--r--kernel/idt.c7
-rw-r--r--kernel/main.c4
3 files changed, 6 insertions, 8 deletions
diff --git a/kernel/gdt.c b/kernel/gdt.c
index c564f5f..8646dd6 100644
--- a/kernel/gdt.c
+++ b/kernel/gdt.c
@@ -1,5 +1,4 @@
#include <kernel/gdt.h>
-#include <kernel/tty.h>
#include <kernel/util.h>
#include <stdint.h>
@@ -108,10 +107,8 @@ static void gdt_load() {
static void gdt_check() {
// note: this only checks the r0data segment,
// it's far from a comprehensive test
- tty_const("checking gdt...");
asm("mov %0, %%ds;"
: : "r" (SEG_r0data << 3) : "memory");
- tty_const("ok ");
}
void gdt_init() {
diff --git a/kernel/idt.c b/kernel/idt.c
index cd032d3..96d6d15 100644
--- a/kernel/idt.c
+++ b/kernel/idt.c
@@ -1,7 +1,7 @@
#include <kernel/gdt.h>
#include <kernel/idt.h>
#include <kernel/isr.h>
-#include <kernel/tty.h> // used only for the selftest
+#include <kernel/panic.h>
#include <stdbool.h>
#include <stdint.h>
@@ -64,10 +64,7 @@ static void idt_load() {
static void idt_test() {
asm("int $0x34" : : : "memory");
- if (!isr_test_interrupt_called) {
- tty_const("IDT self test failed");
- for(;;);
- }
+ if (!isr_test_interrupt_called) panic();
}
void idt_init() {
diff --git a/kernel/main.c b/kernel/main.c
index 85a85d6..0193514 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -11,9 +11,13 @@ void r3_test();
void kmain()
{
tty_clear();
+ tty_const("gdt...");
gdt_init();
+ tty_const("idt...");
idt_init();
+ tty_const("sysenter...");
sysenter_setup();
+ tty_const("mem...");
mem_init();
tty_const("creating process...");