From b518f39803eaaf0b25b95baf951b12ef4d5a727e Mon Sep 17 00:00:00 2001 From: Miguel Date: Mon, 1 Oct 2018 14:37:18 +0200 Subject: struggling with interrupts and scheduler --- kernel/scheduler.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kernel/scheduler.c') diff --git a/kernel/scheduler.c b/kernel/scheduler.c index ff46889..fa32ebc 100644 --- a/kernel/scheduler.c +++ b/kernel/scheduler.c @@ -123,6 +123,7 @@ static uint32_t scheduler_schedule(uint32_t idx) if(current_task[cpu]!=0)last_task[cpu]=current_task[cpu]; current_task[cpu]=idx; + klog("%d",idx); // klog("%d idx %d",last_task[cpu],current_task[cpu]); install_tss(cpu,task_list[cpu][idx].esp0); @@ -227,7 +228,7 @@ void scheduler_func() } } -volatile int add_task(uint32_t parent_pid,uint32_t vmem, bool thread) +volatile int add_task(uint32_t parent_pid,uint32_t vmem, bool thread, char *name) { static bool first=true; @@ -270,7 +271,7 @@ volatile int add_task(uint32_t parent_pid,uint32_t vmem, bool thread) if(!thread&&first) { compositor_add_window(vmem); - //first=false; + first=false; } return task_list[cpu][i].pid; @@ -320,6 +321,7 @@ void task_syscall_worker() x86_sti(); if(wake)scheduler_wake_all(); + if(cpu==0)compositor_swap_buffers(); for(int i=0;i