diff options
author | Marvin Borner | 2020-05-09 17:39:31 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-09 17:39:31 +0200 |
commit | 09a66e91ec9e8a677aa48f27798753084f213713 (patch) | |
tree | 9685a13b459e60d830179c565417ed72ae855ebe /src/kernel/syscall/actions | |
parent | 3a97fef4bb4780e4bc2423699063d40cbf5da923 (diff) |
Replaced fork() with spawn()!
Who needs forks anyway
Diffstat (limited to 'src/kernel/syscall/actions')
-rw-r--r-- | src/kernel/syscall/actions/sys_exec.c | 1 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_fork.c | 23 | ||||
-rw-r--r-- | src/kernel/syscall/actions/sys_spawn.c | 7 |
3 files changed, 7 insertions, 24 deletions
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 <io/io.h> #include <stdint.h> #include <tasks/process.h> 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 <interrupts/interrupts.h> -#include <io/io.h> -#include <lib/lib.h> -#include <memory/paging.h> -#include <stdint.h> -#include <system.h> -#include <tasks/process.h> - -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 <stdint.h> +#include <tasks/process.h> + +u32 sys_spawn(char *path) +{ + return uspawn(path); +}
\ No newline at end of file |