tools/emul: make shell's cfsin always have all apps compiled in it

This commit is contained in:
Virgil Dupras 2019-06-03 08:32:25 -04:00
parent 04bf2117b2
commit f511289a3a
5 changed files with 54 additions and 4 deletions

View File

@ -2,5 +2,4 @@
/zasm/zasm /zasm/zasm
/runbin/runbin /runbin/runbin
/*/*-bin.h /*/*-bin.h
/cfsin /cfsin/zasm
/cfsout

View File

@ -4,9 +4,10 @@ KERNEL = ../../kernel
APPS = ../../apps APPS = ../../apps
ZASMBIN = zasm/zasm ZASMBIN = zasm/zasm
ZASMSH = ../zasm.sh ZASMSH = ../zasm.sh
SHELLAPPS = $(addprefix cfsin/, zasm)
.PHONY: all .PHONY: all
all: $(TARGETS) all: $(TARGETS) $(SHELLAPPS)
shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN) shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN)
$(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null $(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null
@ -30,6 +31,9 @@ libz80/libz80.o: libz80/z80.c
$(CFSPACK): $(CFSPACK):
make -C ../cfspack make -C ../cfspack
$(SHELLAPPS): $(ZASMBIN)
$(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@
.PHONY: updatebootstrap .PHONY: updatebootstrap
updatebootstrap: $(ZASMBIN) $(INCCFS) updatebootstrap: $(ZASMBIN) $(INCCFS)
$(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin $(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin
@ -46,4 +50,4 @@ rescue:
.PHONY: clean .PHONY: clean
clean: clean:
rm -f $(TARGETS) {zasm,shell}/*-bin.h rm -f $(TARGETS) $(SHELLAPPS) {zasm,shell}/*-bin.h

View File

@ -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.

View File

@ -11,6 +11,25 @@
jp init jp init
; *** JUMP TABLE *** ; *** 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 jp printstr
#include "core.asm" #include "core.asm"

25
tools/emul/shell/user.h Normal file
View File

@ -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