From 09a66e91ec9e8a677aa48f27798753084f213713 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 9 May 2020 17:39:31 +0200 Subject: Replaced fork() with spawn()! Who needs forks anyway --- src/kernel/syscall/actions/sys_exec.c | 1 - src/kernel/syscall/actions/sys_fork.c | 23 ----------------------- src/kernel/syscall/actions/sys_spawn.c | 7 +++++++ 3 files changed, 7 insertions(+), 24 deletions(-) delete mode 100644 src/kernel/syscall/actions/sys_fork.c create mode 100644 src/kernel/syscall/actions/sys_spawn.c (limited to 'src/kernel/syscall/actions') diff --git a/src/kernel/syscall/actions/sys_exec.c b/src/kernel/syscall/actions/sys_exec.c index a74bd29..049d085 100644 --- a/src/kernel/syscall/actions/sys_exec.c +++ b/src/kernel/syscall/actions/sys_exec.c @@ -1,4 +1,3 @@ -#include #include #include diff --git a/src/kernel/syscall/actions/sys_fork.c b/src/kernel/syscall/actions/sys_fork.c deleted file mode 100644 index ae1b17f..0000000 --- a/src/kernel/syscall/actions/sys_fork.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -u32 sys_fork(struct regs *r) -{ - cli(); - struct page_directory *dir = paging_copy_user_directory(current_proc->cr3); - struct process *proc = process_make_new(); - proc->cr3 = dir; - memcpy(&proc->registers, r, sizeof(struct regs)); - proc->registers.eax = proc->pid; - proc->pid = current_proc->pid + 1; - - sti(); - process_spawn(proc); - - return 0; -} \ No newline at end of file diff --git a/src/kernel/syscall/actions/sys_spawn.c b/src/kernel/syscall/actions/sys_spawn.c new file mode 100644 index 0000000..e3fa790 --- /dev/null +++ b/src/kernel/syscall/actions/sys_spawn.c @@ -0,0 +1,7 @@ +#include +#include + +u32 sys_spawn(char *path) +{ + return uspawn(path); +} \ No newline at end of file -- cgit v1.2.3