diff options
author | Marvin Borner | 2021-03-19 23:09:54 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-19 23:09:54 +0100 |
commit | c97a50ba7baa70b40431594f410ca18e14af3b76 (patch) | |
tree | 12366515d6989dcfc79ec3250558e381e29fb4eb /kernel/features/proc.c | |
parent | 63ed037fdbb04a4855531f5ce980d8517752f640 (diff) |
Some things
Diffstat (limited to 'kernel/features/proc.c')
-rw-r--r-- | kernel/features/proc.c | 7 |
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) |