diff options
author | Alexis211 <alexis211@gmail.com> | 2010-02-03 17:50:30 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-02-03 17:50:30 +0100 |
commit | 6d849bc12d6afe2fe239c5a7dc581ba76d67974b (patch) | |
tree | a227121ed4e5d3ef86d5047fed7b5a0bbef33ead /src/stem/task/idt.c | |
parent | 9c4310651a91e64c10a17f3190c895a49096aeb1 (diff) | |
download | TCE-6d849bc12d6afe2fe239c5a7dc581ba76d67974b.tar.gz TCE-6d849bc12d6afe2fe239c5a7dc581ba76d67974b.zip |
Start syscall work
Diffstat (limited to 'src/stem/task/idt.c')
-rw-r--r-- | src/stem/task/idt.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 <core/sys.h> #include <mem/paging.h> #include "task.h" +#include "syscall.h" #include <stdlib.h> @@ -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"); |