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.2KB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # emul
  2. This folder contains a couple of tools running under the [libz80][libz80]
  3. emulator.
  4. ## Build
  5. First, make sure that the `libz80` git submodule is checked out. If not, run
  6. `git submodule init && git submodule update`.
  7. After that, you can run `make` and it builds all tools.
  8. ## shell
  9. Running `shell/shell` runs the shell in an emulated machine. The goal of this
  10. machine is not to simulate real hardware, but rather to serve as a development
  11. platform. What we do here is we emulate the z80 part, the 64K memory space and
  12. then hook some fake I/Os to stdin, stdout and a small storage device that is
  13. suitable for Collapse OS's filesystem to run on.
  14. Through that, it becomes easier to develop userspace applications for Collapse
  15. OS.
  16. We don't try to emulate real hardware to ease the development of device drivers
  17. because so far, I don't see the advantage of emulation versus running code on
  18. the real thing.
  19. ## zasm
  20. `zasm/zasm` is `apps/zasm` wrapped in an emulator. It is quite central to the
  21. Collapse OS project because it's used to assemble everything, including itself!
  22. The program takes no parameter. It reads source code from stdin and spits
  23. binary in stdout. It supports includes and had both `apps/` and `kernel` folder
  24. packed into a CFS that was statically included in the executable at compile
  25. time.
  26. The file `zasm/zasm.bin` is a compiled binary for `apps/zasm/glue.asm` and
  27. `zasm/kernel.bin` is a compiled binary for `tools/emul/zasm/glue.asm`. It is
  28. used to bootstrap the assembling process so that no assembler other than zasm
  29. is required to build Collapse OS.
  30. This binary is fed to libz80 to produce the `zasm/zasm` "modern" binary and
  31. once you have that, you can recreate `zasm/zasm.bin` and `zasm/kernel.bin`.
  32. This is why it's included as a binary in the repo, but yes, it's redundant with
  33. the source code.
  34. Those binaries can be updated with the `make updatebootstrap` command. If they
  35. are up-to date and that zasm isn't broken, this command should output the same
  36. binary as before.
  37. ## runbin
  38. This is a very simple tool that reads binary z80 code from stdin, loads it in
  39. memory starting at address 0 and then run the code until it halts. The exit
  40. code of the program is the value of `A` when the program halts.
  41. This is used for unit tests.