diff options
author | Alexis211 <alexis211@gmail.com> | 2010-03-24 15:40:16 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-03-24 15:40:16 +0100 |
commit | dbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd (patch) | |
tree | 793b49a6b89c1113c74ae3ee97d197f6070cb7a7 /src/kernel/task | |
parent | cbadacbb881200b601c7b53b29aa0c1b78747692 (diff) | |
download | TCE-dbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd.tar.gz TCE-dbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd.zip |
IPC not tested but suposedly working.
Diffstat (limited to 'src/kernel/task')
-rw-r--r-- | src/kernel/task/idt.c | 2 | ||||
-rw-r--r-- | src/kernel/task/syscall.c | 21 | ||||
-rw-r--r-- | src/kernel/task/task.c | 7 | ||||
-rw-r--r-- | src/kernel/task/task.h | 2 | ||||
-rw-r--r-- | src/kernel/task/timer.c | 2 |
5 files changed, 30 insertions, 4 deletions
diff --git a/src/kernel/task/idt.c b/src/kernel/task/idt.c index 0f3c2f2..80f13db 100644 --- a/src/kernel/task/idt.c +++ b/src/kernel/task/idt.c @@ -186,7 +186,7 @@ void idt_init() { idt_flush((int32_t)&idt_ptr); - monitor_write("IDT ok\n"); + monitor_write("[IDT] "); } void idt_handleIrq(int number, int_callback func) { diff --git a/src/kernel/task/syscall.c b/src/kernel/task/syscall.c index 51c46f1..dd909e0 100644 --- a/src/kernel/task/syscall.c +++ b/src/kernel/task/syscall.c @@ -6,9 +6,12 @@ r->eax = name(r->ebx); } #define CALL2(name, scname) static void scname(struct registers* r) { \ r->eax = name(r->ebx, r->ecx); } +#define CALL3(name, scname) static void scname(struct registers* r) { \ + r->eax = name(r->ebx, r->ecx, r->edx); } #define CALL0V(name, scname) static void scname(struct registers* r) { name(); } #define CALL1V(name, scname) static void scname(struct registers* r) { name(r->ebx); } #define CALL2V(name, scname) static void scname(struct registers* r) { name(r->ebx, r->ecx); } +#define CALL3V(name, scname) static void scname(struct registers* r) { name(r->ebx, r->ecx, r->edx); } CALL0V(thread_exit, thread_exit_sc); CALL0V(tasking_switch, schedule_sc); @@ -19,6 +22,15 @@ CALL1V(idt_waitIrq, irq_wait_sc); CALL0(proc_priv, proc_priv_sc); CALL2(shm_create, shm_create_sc); CALL1(shm_delete, shm_delete_sc); +CALL0(object_create, object_create_sc); +CALL1(object_owned, object_owned_sc); +CALL1V(object_close, object_close_sc); +CALL3(request_get, request_get_sc); +CALL1(request_has, request_has_sc); +CALL3V(request_answer, request_answer_sc); +CALL3(request_mapShm, request_mapShm_sc); +CALL2(request, request_sc); +CALL2(send_msg, send_msg_sc); static void thread_new_sc(struct registers* r) { thread_new(current_thread->process, (thread_entry)r->ebx, (void*)r->ecx); @@ -35,4 +47,13 @@ int_callback syscalls[] = { proc_priv_sc, shm_create_sc, shm_delete_sc, + object_create_sc, //10 + object_owned_sc, + object_close_sc, + request_get_sc, + request_has_sc, + request_answer_sc, //15 + request_mapShm_sc, + request_sc, + send_msg_sc, 0 }; diff --git a/src/kernel/task/task.c b/src/kernel/task/task.c index 6959676..dec7565 100644 --- a/src/kernel/task/task.c +++ b/src/kernel/task/task.c @@ -4,6 +4,7 @@ #include <mem/mem.h> #include <mem/seg.h> #include <mem/gdt.h> +#include <ipc/object.h> #include "timer.h" #define KSTACKSIZE 0x8000 @@ -39,7 +40,7 @@ void tasking_init() { idle_thread = thread_new(kernel_process, task_idle, 0); threads = 0; //Do not include idle thread in threads sti(); - monitor_write("Tasking set up\n"); + monitor_write("[Tasking] "); } static struct thread *thread_next() { @@ -130,6 +131,10 @@ void thread_goInactive() { tasking_switch(); } +void thread_wakeUp(struct thread* t) { + if (t->state == TS_WAKEWAIT) t->state = TS_RUNNING; +} + int proc_priv() { if (current_thread == 0) return PL_UNKNOWN; return current_thread->process->privilege; diff --git a/src/kernel/task/task.h b/src/kernel/task/task.h index b2a5434..1c22785 100644 --- a/src/kernel/task/task.h +++ b/src/kernel/task/task.h @@ -3,7 +3,6 @@ #include <types.h> #include <mem/paging.h> -#include <ipc/object.h> #include "idt.h" #define TS_RUNNING 0 @@ -57,6 +56,7 @@ uint32_t tasking_handleException(struct registers *regs); void thread_sleep(uint32_t msecs); void thread_goInactive(); //Blocks the current thread. another one must be there to wake it up at some point. +void thread_wakeUp(struct thread *t); int proc_priv(); //Returns current privilege level void thread_exit(); void process_exit(uint32_t retval); diff --git a/src/kernel/task/timer.c b/src/kernel/task/timer.c index 8c1a2b8..e924657 100644 --- a/src/kernel/task/timer.c +++ b/src/kernel/task/timer.c @@ -32,5 +32,5 @@ void timer_init(uint32_t freq) { outb(0x40, l); outb(0x40, h); - monitor_write("Timer started\n"); + monitor_write("[PIT] "); } |