diff options
Diffstat (limited to 'src/kernel/task')
-rw-r--r-- | src/kernel/task/syscall.c | 3 | ||||
-rw-r--r-- | src/kernel/task/task.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/kernel/task/syscall.c b/src/kernel/task/syscall.c index 46ccff6..3ae546f 100644 --- a/src/kernel/task/syscall.c +++ b/src/kernel/task/syscall.c @@ -1,5 +1,6 @@ #include "syscall.h" #include "task.h" +#include <core/sys.h> #define CALL0(name, scname) static void scname(struct registers* r) { r->eax = name(); } #define CALL1(name, scname) static void scname(struct registers* r) { \ @@ -26,7 +27,9 @@ CALL2(shm_create, shm_create_sc); CALL1(shm_delete, shm_delete_sc); static void thread_new_sc(struct registers* r) { + cli(); thread_new(current_thread->process, (thread_entry)r->ebx, (void*)r->ecx, (void*)r->edx); + sti(); } int_callback syscalls[NUMBER_OF_SYSCALLS] = { diff --git a/src/kernel/task/task.c b/src/kernel/task/task.c index f074c77..3d322c1 100644 --- a/src/kernel/task/task.c +++ b/src/kernel/task/task.c @@ -35,9 +35,9 @@ void tasking_init() { kernel_process->parent = kernel_process; kernel_process->pagedir = kernel_pagedir; kernel_process->next = 0; + kernel_process->threads = 0; current_thread = 0; idle_thread = thread_new(kernel_process, task_idle, 0, 0); - kernel_process->threads = idle_thread; sti(); monitor_write("[Tasking] "); } @@ -278,6 +278,7 @@ struct process *process_new(struct process* parent, uint32_t uid, uint32_t privi p->pid = (nextpid++); p->uid = uid; p->thread_count = 0; + p->threads = 0; p->privilege = privilege; p->parent = parent; p->pagedir = pagedir_new(); |