Code Monkey home page Code Monkey logo

dl2's Introduction

dl2

DeskLink2 is a Tandy Portable Disk Drive emulator or "TPDD server" written in C.

Install

$ make clean all && sudo make install

Uninstall

$ sudo make uninstall

Manual

$ dl -h
DeskLink2 v2.1.001-19-g14a2925

Usage: dl [options] [tty_device] [share_path]

Options     Description (default setting)
   -0       Raw mode - no filename munging, attr = ' '
   -a c     Attribute - default attr byte used when no xattr (F)
   -b file  Bootstrap - send loader file to client
   -d tty   Serial device connected to the client (ttyUSB*)
   -n       Disable TS-DOS directories (enabled)
   -g       Getty mode - run as daemon
   -h       Print this help
   -i file  Disk image filename for raw sector access
   -l       List loader files and show bootstrap help
   -m #     Model - 1 = FB-100/TPDD1, 2 = TPDD2 (1)
   -p dir   Path - /path/to/dir with files to be served (./)
   -r       RTS/CTS hardware flow control (false)
   -s #     Speed - serial port baud rate (19200)
   -u       Uppercase all filenames (false)
   -v       Verbosity - more v's = more verbose
   -w       WP-2 mode - 8.2 filenames for TANDY WP-2
   -z #     Milliseconds per byte for bootstrap (8)

The 1st non-option argument is another way to specify the tty device.
The 2nd non-option argument is another way to specify the share path.
TPDD2 mode accepts a 2nd share path for bank 1.
TPDD2 mode does not support TS-DOS dfirectories.

Examples:
   $ dl
   $ dl ttyUSB1
   $ dl -vu -p ~/Downloads/REX
   $ dl -w /dev/cu.usbserial-AB0MQNN1 ~/Documents/wp2
   $ dl -m2 -p /tmp/bank0 -p /tmp/bank1

$
$ dl -l
DeskLink2 v2.1.001-19-g14a2925
Available support files in /usr/local/lib/dl

Loader files for use with -b:
-----------------------------
TRS-80 Model 100/102 : DSKMGR.100 TINY.100 D.100 TEENY.100 TSLOAD.100 TS-DOS.100 PAKDOS.100
TANDY Model 200      : TEENY.200 DSKMGR.200 TSLOAD.200 TS-DOS.200 PAKDOS.200
NEC PC-8201/PC-8300  : TEENY.NEC TS-DOS.NEC
Kyotronic KC-85      : DSKMGR.K85 Disk_Power.K85
Olivetti M-10        : TEENY.M10 DSKMGR.M10

Disk image files for use with -i:
---------------------------------
Sardine_American_English.pdd1
Disk_Power.K85.pdd1


Filenames given without any path are searched from /usr/local/lib/dl
as well as the current directory.
Examples:

   dl -b TS-DOS.100
   dl -b ~/Documents/LivingM100SIG/Lib-03-TELCOM/XMDPW5.100
   dl -vb rxcini.DO && dl -vu
   dl -vu -i Sardine_American_English.pdd1

$ 

Several of the above settings can alternatively be supplied via environment variables, as well as a few other hacky extra options

Docs from the past versions of this program. They don't exactly match this version any more.
README.txt from dlplus by John R. Hogerhuis
dl.do from dl 1.0-1.3 the original "DeskLink for *nix" by Steven Hurd

Hardware

KC-85 to PC Serial Cable

Examples:

Run the TPDD server, verbose, upcase, serving files from the current directory

$ dl -vu

List all available TPDD client installers, and then bootstrap one of them

$ dl -l
$ dl -vb TS-DOS.100

Bootstrap a REXCPM

$ dl -vb rxcini.DO && dl -vu
(Full directions for REXCPM)

Update a REX#

$ dl -vb 'rx#u1.do' && dl -vu

"Magic Files" / Ultimate ROM II / TSLOAD

There is a short list of filenames that are specially recognized:
DOS100.CO, DOS200.CO, DOSNEC.CO, DOSM10.CO, DOSK85.CO
SAR100.CO, SAR200.CO, SARNEC.CO, SARM10.CO, SARK85.CO

