diff options
author | Marvin Borner | 2019-11-30 21:07:22 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-30 21:07:22 +0100 |
commit | 50f949d994c33ab23d63bdb9e8a438560ab0b4c4 (patch) | |
tree | 35089087979bd8cee4693c71264b1c537336e4dd /src/kernel/interrupts/idt.asm | |
parent | ac947d45c288f62e927895afe7cd6a722ffdd8f8 (diff) |
Working userspace!
Diffstat (limited to 'src/kernel/interrupts/idt.asm')
-rw-r--r-- | src/kernel/interrupts/idt.asm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/kernel/interrupts/idt.asm b/src/kernel/interrupts/idt.asm index 90eab47..f30ead1 100644 --- a/src/kernel/interrupts/idt.asm +++ b/src/kernel/interrupts/idt.asm @@ -4,3 +4,38 @@ extern idtp idt_load: lidt [idtp] ret + +global idt_syscall +extern syscall_handler +idt_syscall: + push ds + push es + push fs + push gs + pushad + + push ecx + push edx + push esi + push edi + push eax + + mov ax, 0x10 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + + call syscall_handler + + lea ebx, [5 * 4] + add esp, ebx + + mov dword [esp + (7*4)], eax + + popad + pop gs + pop fs + pop es + pop ds + iret |