From 6d849bc12d6afe2fe239c5a7dc581ba76d67974b Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Wed, 3 Feb 2010 17:50:30 +0100 Subject: Start syscall work --- src/stem/task/idt.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/stem/task/idt.c') diff --git a/src/stem/task/idt.c b/src/stem/task/idt.c index b9bd1ef..7c05e2e 100644 --- a/src/stem/task/idt.c +++ b/src/stem/task/idt.c @@ -3,6 +3,7 @@ #include #include #include "task.h" +#include "syscall.h" #include @@ -56,6 +57,8 @@ extern void irq13(); extern void irq14(); extern void irq15(); +extern void syscall64(); + extern void idt_flush(int32_t ptr); struct idt_entry idt_entries[256]; @@ -91,6 +94,10 @@ void idt_irqHandler(struct registers regs) { if (doSwitch) tasking_switch(); } +void idt_syscallHandler(struct registers regs) { + syscalls[regs.eax](®s); +} + static void idt_setGate(uint8_t num, uint32_t base, uint16_t sel, uint8_t flags) { idt_entries[num].base_lo = base & 0xFFFF; idt_entries[num].base_hi = (base >> 16) & 0xFFFF; @@ -168,6 +175,8 @@ void idt_init() { idt_setGate(46, (int32_t)irq14, 0x08, 0x8E); idt_setGate(47, (int32_t)irq15, 0x08, 0x8E); + idt_setGate(64, (int32_t)syscall64, 0x08, 0x8E); + idt_flush((int32_t)&idt_ptr); monitor_write("IDT ok\n"); -- cgit v1.2.3