summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/progman.c
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-07-04 11:35:23 +0200
committerNao Pross <naopross@thearcway.org>2017-07-04 11:35:23 +0200
commitb14d0afe86966b91ad6a40816439cdc34602b49e (patch)
treef0d3bb06a9d41ad4dc5277251f9d82fe40e46595 /sw/z80/kernel/progman.c
parentmerge branch 'atlas' into naopross (diff)
downloadz80uPC-b14d0afe86966b91ad6a40816439cdc34602b49e.tar.gz
z80uPC-b14d0afe86966b91ad6a40816439cdc34602b49e.zip
new structure for process management, structures to discuss
the idea behind kernel/include/progman.h was good but the implementation was very not unix-like, so I made a new file under kernel/include/process.h that will implement the same features other changes: - move usart register structs definitions outside of the device - remove old build files - delete boot.h and boot_loader.h (as they weren't used by anything) - change on makefile to build binary with `makebin` instead of `xxd` - new file memory.h to implement memory mapping and mmu control - new type `uint` in types.h
Diffstat (limited to 'sw/z80/kernel/progman.c')
-rw-r--r--sw/z80/kernel/progman.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/sw/z80/kernel/progman.c b/sw/z80/kernel/progman.c
deleted file mode 100644
index 44888f8..0000000
--- a/sw/z80/kernel/progman.c
+++ /dev/null
@@ -1,90 +0,0 @@
-#include "progman.h"
-#include "string.h"
-#include "syscall.h"
-#include "sysexe.h"
-
-#define EMPTY_PROG_INFO 0x0
-
-volatile struct prog_data *prog_0 = PROG_0_INFO,
- *prog_1 = PROG_1_INFO;
-
-void progman_init() {
-
- *prog_0 = EMPTY_PROG_INFO;
- *prog_1 = EMPTY_PROG_INFO;
-
- // TODO other stuff
-}
-
-int8_t prog_req() {
-
- struct sys_progman data;
-
- sys_prog_data(&data);
-
- if (data.prog_0_enabled)
- return PROG_0;
- else if (data.prog_1_enabled)
- return PROG_1;
-
- return PROG_REQ_FULL;
-}
-
-void prog_alloc(int8_t id, struct prog_data *data, const struct prog_space *space) {
-
- void *addr = (id ? PROG_1_PREFIX : PROG_0_PREFIX) + PROG_VSTART;
-
- memcpy(addr, base->inst_set, base->inst_size);
-
- addr += base->inst_size;
-
- memcpy(addr, base->bss_data, base->data_size);
-
- addr += base->data_size;
-
- // TODO, empty heap and stack
-}
-
-void prog_exec(int8_t id, struct prog_data *data) {
-
- if (id)
- prog_exec_1(); // system call
- else
- prog_exec_0(); // system call
-}
-
-void prog_0_set_qcb(void (*callback)(void)) {
-
- prog_0->quit_cb = callback;
-}
-
-void prog_1_set_qcb(void (*callback)(void)) {
-
- prog_1->quit_cb = callback;
-}
-
-void prog_0_quit(uint8_t force) {
-
- if (!prog_0->enabled || prog_0->exiting)
- return;
-
- if (!force && prog_0->quit_cb)
- prog_0->quit_cb();
-
- *prog_0 = EMPTY_PROG_INFO;
-
- prog_stop_0(); // system call
-}
-
-void prog_1_quit(uint8_t force) {
-
- if (!prog_1->enabled || prog_1->exiting)
- return;
-
- if (!force && prog_1->quit_cb)
- prog_1->quit_cb();
-
- *prog_1 = EMPTY_PROG_INFO;
-
- prog_stop_1(); // system call
-} \ No newline at end of file