summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/include/process.h
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-08-01 01:32:37 +0200
committerNao Pross <naopross@thearcway.org>2017-08-01 01:32:37 +0200
commitfafba296467b7398a97549a7d1f4dbf1552d6475 (patch)
tree8847debacba5ce7711bb85234d38c8a56d473622 /sw/z80/kernel/include/process.h
parentnew structure for process management, structures to discuss (diff)
downloadz80uPC-fafba296467b7398a97549a7d1f4dbf1552d6475.tar.gz
z80uPC-fafba296467b7398a97549a7d1f4dbf1552d6475.zip
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
Diffstat (limited to 'sw/z80/kernel/include/process.h')
-rw-r--r--sw/z80/kernel/include/process.h20
1 files changed, 11 insertions, 9 deletions
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);