VOGONS


First post, by bjbdragon

User metadata
Rank Newbie
Rank
Newbie

This is my first post here, but I'm on the verge of completing something and would love some input.

I've got an old PC Partner XL 386 SX, not sure exactly what the UART is but I seem to only be able to push 57600 baud. Even with the dial-up like speeds, I really want a way to get some kind of shared drive set up. Anyway, I got EtherSL set up and played around with mTCP. I've heard of EtherDFS before but never had a chance to play with it. A 7k TSR would be just lovely - this machine is already loaded down with tons of TSRs (DriveSpace, SmartDrv, Parallel Zip) so I didn't really want to go the Microsoft Network Client route.

Sadly, after trying for hours getting the 386 to link up with my Linux machine - I do some packet dumps and realize that EtherSL is stripping the Ethernet frames. Of course it is. It's faking an Ethernet packet driver. After a little research I learn that PLIP actually sends Ethernet frames and I could build or buy a parallel port adapter. But I am already using my parallel port for a Zip 100 drive, and I do kind of want to be able to do this over a real dial-up modem someday. In desperation, I tried Microsoft Client but was drowned in terminology, commands, and configuration files I only vaguely understood. After days of fiddling I got nowhere.

Finally, I decide it's more work to dig through the far reaches of the Internet than to hack something up on my own. Looking at EtherDFS documentation again, I notice there's a convenient 38 bytes of "garbage". And there's even a little note about possibly using it to fake UDP/IP headers. It took a few days as I really have never done DOS code, let alone resident stuff. Most of the changes were minor though the offsets were a challenge:
* Input the IP addresses for local machine and remote server
* Construct a UDP/IP header outside of the resident code with my IPs and port 0xEDF5 (EtherType of EtherDFS).
* Implement an IP checksum in the TSR as my packets were just getting filtered
* Modify ethersrv to listen on a normal UDP port just like any other network program (as opposed to the raw socket, which doesn't see UDP/IP packets at all)
* Fix the offsets in ethersrv because now I'm not getting the full frame
* Add yet another IP for "reply to" since gateway zapped my source address
* Find out I've messed up even more odd offsets in the checksum routines.
* Notice I get split up response packets because of my MTU... reduce the framesize in the client.

I started off using this particular version modified by Michael Ortmann:
v0.8.2m [20200603]
- reduced EtherDFS resident footprint

I feel like I'm almost done but I'm running into a few issues. I'm able to do most operations, but when copying a file in Dos Navigator I get an error that the file already exists (with a zero size). Choosing to overwrite or append the file both works just fine and the file transfers at a steady 5KiB/s (40kbps). Trying to wipe a directory with deltree likewise gave me an error telling me I should run ScanDisk. But I seem to be able to do most file operations and md5's and zip -Tv of a 30MB file checks out. Any other EtherDFS users out there who could tell me if it handles Dos Navigator correctly?

Is there anything I might need to be concerned with in this hack, especially regarding data integrity?

Greetings,
bjbdragon

Reply 1 of 3, by doshea

User metadata
Rank Member
Rank
Member
bjbdragon wrote on 2021-03-27, 04:35:

In desperation, I tried Microsoft Client but was drowned in terminology, commands, and configuration files I only vaguely understood. After days of fiddling I got nowhere.

Finally, I decide it's more work to dig through the far reaches of the Internet than to hack something up on my own.

I would have thought there would be modern instructions (quite possibly somewhere on this forum) for using Microsoft Client since it seems like a reasonably popular solution, despite the memory usage.

It took a few days as I really have never done DOS code, let alone resident stuff.

Well that's quite a learning experience then!

Apologies, I don't have any answers to your important questions here, I was instead thinking of some alternatives which I thought I'd share in case you or anyone else is interested in trying them.

My first thought was that having to construct IP headers you don't really want just to get the packets transported over a serial port seems a bit wasteful in terms of code size and effort when you could "just" use the serial port directly. However, I realised that EtherDFS would almost certainly want framing - it's surely not stream-based - so it would require some more complicated work. I imagine it might save a little RAM though, due to not needing a packet driver.

Another thought was: what about historical solutions for sharing over a serial port? For example MS-DOS 6 came with InterLink which did this kind of thing over a serial or parallel port, and apparently (based on a Google search) the client only required 8KB of RAM. Of course the server also runs on DOS, but I would imagine that you could run that in a virtual machine of some sort where it's sharing drives you've previously connected to via EtherDFS, Microsoft Client, etc. At least I hope that InterLink doesn't have any restrictions on re-exporting network drives; I don't imagine it would since I know that for some similar applications like pcAnywhere, serving as a bridge to your LAN was a feature. Of course requiring a bridging VM isn't as convenient as just having a server application, but on the other hand it might be possible to solve your problem without writing any code. I have had issues with emulators communicating with physical machines over serial where the emulator was running too fast though, so it might not be as easy to get working as one might hope.

Good luck with your project!

Reply 2 of 3, by bjbdragon

User metadata
Rank Newbie
Rank
Newbie
doshea wrote on 2021-03-28, 08:46:

I would have thought there would be modern instructions (quite possibly somewhere on this forum) for using Microsoft Client since it seems like a reasonably popular solution, despite the memory usage.

There seem to be modern instructions on setting it up... just not the serial line method with all the layers between packet driver, odi, ndis.

doshea wrote on 2021-03-28, 08:46:

My first thought was that having to construct IP headers you don't really want just to get the packets transported over a serial port seems a bit wasteful in terms of code size and effort when you could "just" use the serial port directly. However, I realised that EtherDFS would almost certainly want framing - it's surely not stream-based - so it would require some more complicated work. I imagine it might save a little RAM though, due to not needing a packet driver.

Yeah EtherDFS is based on Ethernet Packet driver framework so, yes it expects framing. And there are existing historical solutions that are very lightweight for doing a direct serial link. The first I played around with was simply a Linux terminal and the sx/b/z ccommands. (never did get zmodem to work).

doshea wrote on 2021-03-28, 08:46:

Another thought was: what about historical solutions for sharing over a serial port? For example MS-DOS 6 came with InterLink which did this kind of thing over a serial or parallel port, and apparently (based on a Google search) the client only required 8KB of RAM. Of course the server also runs on DOS, but I would imagine that you could run that in a virtual machine of some sort where it's sharing drives you've previously connected to via EtherDFS, Microsoft Client, etc. At least I hope that InterLink doesn't have any restrictions on re-exporting network drives; I don't imagine it would since I know that for some similar applications like pcAnywhere, serving as a bridge to your LAN was a feature. Of course requiring a bridging VM isn't as convenient as just having a server application, but on the other hand it might be possible to solve your problem without writing any code. I have had issues with emulators communicating with physical machines over serial where the emulator was running too fast though, so it might not be as easy to get working as one might hope.

I will certainly be trying out something like InterLink, or dosrifs2 at some point. I seem to recall DosBox-X not having the ARM dynarec setup properly... and definitely not going to want to run under full emulation.

As of now, I've got the 386 PC calling the modern computer over a US Robotics 56k external modem... it's not just hanging right off the COM2 port anymore. And the bottleneck is the COM port (several diagnostics software programs claim UART 16450 ... 1byte buffer - no wonder things are terrible!) but the modem has greatly increased the latency. And wow, EtherDFS seems to really not like it causing half of the files in a directory to not show up. Probably because 280ms ping times on raw Ethernet is pretty improbable. Of course, in a real IP network it's got to be able to handle some lag. Still working on trying to make it more robust.

I'm going to have to package up my changes so I can at least put them out there for anyone interested... it's by no means complete, in fact very broken in some ways but at least serves as a proof of concept for networking. However - I did discover that I'd need even more TSRs (pktmux, pktdrv) to even share the packet driver, so it's starting to look a little more bloated to me.

Thanks!

Reply 3 of 3, by doshea

User metadata
Rank Member
Rank
Member
bjbdragon wrote on 2021-04-02, 05:06:

There seem to be modern instructions on setting it up... just not the serial line method with all the layers between packet driver, odi, ndis.

Oops, when I suggested that there were instructions, I forgot the context of it being over serial!

Yeah EtherDFS is based on Ethernet Packet driver framework so, yes it expects framing. And there are existing historical solutions that are very lightweight for doing a direct serial link. The first I played around with was simply a Linux terminal and the sx/b/z ccommands. (never did get zmodem to work).

Oh yeah, if mounting the remote filesystem isn't a requirement, there are a lot more options available. I've had trouble with zmodem when using emulation too, I think it might have been due to one or both of (a) the emulated system running too fast, and (b) when I had emulated systems talking to each other via a local TTY pair on Linux, I don't think there was any emulation of the serial control lines (e.g. hardware flow control). If I recall correctly, the older protocols send a single packet and then wait for a reply, but zmodem will send multiple unacknowledged packets so is more likely to exhaust buffers, etc. Not having a 16550 UART is probably not going to help either!

Another option is using Microsoft's RAS (Remote Access Service) which was their solution for NetBIOS (and some other protocols, but not TCP/IP, I think) over a modem. This is probably also hard to find information for online, but maybe old TechNet CDs contain articles about setting it up.

dosrifs2

Nice, I hadn't heard of that one before, thanks!