diff options
author | Marvin Borner | 2020-06-02 23:10:27 +0200 |
---|---|---|
committer | Marvin Borner | 2020-06-02 23:10:27 +0200 |
commit | cf9135829836c85735b383f7c50f34232bea94f9 (patch) | |
tree | c6385aae76407504f34f371b799e03aa53c63e5c /src/kernel/tasks/userspace.c | |
parent | 0b3b63ffdedb2e37e0732c09eb0e967e256f0d71 (diff) |
Much work on the ELF parser and userspace jumping
Diffstat (limited to 'src/kernel/tasks/userspace.c')
-rw-r--r-- | src/kernel/tasks/userspace.c | 59 |
1 files changed, 0 insertions, 59 deletions
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 <interrupts/interrupts.h> -#include <io/io.h> -#include <lib/lib.h> -#include <memory/paging.h> -#include <stddef.h> -#include <stdint.h> -#include <system.h> -#include <tasks/process.h> -#include <tasks/userspace.h> - -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 |