tools/emul/shell: copy user.h in its cfsin

This way, we can compile apps from within the shell that run on the
shell.
This commit is contained in:
Virgil Dupras 2019-06-03 09:25:47 -04:00
parent bed7032ee5
commit 40b3d5e11e
3 changed files with 18 additions and 1 deletions

View File

@ -3,3 +3,4 @@
/runbin/runbin /runbin/runbin
/*/*-bin.h /*/*-bin.h
/cfsin/zasm /cfsin/zasm
/cfsin/user.h

View File

@ -5,9 +5,10 @@ APPS = ../../apps
ZASMBIN = zasm/zasm ZASMBIN = zasm/zasm
ZASMSH = ../zasm.sh ZASMSH = ../zasm.sh
SHELLAPPS = $(addprefix cfsin/, zasm) SHELLAPPS = $(addprefix cfsin/, zasm)
CFSIN_CONTENTS = $(SHELLAPPS) cfsin/user.h
.PHONY: all .PHONY: all
all: $(TARGETS) $(SHELLAPPS) all: $(TARGETS) $(CFSIN_CONTENTS)
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
@ -34,6 +35,9 @@ $(CFSPACK):
$(SHELLAPPS): $(ZASMBIN) $(SHELLAPPS): $(ZASMBIN)
$(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@ $(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@
cfsin/user.h: shell/user.h
cp $< $@
.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

View File

@ -0,0 +1,12 @@
.equ printstr 0x3c
.org 0x9000
ld hl, sAwesome
call printstr
xor a ; success
ret
sAwesome:
.db "Assembled from the shell", 0x0d, 0x0a, 0