From 4d5e930c48cded790f77497911706aa8f5ff0965 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 24 Jul 2021 16:55:15 +0200 Subject: save all registers on syscalls --- src/kernel/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernel/proc.c') diff --git a/src/kernel/proc.c b/src/kernel/proc.c index a3adf41..a64d5ee 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -11,7 +11,7 @@ struct process *process_new() { // map the stack to the last page in memory pagedir_map(proc->pages, (void*)~PAGE_MASK, page_alloc(1), true, true); - proc->stack_top = proc->esp = (void*) ~0xF; + proc->stack_top = proc->regs.esp = (void*) ~0xF; // map the kernel // yup, .text is writeable too. the plan is to not map the kernel @@ -26,5 +26,5 @@ struct process *process_new() { void process_switch(struct process *proc) { process_current = proc; pagedir_switch(proc->pages); - sysexit(proc->eip, proc->esp); + sysexit(proc->regs.eip, proc->regs.esp); } -- cgit v1.2.3