tools/emul: re-organize .h files

What used to be `tools/emul/user.h` was in fact specific to zasm, so I
moved it there.

To avoid name confusion, I renamed what used to be kernel.h and user.h
to kernel-bin.h and user-bin.h.
This commit is contained in:
Virgil Dupras 2019-06-03 08:12:44 -04:00
parent 9a72f10221
commit 04bf2117b2
6 changed files with 16 additions and 15 deletions

View File

@ -27,11 +27,14 @@ zasmMain:
ld de, .argspecs ld de, .argspecs
ld ix, ZASM_RAMSTART ld ix, ZASM_RAMSTART
call parseArgs call parseArgs
jr z, .goodargs
; bad args
ld hl, 0 ld hl, 0
ld de, 0 ld de, 0
ld a, SHELL_ERR_BAD_ARGS ld a, SHELL_ERR_BAD_ARGS
ret nz ret
.goodargs:
; HL now points to parsed args ; HL now points to parsed args
; Init I/O ; Init I/O
ld a, (ZASM_RAMSTART) ; blkdev in ID ld a, (ZASM_RAMSTART) ; blkdev in ID

View File

@ -1,8 +1,6 @@
/shell/shell /shell/shell
/zasm/zasm /zasm/zasm
/runbin/runbin /runbin/runbin
/zasm/includes.* /*/*-bin.h
/*/kernel.h
/*/user.h
/cfsin /cfsin
/cfsout /cfsout

View File

@ -8,17 +8,17 @@ ZASMSH = ../zasm.sh
.PHONY: all .PHONY: all
all: $(TARGETS) all: $(TARGETS)
shell/kernel.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
zasm/kernel.h: zasm/kernel.bin zasm/kernel-bin.h: zasm/kernel.bin
./bin2c.sh KERNEL < $< | tee $@ > /dev/null ./bin2c.sh KERNEL < $< | tee $@ > /dev/null
zasm/user.h: zasm/zasm.bin zasm/zasm-bin.h: zasm/zasm.bin
./bin2c.sh USERSPACE < $< | tee $@ > /dev/null ./bin2c.sh USERSPACE < $< | tee $@ > /dev/null
shell/shell: shell/shell.c libz80/libz80.o shell/kernel.h shell/shell: shell/shell.c libz80/libz80.o shell/kernel-bin.h
$(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel.h zasm/user.h $(CFSPACK) $(ZASMBIN): zasm/zasm.c libz80/libz80.o zasm/kernel-bin.h zasm/zasm-bin.h $(CFSPACK)
runbin/runbin: runbin/runbin.c libz80/libz80.o runbin/runbin: runbin/runbin.c libz80/libz80.o
$(TARGETS): $(TARGETS):
$(CC) $< libz80/libz80.o -o $@ $(CC) $< libz80/libz80.o -o $@
@ -33,7 +33,7 @@ $(CFSPACK):
.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
$(ZASMSH) $(KERNEL) $(APPS) user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin $(ZASMSH) $(KERNEL) $(APPS) zasm/user.h < $(APPS)/zasm/glue.asm > zasm/zasm.bin
# Sometimes, when developing zasm, stuff get messed up and it's hard to unmess # Sometimes, when developing zasm, stuff get messed up and it's hard to unmess
# because zasm's brake-up ends up in its bootstrap bins. Sure, we can revert # because zasm's brake-up ends up in its bootstrap bins. Sure, we can revert
@ -42,8 +42,8 @@ updatebootstrap: $(ZASMBIN) $(INCCFS)
.PHONY: rescue .PHONY: rescue
rescue: rescue:
scas -o zasm/kernel.bin -I $(KERNEL) zasm/glue.asm scas -o zasm/kernel.bin -I $(KERNEL) zasm/glue.asm
scas -o zasm/zasm.bin -I $(APPS) -I $(KERNEL) $(APPS)/zasm/glue.asm scas -o zasm/zasm.bin -I $(APPS) -I $(KERNEL) -I zasm $(APPS)/zasm/glue.asm
.PHONY: clean .PHONY: clean
clean: clean:
rm -f $(TARGETS) zasm/{kernel,user}.h shell/kernel.h zasm/includes.* rm -f $(TARGETS) {zasm,shell}/*-bin.h

View File

@ -2,7 +2,7 @@
#include <stdio.h> #include <stdio.h>
#include <termios.h> #include <termios.h>
#include "../libz80/z80.h" #include "../libz80/z80.h"
#include "kernel.h" #include "kernel-bin.h"
/* Collapse OS shell with filesystem /* Collapse OS shell with filesystem
* *

View File

@ -1,8 +1,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include "../libz80/z80.h" #include "../libz80/z80.h"
#include "kernel.h" #include "kernel-bin.h"
#include "user.h" #include "zasm-bin.h"
/* zasm reads from a specified blkdev, assemble the file and writes the result /* zasm reads from a specified blkdev, assemble the file and writes the result
* in another specified blkdev. In our emulator layer, we use stdin and stdout * in another specified blkdev. In our emulator layer, we use stdin and stdout