From 40b3d5e11e9f6dbf7c59d45952dfc5b79145e4cc Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 3 Jun 2019 09:25:47 -0400 Subject: [PATCH] tools/emul/shell: copy user.h in its cfsin This way, we can compile apps from within the shell that run on the shell. --- tools/emul/.gitignore | 1 + tools/emul/Makefile | 6 +++++- tools/emul/cfsin/hello.asm | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tools/emul/cfsin/hello.asm diff --git a/tools/emul/.gitignore b/tools/emul/.gitignore index 4a44afb..b7ac10d 100644 --- a/tools/emul/.gitignore +++ b/tools/emul/.gitignore @@ -3,3 +3,4 @@ /runbin/runbin /*/*-bin.h /cfsin/zasm +/cfsin/user.h diff --git a/tools/emul/Makefile b/tools/emul/Makefile index 80c4c4f..372a809 100644 --- a/tools/emul/Makefile +++ b/tools/emul/Makefile @@ -5,9 +5,10 @@ APPS = ../../apps ZASMBIN = zasm/zasm ZASMSH = ../zasm.sh SHELLAPPS = $(addprefix cfsin/, zasm) +CFSIN_CONTENTS = $(SHELLAPPS) cfsin/user.h .PHONY: all -all: $(TARGETS) $(SHELLAPPS) +all: $(TARGETS) $(CFSIN_CONTENTS) shell/kernel-bin.h: shell/shell_.asm $(ZASMBIN) $(ZASMSH) $(KERNEL) < $< | ./bin2c.sh KERNEL | tee $@ > /dev/null @@ -34,6 +35,9 @@ $(CFSPACK): $(SHELLAPPS): $(ZASMBIN) $(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@ +cfsin/user.h: shell/user.h + cp $< $@ + .PHONY: updatebootstrap updatebootstrap: $(ZASMBIN) $(INCCFS) $(ZASMSH) $(KERNEL) < zasm/glue.asm > zasm/kernel.bin diff --git a/tools/emul/cfsin/hello.asm b/tools/emul/cfsin/hello.asm new file mode 100644 index 0000000..9c98915 --- /dev/null +++ b/tools/emul/cfsin/hello.asm @@ -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 +