From 9fde748acea83d775e367a64858414b674f05b13 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sat, 8 Sep 2018 17:08:55 +0200 Subject: struggling with pic and lapic and smp... --- kernel/scheduler.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'kernel/scheduler.c') diff --git a/kernel/scheduler.c b/kernel/scheduler.c index 1cbd658..72165f9 100644 --- a/kernel/scheduler.c +++ b/kernel/scheduler.c @@ -159,11 +159,12 @@ volatile uint32_t my_scheduler(uint32_t oldesp,uint32_t force_pid) if(!first) task_list[current_task].esp=oldesp; first=false; // + if(force_pid>-1) { int pid=force_pid; current_task=pid; - install_tss(task_list[pid].esp0); + install_tss(0,task_list[pid].esp0); x86_set_page_directory(task_list[pid].vmem); return task_list[pid].esp; @@ -178,7 +179,7 @@ volatile uint32_t my_scheduler(uint32_t oldesp,uint32_t force_pid) //if(current_task!=pid)klog("switch from %d to %d", current_task, pid); current_task=pid; - install_tss(task_list[pid].esp0); + install_tss(0,task_list[pid].esp0); x86_set_page_directory(task_list[pid].vmem); return task_list[pid].esp; @@ -270,12 +271,6 @@ volatile void scheduler_init(void *dir) task_pusha(task_list[2].esp); // task_pusha(task_list[1].esp); task_pusha(task_list[0].esp); - - // finally enable interrrupts so the scheduler is called (by timer) - x86_sti(); - - // loop until scheduler kicks in and reschedules us... - while(1); } volatile int task_get_current_pid() -- cgit v1.2.3