diff options
author | Nao Pross <naopross@thearcway.org> | 2017-09-10 17:36:08 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-09-10 17:36:08 +0200 |
commit | e6a3feccab8c555013960e5b730582f24ab55477 (patch) | |
tree | 505a8843ab3dfdf89bbac07f3e3277b0157db519 /sw/z80/kernel/process.c | |
parent | new documentation with no styling (diff) | |
download | z80uPC-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.c | 16 |
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) |