Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.0KB

5 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # emul
  2. This folder contains a couple of tools running under the [libz80][libz80]
  3. emulator.
  4. ## Requirements
  5. You need `ncurses` to build the `forth` executable. In debian-based distros,
  6. it's `libncurses5-dev`.
  7. ## Not real hardware
  8. In the few emulated apps described below, we don't try to emulate real hardware
  9. because the goal here is to facilitate "high level" development.
  10. These apps run on imaginary hardware and use many cheats to simplify I/Os.
  11. For real hardware emulation (which helps developing drivers), see the `hw`
  12. folder.
  13. ## Build
  14. First, make sure that the `libz80` git submodule is checked out. If not, run
  15. `git submodule init && git submodule update`.
  16. After that, you can run `make` and it builds the `forth` interpreter.
  17. ## Usage
  18. Run `./forth` to get the Collapse OS prompt. Type `0 LIST` for help.
  19. The program is a curses interface with a limited, fixed size so that it can
  20. provide a AT-XY interface.
  21. You can get a REPL by launching the program with [`rlwrap(1)`][rlwrap] like
  22. this:
  23. rlwrap -e '' -m -S '> ' ./forth /dev/stdin
  24. ## Problems?
  25. If the `forth` executable works badly (hangs, spew garbage, etc.),
  26. it's probably because you've broken your bootstrap binaries. They're easy to
  27. mistakenly break. To verify if you've done that, look at your git status. If
  28. `forth.bin` is modified, try resetting it and then run `make clean all`. Things
  29. should go better afterwards.
  30. A modified `blkfs` can also break things (although even with a completely broken
  31. blkfs, you should still get to prompt), you might want to run `make pack` to
  32. ensure that the `blkfs` file is in sync with the contents of the `blk/` folder.
  33. If that doesn't work, there's also the nuclear option of `git reset --hard`
  34. and `git clean -fxd`.
  35. If that still doesn't work, it might be because the current commit you're on
  36. is broken, but that is rather rare: the repo on Github is plugged on Travis
  37. and it checks that everything is smooth.
  38. [libz80]: https://github.com/ggambetta/libz80
  39. [rlwrap]: https://linux.die.net/man/1/rlwrap