Move "emul" folder to root

This commit is contained in:
Virgil Dupras 2019-12-31 13:32:09 -05:00
parent 40f56dd6dc
commit 72357fec86
29 changed files with 26 additions and 27 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "tools/emul/libz80"]
path = tools/emul/libz80
[submodule "emul/libz80"]
path = emul/libz80
url = https://github.com/ggambetta/libz80.git

View File

@ -34,9 +34,10 @@ path to giving Collapse OS a try.
* `recipes`: collection of recipes that assemble parts together on a specific
machine.
* `doc`: User guide for when you've successfully installed Collapse OS.
* `tools`: Tools for working with Collapse OS from "modern" environments. Mostly
development tools, but also contains emulated zasm, which is
necessary to build Collapse OS from a non-Collapse OS machine.
* `tools`: Tools for working with Collapse OS from "modern" environments. For
example, tools for facilitating data upload to a Collapse OS machine
through a serial port.
* `emul`: Emulated applications, such as zasm and the shell.
* `tests`: Automated test suite for the whole project.
## Status

View File

@ -1,10 +1,10 @@
CFSPACK = ../cfspack/cfspack
CFSPACK = ../tools/cfspack/cfspack
TARGETS = shell/shell zasm/zasm runbin/runbin
KERNEL = ../../kernel
APPS = ../../apps
KERNEL = ../kernel
APPS = ../apps
ZASMBIN = zasm/zasm
AVRABIN = zasm/avra
ZASMSH = ../zasm.sh
ZASMSH = ./zasm.sh
SHELLAPPS = zasm ed
SHELLTGTS = ${SHELLAPPS:%=cfsin/%}
CFSIN_CONTENTS = $(SHELLTGTS) cfsin/user.h
@ -52,7 +52,7 @@ emul.o: emul.c
$(CC) -c -o emul.o emul.c
$(CFSPACK):
$(MAKE) -C ../cfspack
$(MAKE) -C ../tools/cfspack
# -o in sync with USER_CODE in shell/user.h
$(SHELLTGTS): $(ZASMBIN)

View File

@ -8,7 +8,7 @@ emulator.
First, make sure that the `libz80` git submodule is checked out. If not, run
`git submodule init && git submodule update`.
After that, you can run `make` and it builds all tools.
After that, you can run `make` and it builds all applications.
## shell

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Calls tools/emul/zasm/zasm in a convenient manner by wrapping specified
# Calls emul/zasm/zasm in a convenient manner by wrapping specified
# paths to include in a single CFS file and then pass that file to zasm.
# Additionally, it takes a "-o" argument to set the initial ".org" of the
# binary. For example, "zasm.sh -o 4f < foo.asm" assembles foo.asm as if it
@ -12,7 +12,7 @@
# so, if we can't get readlink -f to work, try python with a realpath implementation
ABS_PATH=$(readlink -f "$0" || python -c "import os; print(os.path.realpath('$0'))")
DIR=$(dirname "${ABS_PATH}")
ZASMBIN="${DIR}/emul/zasm/zasm"
ZASMBIN="${DIR}/zasm/zasm"
usage() { echo "Usage: $0 [-a] [-o <hexorg>] <paths-to-include>..." 1>&2; exit 1; }
@ -20,7 +20,7 @@ org='00'
while getopts ":ao:" opt; do
case "${opt}" in
a)
ZASMBIN="${DIR}/emul/zasm/avra"
ZASMBIN="${DIR}/zasm/avra"
;;
o)
org=${OPTARG}
@ -32,8 +32,8 @@ while getopts ":ao:" opt; do
done
shift $((OPTIND-1))
# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
CFSPACK="${DIR}/cfspack/cfspack"
# wrapper around ./zasm/zasm that prepares includes CFS prior to call
CFSPACK="${DIR}/../tools/cfspack/cfspack"
INCCFS=$(mktemp)
"${CFSPACK}" -p "*.h" -p "*.asm" -p "*.bin" "$@" > "${INCCFS}"

View File

@ -4,9 +4,9 @@ git submodule init
git submodule update
git clean -fxd
make -C tools/emul
make -C emul
make -C tests
# let's try again with an updated zasm
make -C tools/emul updatebootstrap all
make -C emul updatebootstrap all
make -C tests

View File

@ -1,4 +1,4 @@
EMULDIR = ../tools/emul
EMULDIR = ../emul
CFSPACK = ../tools/cfspack/cfspack
.PHONY: run

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
ZASM=../../tools/zasm.sh
ZASM=../../emul/zasm.sh
AVRINC=../../avr
cmpas() {

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
EMULDIR=../../tools/emul
EMULDIR=../../emul
SHELL="${EMULDIR}/shell/shell"
replay() {

View File

@ -3,9 +3,8 @@ set -e
# TODO: find POSIX substitute to that PIPESTATUS thing
BASE=../..
TOOLS="${BASE}/tools"
ZASM="${TOOLS}/zasm.sh"
RUNBIN="${TOOLS}/emul/runbin/runbin"
ZASM="${BASE}/emul/zasm.sh"
RUNBIN="${BASE}/emul/runbin/runbin"
KERNEL="${BASE}/kernel"
APPS="${BASE}/apps"

View File

@ -2,7 +2,7 @@
# no "set -e" because we test errors
ZASM=../../tools/zasm.sh
ZASM=../../emul/zasm.sh
chkerr() {
echo "Check that '$1' results in error $2"

View File

@ -3,8 +3,7 @@
BASE=../..
KERNEL="${BASE}/kernel"
APPS="${BASE}/apps"
ZASM="${BASE}/tools/zasm.sh"
ASMFILE="${APPS}/zasm/instr.asm"
ZASM="${BASE}/emul/zasm.sh"
cmpas() {
FN=$1