From cf9135829836c85735b383f7c50f34232bea94f9 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 2 Jun 2020 23:10:27 +0200 Subject: Much work on the ELF parser and userspace jumping --- src/kernel/tasks/userspace.c | 59 -------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/kernel/tasks/userspace.c (limited to 'src/kernel/tasks/userspace.c') diff --git a/src/kernel/tasks/userspace.c b/src/kernel/tasks/userspace.c deleted file mode 100644 index 3164965..0000000 --- a/src/kernel/tasks/userspace.c +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct process *proc_bottom = NULL; - -u32 hl_cr3; -u32 hl_eip; -u32 hl_esp; - -u32 spawn_child(struct process *child) -{ - return (u32)-1; -} - -void userspace_enter(struct process *proc) -{ - proc_bottom = proc; - hl_eip = proc->registers.eip; - hl_esp = proc->registers.esp; - paging_switch_directory(proc->cr3); - - //debug("Jumping to userspace!"); - jump_userspace(); -} - -void single_yield(struct process *proc, struct regs *regs) -{ - memcpy(&proc_bottom->registers, regs, sizeof(struct regs)); - - if (proc == proc_bottom) - panic("Can't return from parent process"); - - proc->next = proc_bottom; - proc_bottom = proc; - - memcpy(regs, &proc->registers, sizeof(struct regs)); - paging_switch_directory(proc->cr3); -} - -u32 single_exit(struct regs *regs) -{ - u32 hold = regs->ebx; - proc_bottom = proc_bottom->next; - - if (proc_bottom == NULL) - panic("Return from process with no parent"); - - memcpy(regs, &proc_bottom->registers, sizeof(struct regs)); - paging_switch_directory(proc_bottom->cr3); - - return hold; -} \ No newline at end of file -- cgit v1.2.3