···29293030See [loader.txt](docs/loader.txt) for a more thorough explanation.
31313232-tl;dr:
3333-3434-- Obtain a DB25 parallel Laplink cable. Be sure to verify the pin-out as it is
3535- not a straight-through DB25 modem or printer cable.
3232+- Connect a Teensy loader or Laplink parallel port cable to the DB25 port on
3333+ the Mailstation.
36343735- With the Mailstation off, hold down the `Function`+`Shift`+`T` keys and press
3836 the `Power` button to turn it on. Instead of booting up to the Cidco logo,
···58565957### Parallel port access
60586161-Host tools (`sendload`, `recvdump`, and `tribble_getty`) need direct access
6262-to the parallel port to communicate with the Mailstation over the Laplink
6363-cable using `inb` and `outb` system calls.
5959+A DB25 LapLink parallel port cable is required for this method of connection.
6060+6461A USB IEEE 1284 printer cable will *NOT* work, though a PCI parallel port card
6562will (including via a Thunderbolt enclosure if on a laptop).
6663If you are using a parallel port other than the standard port of `0x378`,
6764supply the `-p <port>` option to the host programs with the port in
6865hexadecimal.
69666767+When connecting to the Mailstation via parallel port, host tools
6868+(`sendload`, `recvdump`, and `tribble_getty`) need direct access
6969+to the port to communicate with the Mailstation over the Laplink
7070+cable using `inb` and `outb` system calls.
7171+7072On OpenBSD, direct port access will require the `machdep.allowaperture` sysctl
7173set to `1` or higher. On OpenBSD and Linux, these host tools will also have
7274to be executed as root.
73757474-### Included tools
7676+### USB Loader with Teensy
7777+7878+If you don't have a computer with a parallel port, you can use a
7979+[Teensy 3.2](https://www.pjrc.com/store/teensy32.html)
8080+which will connect to your computer via USB, and to the Mailstation via its
8181+many digital I/O pins:
8282+8383+|Teensy Pin|Mailstation Pin|
8484+|----------|---------------|
8585+|1|2|
8686+|2|3|
8787+|3|4|
8888+|4|5|
8989+|5|6|
9090+|7|10|
9191+|8|11|
9292+|9|12|
9393+|10|13|
9494+|11|15|
9595+|GND|25|
9696+9797+- Install [Arduino-Makefile](https://github.com/sudar/Arduino-Makefile) and
9898+[Teensyduino](https://www.pjrc.com/teensy/teensyduino.html)
9999+100100+- `cd teensy-loader && make` (`gmake` on OpenBSD)
101101+102102+- Upload `build-*/teensy-loader_.hex` firmware with `teensyloader` and Teensy
103103+will reattach as a USB serial device:
104104+105105+````
106106+umodem0 at uhub0 port 4 configuration 1 interface 0 "jcs Mailstation Loader" rev 1.10/2.75 addr 9
107107+ucom0 at umodem0
108108+````
109109+110110+### Included host-side tools in `util/`
111111+112112+#### `sendload`
113113+114114+Writes a binary program file through the parallel port or USB serial port in
115115+the Mailstation's "tribble" format, sending each byte 3 bits at a time.
116116+117117+#### `recvdump`
118118+119119+Receives a dump from `codedump`, `datadump`, and `memdump` programs executed
120120+on the Mailstation and writes the bytes received to `codedump.bin`,
121121+`datadump.bin`, or `memdump.bin`.
122122+123123+### Included Mailstation Z80 tools
7512476125#### `loader.asm`
771267878-Loader is used to load binary code over the Laplink cable into RAM and then
127127+Loader is used to load binary code over the parallel port into RAM and then
79128execute it.
8012981130You need to type the hex values of `z80/loader.bin` (tip: use `hexdump -C
···83132the new Loader app on the Mailstation.
8413385134Then run `obj/sendload <your binary file>` to send your binary code over the
8686-Laplink cable and it will be executed as soon as the transfer is done.
135135+parallel port and it will be executed on the Mailstation as soon as the
136136+transfer is done.
8713788138#### `codedump.asm`
8913990140Code Dump is used to read the contents of the 1Mb flash chip containing the
9191-Mailstation's code and send it over the Laplink cable.
141141+Mailstation's code and send it over the parallel port.
9214293143You need to type the hex values of `z80/codedump.bin` into one of the
94144application slots as detailed above.
···103153104154Data Dump is used to read the contents of the 512Kb flash chip containing the
105155Mailstation's data area (containing downloaded programs, e-mails, etc.) and
106106-send it over the Laplink cable.
156156+send it over the parallel port.
107157108158You need to type the hex values of `z80/datadump.bin` into one of the
109159application slots as detailed above.