summaryrefslogtreecommitdiff
path: root/kernel/scheduler.c
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-08 17:08:55 +0200
committerMiguel <m.i@gmx.at>2018-09-08 17:08:55 +0200
commit9fde748acea83d775e367a64858414b674f05b13 (patch)
tree0927b570c07c9ee469817a560b965c094c5d8145 /kernel/scheduler.c
parentaa4b4c6c1918a51318709761873d1c5e248a831d (diff)
struggling with pic and lapic and smp...
Diffstat (limited to 'kernel/scheduler.c')
-rw-r--r--kernel/scheduler.c11
1 files changed, 3 insertions, 8 deletions
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()