summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sw/z80/kernel/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/z80/kernel/process.c b/sw/z80/kernel/process.c
index b43fa11..049c88c 100644
--- a/sw/z80/kernel/process.c
+++ b/sw/z80/kernel/process.c
@@ -26,7 +26,23 @@ pid_t newpid(void)
int fork(void)
{
+ int i, p;
+ pid_t child_pid = newpid();
+ if (child_pid == 0)
+ return -1;
+
+
+ for (i = 0; i < current_proc.pages; i++) {
+ p = page_new();
+
+ if (p == -1) {
+
+ return -2;
+ }
+
+ proc_table[child_pid].page[i] = p;
+ }
}
int exec(char *path, char *args)