From cca3879a03c2a983310e25bca6a64a979aa9c3ef Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 5 Jun 2020 23:15:06 +0200 Subject: Fixed many HUGE bugs... --- src/kernel/tasks/process.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/kernel/tasks/process.c') diff --git a/src/kernel/tasks/process.c b/src/kernel/tasks/process.c index a4c1c79..ee657c4 100644 --- a/src/kernel/tasks/process.c +++ b/src/kernel/tasks/process.c @@ -24,15 +24,14 @@ void scheduler(struct regs *regs) static int locked = 0; spinlock(&locked); - serial_put('.'); - if (quantum == 0 || current_proc->state != PROC_RUNNING) { - quantum = 42; // For next process - } else { - quantum--; - locked = 0; - sti(); - return; - } + /* serial_put('.'); */ + /* if (quantum == 0 || current_proc->state != PROC_RUNNING) { */ + /* quantum = 42; // For next process */ + /* } else { */ + /* quantum--; */ + /* locked = 0; */ + /* return; */ + /* } */ serial_put('+'); memcpy(¤t_proc->regs, regs, sizeof(struct regs)); @@ -56,6 +55,7 @@ void scheduler(struct regs *regs) memcpy(regs, ¤t_proc->regs, sizeof(struct regs)); paging_switch_dir(current_proc->cr3); + log("%x", regs->cs); if (regs->cs != 0x1B) { regs->gs = 0x23; regs->fs = 0x23; @@ -75,7 +75,6 @@ void process_force_switch() //scheduler(regs); } -u32 hl_cr3; u32 hl_eip; u32 hl_esp; void process_init(struct process *proc) @@ -91,7 +90,7 @@ void process_init(struct process *proc) hl_eip = proc->regs.eip; hl_esp = proc->regs.esp; - //paging_switch_dir(proc->cr3); + paging_switch_dir(proc->cr3); debug("Jumping to userspace!"); extern void userspace_jump(); -- cgit v1.2.3