1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 17:18:06 +11:00
collapseos/tools
Virgil Dupras 45eceaaf61 Remove indirect memory access
I got bitten again, I've over-designed my solution. The last time
it happened, it was that memory mapping thing I was wanting to add.

The indirect memory access feature I was adding was to solve a
specific problem: Allow Collapse OS to cross-compile directly on a
AT28 EEPROM.

It began well. As long as we were staying in the assembler realm,
things were looking good. However, when we got into the xcomp realm
(B260), things became ugly, and I had to creep up indirection where
I didn't want to.

All of this because I wanted to solve my initial problem in a
slightly more generalized way. The broad idea was that these indirect
memory access could allow xcomp into a broad kind of memory-like
devices.

This idea broke on the "@" part of the equation. If I want
indirections to be two-way and allow xcomp to work properly, I have
to add this indirection to FIND (and possibly others) and this just
isn't practical or elegant.

So, I'm taking a step back and accepting that the solution I design
for now is exclusively for the AT28. What I'm thinking is to add a
low-level hook for memory writing, at the assembly level.
2020-12-07 22:34:53 -05:00
..
.gitignore tools: add smsrom 2020-10-10 13:30:43 -04:00
blkpack.c Transform "blk/" folders into "blk.fs" text files 2020-11-14 18:34:15 -05:00
blkunpack.c Transform "blk/" folders into "blk.fs" text files 2020-11-14 18:34:15 -05:00
blkup.c tools: improve usability on OpenBSD 2020-07-02 11:36:53 -04:00
common.c tools: improve reliability of ttyopen() 2020-09-17 10:25:08 -04:00
common.h Add arduinouno/at28 recipe 2020-07-22 17:26:06 -04:00
exec.c tools/exec: fix segfault 2020-11-17 17:02:10 -05:00
Makefile Fix broken tools makefile 2020-11-28 11:31:27 -05:00
memdump.c tools: improve usability on OpenBSD 2020-07-02 11:36:53 -04:00
pingpong.c Add arduinouno/at28 recipe 2020-07-22 17:26:06 -04:00
README.md tools: improve stty-related advices in README 2020-08-02 16:21:31 -04:00
ttysafe.c Reverse ttysafe escaping order 2020-02-22 14:11:43 -05:00
upload.c Remove indirect memory access 2020-12-07 22:34:53 -05:00

Tools

This folder contains tools to communicate to Collapse OS machines from a modern environment or to manipulate a blkfs.

Communication tools all take a device path as a first argument. That device is the serial device that connects you to your machine. It's often a USB-to-TTL dongle. When - is specified, stdin is used as the device.

Note that for these tools to work well, you need the serial device to be properly set up, TTY-wise. You'll probably want to do that with stty. The tool itself takes care of setting the regular stuff (cs8, -parenb, etc), but you need to set the speed. Here's an example working on OpenBSD:

$ ( stty 115200 raw ; sleep 2 ; ./upload - a000 os.bin ) <> /dev/cuaU0

To be honest, I'm having a bit of troubles making these tools work as well on OpenBSD as they do in Linux. But it does work. Here are some advices:

  • Use cuaXX instead of ttyXX.
  • Run cu -l /dev/cuaXX before running your tool and run a dummy command to make sure that the output buffer is flushed.
  • Use the "raw" option to avoid TTY-processing options to mess with data.
  • If you experience random failures in your command, try inserting a "sleep 2" between your "stty" invocation and the command. In my experience, these tend to help.

On Linux, it's generally easier:

  • Run screen on the device (often /dev/ttyUSBX)
  • Quit with CTRL+A :quit
  • Run the tool on the same device