From f511289a3a54cea8cc1d17cf462120139d9ebe59 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 3 Jun 2019 08:32:25 -0400 Subject: [PATCH] tools/emul: make shell's cfsin always have all apps compiled in it --- tools/emul/.gitignore | 3 +-- tools/emul/Makefile | 8 ++++++-- tools/emul/cfsin/readme.txt | 3 +++ tools/emul/shell/shell_.asm | 19 +++++++++++++++++++ tools/emul/shell/user.h | 25 +++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 tools/emul/cfsin/readme.txt create mode 100644 tools/emul/shell/user.h diff --git a/tools/emul/.gitignore b/tools/emul/.gitignore index 9527004..4a44afb 100644 --- a/tools/emul/.gitignore +++ b/tools/emul/.gitignore @@ -2,5 +2,4 @@ /zasm/zasm /runbin/runbin /*/*-bin.h -/cfsin -/cfsout +/cfsin/zasm diff --git a/tools/emul/Makefile b/tools/emul/Makefile index f30a250..80c4c4f 100644 --- a/tools/emul/Makefile +++ b/tools/emul/Makefile @@ -4,9 +4,10 @@ KERNEL = ../../kernel APPS = ../../apps ZASMBIN = zasm/zasm ZASMSH = ../zasm.sh +SHELLAPPS = $(addprefix cfsin/, zasm) .PHONY: all -all: $(TARGETS) +all: $(TARGETS) $(SHELLAPPS) shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN) $(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null @@ -30,6 +31,9 @@ libz80/libz80.o: libz80/z80.c $(CFSPACK): make -C ../cfspack +$(SHELLAPPS): $(ZASMBIN) + $(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@ + .PHONY: updatebootstrap updatebootstrap: $(ZASMBIN) $(INCCFS) $(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin @@ -46,4 +50,4 @@ rescue: .PHONY: clean clean: - rm -f $(TARGETS) {zasm,shell}/*-bin.h + rm -f $(TARGETS) $(SHELLAPPS) {zasm,shell}/*-bin.h diff --git a/tools/emul/cfsin/readme.txt b/tools/emul/cfsin/readme.txt new file mode 100644 index 0000000..2fa0272 --- /dev/null +++ b/tools/emul/cfsin/readme.txt @@ -0,0 +1,3 @@ +The contents of this folder ends up in the emulated shell's fake block device, +mounted as a CFS. The goal of the emulated shell being to tests apps, we compile +all apps into this folder for use in the emulated shell. diff --git a/tools/emul/shell/shell_.asm b/tools/emul/shell/shell_.asm index ad68233..217e67d 100644 --- a/tools/emul/shell/shell_.asm +++ b/tools/emul/shell/shell_.asm @@ -11,6 +11,25 @@ jp init ; *** JUMP TABLE *** + jp strncmp + jp addDE + jp addHL + jp upcase + jp unsetZ + jp intoDE + jp intoHL + jp writeHLinDE + jp findchar + jp parseHex + jp parseHexPair + jp blkSel + jp fsFindFN + jp fsOpen + jp fsGetC + jp fsSeek + jp fsTell + jp cpHLDE + jp parseArgs jp printstr #include "core.asm" diff --git a/tools/emul/shell/user.h b/tools/emul/shell/user.h new file mode 100644 index 0000000..fc1f32e --- /dev/null +++ b/tools/emul/shell/user.h @@ -0,0 +1,25 @@ +.equ USER_CODE 0x9000 +.equ USER_RAMSTART 0xa800 +.equ FS_HANDLE_SIZE 8 + +; *** JUMP TABLE *** +.equ strncmp 0x03 +.equ addDE 0x06 +.equ addHL 0x09 +.equ upcase 0x0c +.equ unsetZ 0x0f +.equ intoDE 0x12 +.equ intoHL 0x15 +.equ writeHLinDE 0x18 +.equ findchar 0x1b +.equ parseHex 0x1e +.equ parseHexPair 0x21 +.equ blkSel 0x24 +.equ fsFindFN 0x27 +.equ fsOpen 0x2a +.equ fsGetC 0x2d +.equ fsSeek 0x30 +.equ fsTell 0x33 +.equ cpHLDE 0x36 +.equ parseArgs 0x39 +.equ printstr 0x3c