diff options
| author | Miguel <m.i@gmx.at> | 2018-09-12 02:49:47 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-12 02:49:47 +0200 |
| commit | 800b1a878ec34a8ff30ed093e20561182fa6ae36 (patch) | |
| tree | a28b81c60bb1bc08aa2ab11750ca5d13aed2354a /kernel/scheduler.c | |
| parent | a3ee159ebfd2d088432e386e8809840784f697e7 (diff) | |
vmem_add_generic rework delete old shit
Diffstat (limited to 'kernel/scheduler.c')
| -rw-r--r-- | kernel/scheduler.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/kernel/scheduler.c b/kernel/scheduler.c index d0b4b68..1b2a70a 100644 --- a/kernel/scheduler.c +++ b/kernel/scheduler.c @@ -115,7 +115,7 @@ volatile uint32_t scheduler_run(uint32_t oldesp,uint32_t force_pid) void scheduler_func() { - // we need enable here again (since the pushed eflags have it disabled)? TODO: why?? + // we need enable here again (since the pushed eflags have it disabled)? TODO: why they disabled it!??? x86_sti(); uint32_t cpu=smp_get(SMP_APIC_ID); @@ -143,33 +143,6 @@ void scheduler_func() } } - //asm("hlt"); - /* - - // if we are pid 0, replace ourselves with /bin/init and enter usermode - if(task_get_current_pid()==0) - { - uint32_t alloc; - uint32_t entry_global=load_elf(BIN_INIT,&alloc); - task_set_brk(alloc); - asm_usermode(entry_global); - } - - // kernel worker thread: SLEEPER - if(task_get_current_pid()==1) - { - while(1) - { - __asm__("hlt"); - } - } - - // kernel worker thread: SYSCALL CHECKER - if(task_get_current_pid()==2) - { - task_syscall_worker(); - } - */ volatile int task_reset(uint32_t pid, uint32_t entry, uint32_t stack) { @@ -241,7 +214,8 @@ void task_syscall_worker() { if(task_list[cpu][i].wait) { - // klog("task %d waiting on syscall %d. processing...",i,task_list[cpu][i].eax); + uint32_t syscall=task_list[cpu][i].eax; + klog("task %d waiting on syscall %d/%s. processing...",i,syscall,syscall_get_name(syscall)); task_list[cpu][2].vmem=task_list[cpu][i].vmem; // switch syscall worker to pagedir of calling userprog x86_set_page_directory(task_list[cpu][2].vmem); @@ -306,7 +280,7 @@ volatile uint32_t task_exit(uint32_t pid) if(task_list[cpu][parent_pid].wait&&task_list[cpu][parent_pid].eax==SYSCALL_WAIT) task_list[cpu][parent_pid].wait=false; klog("[%d] exit", pid); - vmem_free_dir(task_list[cpu][pid].vmem); +// vmem_free_dir(task_list[cpu][pid].vmem); return 1; } |
