From a282cb8c921299b54a719452ec2bdaff63d8d3e9 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 18 Oct 2018 12:26:18 +0200 Subject: New Scheduling / Syscalls! --- kernel/interrupts.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'kernel/interrupts.c') diff --git a/kernel/interrupts.c b/kernel/interrupts.c index 8bc4f47..702112c 100644 --- a/kernel/interrupts.c +++ b/kernel/interrupts.c @@ -122,9 +122,9 @@ uint32_t interrupt_handler(uint32_t esp, uint32_t irq) if(irq==INTERRUPT_SYSCALL) { int pid=task_get_current_pid(); - uint32_t *stack; - stack=esp; + stack=esp; + task_set_esp(pid,esp); // this will get fucked if we get scheduled away... // extract variables from stack // (NOTE we pass them in some fucked up order, @@ -148,11 +148,9 @@ uint32_t interrupt_handler(uint32_t esp, uint32_t irq) // it will also not work with SMP while(true) { - // x86_cli(); int ok=syscall_generic_test(eax,edx,ecx,ebx,pid); - // x86_sti(); if(ok)break; - else __asm__("int $0x81"); + __asm__("int $0x81");// does NOT requie interrupts } // uff, once we got through we can do the syscall and get out -- cgit v1.2.3