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

1234567891011121314151617181920212223242526272829303132
  1. # Tools
  2. This folder contains tools to communicate to Collapse OS machines from a modern
  3. environment or to manipulate a blkfs.
  4. Communication tools all take a device path as a first argument. That device is
  5. the serial device that connects you to your machine. It's often a USB-to-TTL
  6. dongle. When `-` is specified, `stdin` is used as the device.
  7. Note that for these tools to work well, you need the serial device to be
  8. properly set up, TTY-wise. You'll probably want to do that with `stty`. The tool
  9. itself takes care of setting the regular stuff (`cs8`, `-parenb`, etc), but you
  10. need to set the speed. Here's an example working on OpenBSD:
  11. $ ( stty 115200 raw ; sleep 2 ; ./upload - a000 os.bin ) <> /dev/cuaU0
  12. To be honest, I'm having a bit of troubles making these tools work as well on
  13. OpenBSD as they do in Linux. But it *does* work. Here are some advices:
  14. * Use `cuaXX` instead of `ttyXX`.
  15. * Run `cu -l /dev/cuaXX` before running your tool and run a dummy command to
  16. make sure that the output buffer is flushed.
  17. * Use the "raw" option to avoid TTY-processing options to mess with data.
  18. * If you experience random failures in your command, try inserting a "sleep 2"
  19. between your "stty" invocation and the command. In my experience, these tend
  20. to help.
  21. On Linux, it's generally easier:
  22. * Run screen on the device (often `/dev/ttyUSBX`)
  23. * Quit with `CTRL+A :quit`
  24. * Run the tool on the same device