diff options
author | Marvin Borner | 2020-06-05 23:15:06 +0200 |
---|---|---|
committer | Marvin Borner | 2020-06-05 23:15:06 +0200 |
commit | cca3879a03c2a983310e25bca6a64a979aa9c3ef (patch) | |
tree | f9c18d952232c8248af95f4c335b9eefe707b85d /src/kernel/tasks | |
parent | adddbaa932179669e61ad5abf50341e9cbe0e0e9 (diff) |
Fixed many HUGE bugs...
Diffstat (limited to 'src/kernel/tasks')
-rw-r--r-- | src/kernel/tasks/process.c | 21 | ||||
-rw-r--r-- | src/kernel/tasks/userspace.asm | 1 |
2 files changed, 10 insertions, 12 deletions
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(); diff --git a/src/kernel/tasks/userspace.asm b/src/kernel/tasks/userspace.asm index 6881bdf..eec6cff 100644 --- a/src/kernel/tasks/userspace.asm +++ b/src/kernel/tasks/userspace.asm @@ -1,5 +1,4 @@ global userspace_jump -extern hl_cr3 extern hl_esp extern hl_eip |