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 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # RC2014
  2. The [RC2014][rc2014] is a nice and minimal z80 system that has the advantage
  3. of being available in an assembly kit. Assembling it yourself involves quite a
  4. bit of soldering due to the bus system. However, one very nice upside of that
  5. bus system is that each component is isolated and simple.
  6. The machine used in this recipe is the "Classic" RC2014 with an 8k ROM module
  7. , 32k of RAM, a 7.3728Mhz clock and a serial I/O.
  8. The ROM module being supplied in the assembly kit is an EPROM, not EEPROM, so
  9. you can't install Collapse OS on it. You'll have to supply your own.
  10. There are many options around to boot arbitrary sources. What was used in this
  11. recipe was a AT28C64B EEPROM module. I chose it because it's compatible with
  12. the 8k ROM module which is very convenient. If you do the same, however, don't
  13. forget to set the A14 jumper to high because what is the A14 pin on the AT27
  14. ROM module is the WE pin on the AT28! Setting the jumper high will keep is
  15. disabled.
  16. ## Related recipes
  17. This recipe is for installing a minimal Collapse OS system on the RC2014. There
  18. are other recipes related to the RC2014:
  19. * [Writing to a AT28 from Collapse OS](eeprom/README.md)
  20. * [Accessing a MicroSD card](sdcard/README.md)
  21. * [Self-hosting](selfhost/README.md)
  22. * [Interfacing a PS/2 keyboard](ps2/README.md)
  23. ## Recipe
  24. The goal is to have the shell running and accessible through the Serial I/O.
  25. You'll need specialized tools to write data to the AT28 EEPROM. There seems to
  26. be many devices around made to write in flash and EEPROM modules, but being in
  27. a "understand everything" mindset, I [built my own][romwrite]. This is the
  28. device I use in this recipe.
  29. ### Gathering parts
  30. * A "classic" RC2014 with Serial I/O
  31. * [Forth's stage binary][stage]
  32. * [romwrite][romwrite] and its specified dependencies
  33. * [GNU screen][screen]
  34. * A FTDI-to-TTL cable to connect to the Serial I/O module
  35. ### Build the binary
  36. Building the binary is as simple as running `make`. This will yield `os.bin`
  37. which can then be written to EEPROM.
  38. This build is controlled by the `xcomp.fs` unit, which loads `blk/618`. That's
  39. what you need to modify if you want to customize your build (if you do, you'll
  40. need to rebuild `/emul/stage` because the blkfs is embedded in it).
  41. ### Emulate
  42. The Collapse OS project includes a RC2014 emulator suitable for this image.
  43. You can invoke it with `make emul`. See `emul/hw/rc2014/README.md` for details.
  44. ### Write to the ROM
  45. Plug your romwrite atmega328 to your computer and identify the tty bound to it.
  46. In my case (arduino uno), it's `/dev/ttyACM0`. Then:
  47. screen /dev/ttyACM0 9600
  48. CTRL-A + ":quit"
  49. cat rom.bin | pv -L 10 > /dev/ttyACM0
  50. See romwrite's README for details about these commands.
  51. Note that this method is slow and clunky, but before long, you won't be using
  52. it anymore. Writing to an EEPROM is much easier and faster from a RC2014
  53. running Collapse OS, so once you have that first Collapse OS ROM, you'll be
  54. much better equipped for further toying around (unless, of course, you already
  55. had tools to write to EEPROM. In which case, you'll be ignoring this section
  56. altogether).
  57. ### Running
  58. Put the AT28 in the ROM module, don't forget to set the A14 jumper high, then
  59. power the thing up. Connect the FTDI-to-TTL cable to the Serial I/O module and
  60. identify the tty bound to it (in my case, `/dev/ttyUSB0`). Then:
  61. screen /dev/ttyUSB0 115200
  62. Press the reset button on the RC2014 and the "ok" prompt should appear.
  63. [rc2014]: https://rc2014.co.uk
  64. [romwrite]: https://github.com/hsoft/romwrite
  65. [stage]: ../../emul
  66. [screen]: https://www.gnu.org/software/screen/