On 8/21/21 1:01 PM, Stephen Adolph wrote:
Pretty cool stuff Brian.  Do you see any roadblocks to full directory support for ts dos?

Nope. Easy.


Is it tolerant to different extensions?

It doesn't care about the filenames at all except for the minimum necessary to be compatible with "Floppy" (and thus, all other dos's which themselves all had to be compatible with "Floppy")

The drive just has a 24 byte field and it doesn't care what you put in there except the first byte can't be nul.

But "Floppy" writes filenames in a padded 6.2 form, and expects to read filenames in that form, and only because of that, all other dos's and clients that wish to be compatible with "Floppy" must also do that.

So this does that too. But it's only a default which can be disabled, and even while enabled it only applies to any filenames that already fit within 6.2.

So, if it see's "A.BA" it will pad that when writing to the disk, and un-pad it when reading back from the disk.

But if it sees A_long_name.v1.2.tar.gz it doesn't change it other than to clip it down to 24 bytes if it was longer.

One thing I haven't tested yet is WP-2 compatibility. If WP-2 pads/un-pads it's filenames the same way, then I'll need to adjust that to encompass 8.2 or 8.3 or whatever WP-2 does.

An option to care even more about the names, even munge the data in some cases like Laddie does might not be a bad idea. But only as an option and probably not enabled by default.

I also just discovered I'm not handling the filenames well enough and it's currently impossible to for the user to enter a filename with spaces in it. It's because of the cheap trick I used to allow multiple commands on one commandline separated by ";". But I'll fix that shortly.


Could you redirect a TCP port to an instance of this?

That is worded like you mean the connection to the user, which makes no sense to me, so I'm going to pretend you meant the connection to the drive.

Let's try it...

$ socat TCP-LISTEN:35000,fork /dev/ttyUSB0,raw &
[1] 409576
$
$ socat  pty,link=ttyV0,raw  tcp:localhost:35000 &
[2] 409578
$ ./pdd ttyV0
TPDD(opr)> ls
------ Directory Listing ------
Floppy_SYS                11520
SETRAM.BA                   208
-------------------------------
88320 bytes free
TPDD(opr)>


Yes. ;)

(Ok I cheated a little. I did have to make a change to allow specifying a tty device outside of /dev, otherwise you'd have had to run the 2nd socat as root so that you could create "/dev/ttyV0" instead of just "ttyV0". So once you re-download, you can do this example too.)


The first socat provides a tcp server listening on port 35000, connected to the real drive.

The second socat provides a virtual serial tty "ttyV0" in the current directory, connected to host:35000 as a client.

Finally I told pdd to use "ttyV0" instead of searching for /dev/ttyUSB*

Another option, ksh or zsh can do tcp natively, without needing socat or netcat etc. But the code would need a little adjusting for other shells. ksh and zsh are both advanced shells that support all the same fancy stuff I'm using in here, so most of it is fine, but there are some differences in the details so it wouldn't work out of the box without a little fiddling.

--
bkw

Reply via email to