summaryrefslogtreecommitdiff
path: root/src/kernel/task
diff options
context:
space:
mode:
authorkatchup <alexis211@gmail.com>2010-12-12 17:29:31 +0100
committerkatchup <alexis211@gmail.com>2010-12-12 17:29:31 +0100
commit07b15b375ee7cc87f476200b2fd6205959ac0ba4 (patch)
tree37176f4e76285b3971c721a027aff047b81f4a2e /src/kernel/task
parent43c6a4a1e7d76e82b9a1d4757c5b5c12f92905d7 (diff)
downloadTCE-07b15b375ee7cc87f476200b2fd6205959ac0ba4.tar.gz
TCE-07b15b375ee7cc87f476200b2fd6205959ac0ba4.zip
New heap, simple and bug-free, but inefficient.
Diffstat (limited to 'src/kernel/task')
-rw-r--r--src/kernel/task/syscall.c3
-rw-r--r--src/kernel/task/task.c3
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();