aboutsummaryrefslogtreecommitdiffstats
path: root/src/syscall.asm
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-15 23:54:13 +0200
committeruser <user@clank>2026-07-15 23:54:13 +0200
commitab3ebbe227c72b745a46f9233fbfbb27477586b8 (patch)
treed71f87605d17c5653f34ebcdef3941f898cd5b91 /src/syscall.asm
parentgbos scaffold: working cooperative microkernel (verified ABAB in emulator) (diff)
downloadgbos-ab3ebbe227c72b745a46f9233fbfbb27477586b8.tar.gz
gbos-ab3ebbe227c72b745a46f9233fbfbb27477586b8.tar.xz
gbos-ab3ebbe227c72b745a46f9233fbfbb27477586b8.zip
kernel: implement fork()
- sys_fork: switch to a kernel stack, bump-allocate a cart-RAM bank, copy the parent's 8 KiB bank via a WRAM bounce buffer, plant a switch-in frame so the child returns 0 to the post-fork PC, fill the child PCB (shared ROM text) - add AllocRamBank (bump allocator) + FindFreeSlot helpers - demo: init forks; parent prints P, child prints C (PCPC...); nested fork gives three distinct pids (123...) - README: document the fork mechanism, mark syscall status
Diffstat (limited to '')
-rw-r--r--src/syscall.asm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syscall.asm b/src/syscall.asm
index 71e1f2b..ca2857c 100644
--- a/src/syscall.asm
+++ b/src/syscall.asm
@@ -35,7 +35,7 @@ SyscallTrap::
; -----------------------------------------------------------------------------
SyscallTable:
dw sys_exit ; 0
- dw sys_nosys ; 1 FORK (TODO)
+ dw sys_fork ; 1 FORK
dw sys_nosys ; 2 READ (TODO)
dw sys_write ; 3 WRITE
dw sys_nosys ; 4 OPEN (TODO)