summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/process.c
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-09-10 17:36:08 +0200
committerNao Pross <naopross@thearcway.org>2017-09-10 17:36:08 +0200
commite6a3feccab8c555013960e5b730582f24ab55477 (patch)
tree505a8843ab3dfdf89bbac07f3e3277b0157db519 /sw/z80/kernel/process.c
parentnew documentation with no styling (diff)
downloadz80uPC-e6a3feccab8c555013960e5b730582f24ab55477.tar.gz
z80uPC-e6a3feccab8c555013960e5b730582f24ab55477.zip
partial implementation for ctc drivers and memory management
Diffstat (limited to 'sw/z80/kernel/process.c')
-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)