Finish refactor, add 0x80 and 0x81 to IDT
diff --git a/src/kernel/descriptor_tables.c b/src/kernel/descriptor_tables.c
index 94f62df..211dcb2 100644
--- a/src/kernel/descriptor_tables.c
+++ b/src/kernel/descriptor_tables.c
@@ -89,6 +89,9 @@
idt_set_gate(i, (uint)isrs[i], 0x08, 0x8e);
}
+ idt_set_gate(0x80, (uint)isr128, 0x08, 0x8e);
+ idt_set_gate(0x81, (uint)isr129, 0x08, 0x8e);
+
idt_flush((uint)&idt_pointer);
vga_write("IDT Initialized!\n");
diff --git a/src/kernel/descriptor_tables.h b/src/kernel/descriptor_tables.h
index b35f670..0c9f5f1 100644
--- a/src/kernel/descriptor_tables.h
+++ b/src/kernel/descriptor_tables.h
@@ -104,6 +104,11 @@
extern void isr30();
extern void isr31();
+// Syscall
+extern void isr128();
+// Tasking setup
+extern void isr129();
+
extern void irq0();
extern void irq1();
extern void irq2();
diff --git a/src/kernel/idt.s b/src/kernel/idt.s
index 3e2ce5d..7cd26e6 100644
--- a/src/kernel/idt.s
+++ b/src/kernel/idt.s
@@ -56,6 +56,8 @@
ISRNOERR 30
ISRNOERR 31
+ISRNOERR 128
+ISRNOERR 129
[extern isr_handler]
isr_common:
diff --git a/src/kernel/main.c b/src/kernel/main.c
index 876c647..fc9ee22 100644
--- a/src/kernel/main.c
+++ b/src/kernel/main.c
@@ -80,11 +80,11 @@
init_tasks();
kprintf("\ndone initializing tasks\n");
-#ifdef TEST_THREADS
+//#ifdef TEST_THREADS
spawn_thread(other_thread, NULL);
greet();
-#endif
+//#endif
#ifdef TEST_ATA_PIO
test_ata_pio();
diff --git a/src/kernel/task.c b/src/kernel/task.c
index 53a31e6..564119a 100644
--- a/src/kernel/task.c
+++ b/src/kernel/task.c
@@ -17,7 +17,7 @@
{
add_interrupt_handler(INIT_TASKS_INTERRUPT, _sys_init_tasks_h);
- asm("int $0x80");
+ asm("int $0x81");
}
void _sys_init_tasks_h(struct registers *regs)
@@ -27,7 +27,7 @@
void _init_tasks(uint kernel_esp, uint kernel_ebp, uint kernel_eip)
{
- kpanic("_init_tasks\n");
+ kprintf("_init_tasks\n");
processes[0] = (struct process){
.exists = true,