When a client requests any of these filenames, dl2 first looks in the current directory (the current directory that the client is CD'd into within the share path). If a file matching the requested filename is there, it is used, the same as for any other file.

Failing that, it looks in the root of the share path

Failing that, it looks in /usr/local/lib/dl

And some of those files are bundled with dl2 and installed in /usr/local/lib/dl:
DOS100.CO, DOS200.CO, DOSNEC.CO
SAR100.CO, SAR200.CO

SARNEC.CO is known to have existed, but is currently lost.
The others probably never existed, but dl2 will recognize and serve them up if available just for completeness.

This allows TSLOAD and the TS-DOS and SARDIN features in Ultimate ROM 2 to work "by magic" at all times without you having to actually place copies of these files in every directory and subdirectory in the share path.

You can override the bundled versions of these files without touching the /usr/local/lib/dl files by placing say a different version of DOS100.CO in the root of a share path, and it will be in effect for all directories in that share path.

More details

Sector Access / Disk Images

$ dl -i disk_image.pdd1
or
$ dl -i disk_image.pdd2

This is support for disk image files that allow use of raw sector access commands on a virtual disk image file.

Limitations: Only supports using the disk image for sector access. It doesn't provide access to the files in a disk image as files, just as raw sectors.

If the file exists, it's size is used to set the emulation mode to tpdd1 vs tpdd2.
If the file doesn't exist or is zero bytes, then the last 5 characters in the filename are used, ".pdd1" or ".pdd2", case insensitive.

One example usage is the Sardine spell checker.
Another is installing Disk Power for Kyotronic KC-85

There are 2 ways to create disk image files so far:

  • One way is to use pdd.sh to read a real disk from a real drive, and output a disk image file.
  • Another way is to run dl -i filename, where the file either doesn't exist or is zero bytes, and then use a client (like TS-DOS or pdd.sh) to format the "disk". When dl2 gets the format command, it will create the disk image.

More details about the disk image format disk_image_files.txt

ROOT & PARENT labels

The ROOT and PARENT labels are not hard coded in TS-DOS. You can set them to other things.
In both cases the length is limited to 6 characters.

The ROOT label is ROOT in the original Travelling Software Desk-Link.
This is what is shown for the current directory name in the top-right corner of TS-DOS when the current working directory is at the top level directory of the share path, like the root directory of a disk.
Almost anything may be used for the ROOT label.

The PARENT label is PARENT in the original Travelling Software Desk-Link.
This is shown as a virtual filename in the top-left filename slot when not in the root directory, and you press Enter on it in order to move up out of the current subdirectory to it's parent directory.
This is is limited to things that TS-DOS thinks is a valid filename.
Sadly, .. can not be used, but here are a few examples that do work.

$ ROOT_LABEL=/ PARENT_LABEL=^ dl
$ ROOT_LABEL='-root-' PARENT_LABEL='-back-' dl
$ ROOT_LABEL='-top-' PARENT_LABEL='-up-' dl
$ ROOT_LABEL='0:' PARENT_LABEL='^:' dl
or you can confuse someone...
$ ROOT_LABEL='C:\' PARENT_LABEL='UP:' dl

co2ba.sh

Also included is a bash script to read a binary .CO file and output an ascii BASIC loader .DO file,
which may then be used with the -b bootstrap function to re-create the original binary .CO file on the portable.
All KC-85 platform machines are supported including TRS-80 Model 100, TANDY 102 & 200, Kyotronic KC-85, Olivetti M10, NEC PC-8201 & PC-8300.
It's simple and doesn't handle all situations or do anything fancy like relocating, but it handles the common case and serves as a reference and starting point for making a custom loader.
See co2ba

OS Compatibility

Tested on Linux, Mac, FreeBSD, and Windows.

TODO - not all necessarily serious

  • File/filesystem access on disk images - Currently can only use disk images for sector access.
  • Verify if the code works on a big-endian platform - There are a lot of 2-byte values and a lot of direct byte manipulations because the protocol & drive uses MSB-first everywhere while most platforms today do not.
  • Figure out and emulate more of the special memory addresses accessible in tpdd2 mode. We already do some.
  • Fake sector 0 based on the files in the current share path so that if a client tries to read the FCB table directly it works.
  • Fake entire disk image in ram based on current share path files. Option to save the image as long as we're there.

New Feature Testing

real attr handling using xattr

Enable by building with -DUSE_XATTR
$ make clean all CXXFLAGS=-DUSE_XATTR && sudo make install

History / Credits

DeskLink for ms-dos 1987 Travelling Software
1.0-1.3 DeskLink for *nix 2004 Stephen Hurd
1.4 DeskLink+ 2005 John R. Hogerhuis
1.5 2019 Brian K. White
2.0 DeskLink2 2023 Brian K. White

dl2's People

Contributors

bkw777 avatar gorlik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dl2's Issues

Corrupted files after Trasnfer with DL

Hello Brian,
I have a strange behavior on my NEC PC-8201 when i transfer files with DesLink+ (actual Master branch 2.0.x)
When i start TS-DOS on my NEC and dl on my Debian Linux, anything seems to working fine.

I can load any .DO or .BA files from the current directory on my Linux Machine.
When i try to open loaded files in basic - they don't
run because corrupted.

I copied a file DSKLOG.DO from Linux PC to NEC and saved it back to Linux under different name.
And i see, that the size is different and first lines of file contains garbage. The rest of the file is normal.

DSKLOG.DO is the normal file
DSKLOGB.DO is broken file
Now i wonder, what is wrong on my configuration.

I am thankful for any help

Normal file
DSKLOG.DO.TXT

File after Transfer
DSKLOGB.DO.TXT

DLplus will not recognize any arguments

Gives the following when I try to set the base directory:

dl -p /Users/mark/Dropbox/Retrocomputing/Tandy/VirtualT/TPDD
cd: no such file or directory: /Users/mark/Dropbox/Old Compy/Tandy/VT Emulation/TPDD
DeskLink+ v2.0.000-28-gd0f80bb
Unknown argument: "-p"
Unknown argument: "/Users/mark/Dropbox/Retrocomputing/Tandy/VirtualT/TPDD"
Serial Device: /dev/cu.usbserial-1410
Working Dir  : /Users/mark/git/dlplus
Opening "/dev/cu.usbserial-1410" ... OK

Also returns the Unknown argument error for -h.

System is macOS Catalina 10.15.7

Sardine sector access is picky about the usb-serial adapter.

The Sardine dictionary somehow isn't working any more, even though the data and conversation is identical to the byte.
SAR100.CO loads fine. The problem is only when trying to invoke GRPH+F.

The order of operations and responses we give back to Sardine are identical to what a real drive does with the same disk image loaded, yet Sardine accepts the real drive and says disk error on us after receiving the first packet.

The one packet that goes is identical to that from a real drive.

Can only assume it's a timimg issue, responding too fast or too slow, but some blind guesses adding small delays between getting the 0x0D from the client and sending back the data didn't help, nor any attempts to make it go even faster by removing some of the conditional code like the debug messages.

This definitely used to work.
Might possibly also just be my 100 being marginal, need to try some other machines.
Need to go back and try the first version when the disk image feature was added.

TEENY.M10 for "german" M10

Hello bkw777,

I am an owner of a german Olivetti M10. But the TEENY.M10 program works only on the USA version of the M10.

Do you know if there is a version of TEENY.M10 for the German version of a M10?

Best Regards
a-brandt

TEENY.200 FC Error

Ever since commit 2b07aa6, the file clients/teeny/TEENY.200 does not work on my Tandy 200. I get a function call error in line 2 when I run it (using RUN "COM:98N1ENN" and dl -b TEENY.200). However, the previous version of TEENY.200 from commit 1ed2c72 works fine.


This is probably not the issue, but it looks like the problematic commit changed the end of line character from the Tandy style (CRLF) to Macintosh style (CR). You may want to ensure that git knows that those files should have CRLF terminators by creating a file called .gitattributes in the project's root and adding something like this:

*.DO    eol=crlf
*.do    eol=crlf
*.100   eol=crlf
*.200   eol=crlf
*.102   eol=crlf
*.NEC   eol=crlf
*.nec   eol=crlf
*.M10   eol=crlf
*.m10   eol=crlf
*.K85   eol=crlf
*.k85   eol=crlf

DLPLUS on MacOS X ( M1 )

Hey Brian,
First of - thanks for what you're doing for the whole retro community.

Under MacOS X ( M1 in my case) running dlplus as tpdd server with no other argument than the device name, a USB-C to serial dongle in my case

Program runs fine,

However if you let it run AND remove the USB dongle, the program loops in an error, filling up the screen... And filling up the memory, I just killed dlplus on my mac after it taking 55 Gigabytes (fifty five) of memory on my mac (didn't know this was even possible)

If you could look at that, probably just have the program exit when you remove the usb device and not loop forever (especially if it allocates ram at each loop) : that would be much appreciated

Question about using dlplus with NEC PC-8300

Hello Brian, i didn't found you email, so i will post it as an issue.
I have NEC PC-8300 with REX# RAM/ROM Extension and TS-DOS. All i want is to transfer file from my Linux PC to NEC PC-8300.
On my Linux PC i compiled dlplus, its working, my USB2SERIAL Adapter is on /dev/ttyUSB0, anything is fine.
But now i don't understand exactly, what tasks need to be done, so i can access the current working dlplus directory on my Linux PC as TPDD Drive from the TSDOS.

When i run dlplus without parameters - it starts with no errors, but the disk is not ready when i try to open it from TD-DOS with F4.
Should i first bootstrap a special file?

Maybe you will find couple minutes of time to explain the needed steps here?

I thank you very much

Pawel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.