From fafba296467b7398a97549a7d1f4dbf1552d6475 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 1 Aug 2017 01:32:37 +0200 Subject: filesystem structure intro and docs - new type pid_t and program management mechanism to make it easier to switch to a multitasking kernel - new memory related functions in memory.h to move, copy and manage pages - fix typos --- sw/z80/kernel/include/process.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'sw/z80/kernel/include/process.h') diff --git a/sw/z80/kernel/include/process.h b/sw/z80/kernel/include/process.h index ffd39e7..d7aa7fd 100644 --- a/sw/z80/kernel/include/process.h +++ b/sw/z80/kernel/include/process.h @@ -2,6 +2,7 @@ #define __PROCESS_H__ #include "types.h" +#include "memory.h" /* maximum number of processes (i.e. pages in ram) * since each program can use only one page in ram @@ -10,17 +11,17 @@ struct executable { - void *text; - size_t text_size; - void *bss; - size_t bss_size; -} + void *text; + size_t text_size; + void *bss; + size_t bss_size; +}; struct process { - uint blocked :1; // process is waiting for hardware or locked - uint running :1; // pid is used - uint pages[4]; // pages used by the process + uint blocked :1; // process is waiting for hardware or locked + uint running :1; // pid is used + struct page pages[4]; // pages used by the process // TODO: implement quick callback? }; @@ -29,8 +30,9 @@ struct process * limitation but for our purposes is more than enough */ extern struct process proc_table[255]; +extern struct process *current_proc; -static pid_t newpid(void); +pid_t newpid(void); int fork(void); int exec(char *path, char *args); -- cgit v1.2.1