Browse Source

Move "emul" folder to root

pull/85/head
Virgil Dupras 4 years ago
parent
commit
72357fec86
29 changed files with 26 additions and 27 deletions
  1. +2
    -2
      .gitmodules
  2. +4
    -3
      README.md
  3. +0
    -0
      emul/.gitignore
  4. +5
    -5
      emul/Makefile
  5. +1
    -1
      emul/README.md
  6. +0
    -0
      emul/bin2c.sh
  7. +0
    -0
      emul/cfsin/count.bas
  8. +0
    -0
      emul/cfsin/hello.asm
  9. +0
    -0
      emul/cfsin/readme.txt
  10. +0
    -0
      emul/emul.c
  11. +0
    -0
      emul/emul.h
  12. +0
    -0
      emul/libz80
  13. +0
    -0
      emul/runbin/runbin.c
  14. +0
    -0
      emul/shell/glue.asm
  15. +0
    -0
      emul/shell/shell.c
  16. +0
    -0
      emul/shell/user.h
  17. +5
    -5
      emul/zasm.sh
  18. +0
    -0
      emul/zasm/glue.asm
  19. +0
    -0
      emul/zasm/kernel.bin
  20. +0
    -0
      emul/zasm/user.h
  21. +0
    -0
      emul/zasm/zasm.bin
  22. +0
    -0
      emul/zasm/zasm.c
  23. +2
    -2
      runtests.sh
  24. +1
    -1
      tests/Makefile
  25. +1
    -1
      tests/avra/runtests.sh
  26. +1
    -1
      tests/shell/runtests.sh
  27. +2
    -3
      tests/unit/runtests.sh
  28. +1
    -1
      tests/zasm/errtests.sh
  29. +1
    -2
      tests/zasm/runtests.sh

+ 2
- 2
.gitmodules 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

+ 4
- 3
README.md 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


tools/emul/.gitignore → emul/.gitignore View File


tools/emul/Makefile → emul/Makefile 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)

tools/emul/README.md → emul/README.md 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


tools/emul/bin2c.sh → emul/bin2c.sh View File


tools/emul/cfsin/count.bas → emul/cfsin/count.bas View File


tools/emul/cfsin/hello.asm → emul/cfsin/hello.asm View File


tools/emul/cfsin/readme.txt → emul/cfsin/readme.txt View File


tools/emul/emul.c → emul/emul.c View File


tools/emul/emul.h → emul/emul.h View File


tools/emul/libz80 → emul/libz80 View File


tools/emul/runbin/runbin.c → emul/runbin/runbin.c View File


tools/emul/shell/glue.asm → emul/shell/glue.asm View File


tools/emul/shell/shell.c → emul/shell/shell.c View File


tools/emul/shell/user.h → emul/shell/user.h View File


tools/zasm.sh → emul/zasm.sh 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}"

tools/emul/zasm/glue.asm → emul/zasm/glue.asm View File


tools/emul/zasm/kernel.bin → emul/zasm/kernel.bin View File


tools/emul/zasm/user.h → emul/zasm/user.h View File


tools/emul/zasm/zasm.bin → emul/zasm/zasm.bin View File


tools/emul/zasm/zasm.c → emul/zasm/zasm.c View File


+ 2
- 2
runtests.sh 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

+ 1
- 1
tests/Makefile View File

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

.PHONY: run


+ 1
- 1
tests/avra/runtests.sh View File

@@ -1,6 +1,6 @@
#!/bin/sh -e

ZASM=../../tools/zasm.sh
ZASM=../../emul/zasm.sh
AVRINC=../../avr

cmpas() {


+ 1
- 1
tests/shell/runtests.sh View File

@@ -1,6 +1,6 @@
#!/bin/sh -e

EMULDIR=../../tools/emul
EMULDIR=../../emul
SHELL="${EMULDIR}/shell/shell"

replay() {


+ 2
- 3
tests/unit/runtests.sh 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"



+ 1
- 1
tests/zasm/errtests.sh 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"


+ 1
- 2
tests/zasm/runtests.sh 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


Loading…
Cancel
Save