aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/features/proc.c')
-rw-r--r--kernel/features/proc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 5c38fff..aa595ff 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -59,7 +59,7 @@ void scheduler(struct regs *regs)
}
memory_switch_dir(((struct proc *)current->data)->page_dir);
- memcpy(regs, &((struct proc *)current->data)->regs, sizeof(struct regs));
+ memcpy(regs, &((struct proc *)current->data)->regs, sizeof(*regs));
if (regs->cs != GDT_USER_CODE_OFFSET) {
regs->gs = GDT_USER_DATA_OFFSET;
@@ -145,9 +145,10 @@ void proc_exit(struct proc *proc, int status)
printf("Process %s exited with status %d (%s)\n", proc->name, status,
status == 0 ? "success" : "error");
+ virtual_destroy_dir(proc->page_dir);
proc_clear_quantum(); // TODO: Add quantum to each process struct?
- sti();
- hlt();
+
+ // The caller has to yield itself
}
void proc_yield(struct regs *r)