Networking DOS

... enough to be useful.

In this episode, we learn that TCP/IP sucks on DOS, and my quest to find a reasonable method of version control across two machines that can't actually talk to one anther directly.

Not without some big caveats, anyway.

I needed to get my DOS machine networked with my PC to transfer files back and forth. Null modem serial cable transfers are slooooooooow. Floppy disks are inconvenient and for the first few days I couldn't even find any.

Seriously. In the bay area, try finding a floppy disk for sale without going to Weirdstuff. VHS tapes? Sure. Super-proprietary DV tapes that nobody's looked for in over a decade? Practically in every corner store. Floppy disks? Hahahaha no. And I'm talking about the 3.5" 1.44M variety here. Not the older 5.25" kind.

Back to networking. There are a ton of different, incompatible network stacks for DOS. They're (almost) all ancient, lacking documentation, and only kinda half work most of the time. Oh yeah, and TCP/IP was in its infancy back then, so you mostly have to rely on weird esoteric protocols that nobody remembers or uses anymore. IPX, Netbios, various things with "Novell" at the beginning of them.

Some of the stacks available are...


mTCP is a TCP driver and a collection of TCP/IP utilities for DOS. This (combined with a NIC-specific "packet driver") lets me transfer files to and from the 486 over FTP. It's incompatible with Microsoft's network client, though.

Make sure you pick some network card that has a DOS packet driver available for it. Two cards I've had success with are the 3COM Etherlink III (ISA) and the Linksys LNE100TX (PCI) cards.

mTCP worked well, and let me transfer files by FTP (with TCP) from one machine to the other over Ethernet using the 3COM Etherlink III card. But it was invonvenient to manually move stuff back and forth all the time, and made keeping track of versions and branches difficult.

Microsoft Network Client for DOS

Microsoft's network client was one of the ways you could do networking "back then". Using it opens up a lot of more conventional (if old) options for networking our machine.

There's one version of it for DOS that I just couldn't get to work, but even if you could, the TCP driver takes up 200kb of your 640kb of conventional memory, so good luck getting anything else done with that. My specific use case was to keep my code on a network share and compile from that, while using Git on the host computer to do version control. The compiler won't run with that much conventional memory being used. So the only-DOS version of the MS network client is out of the picture for the rest of this.

Microsoft Network Client for Windows 3.11

First, let's get this out of the way. Windows 3.11 supports TCP/IP out of the box. There's an update to the one that comes with it. Get it here. The old TCP/IP driver is buggy. Don't use it.

Mounting a Linux Samba share over TCP from within Windows 3.11 works. It works great. I could totally do all my work and file transferring using this if it weren't for one thing. My DOS game doesn't work under Windows 3.11. Windows 3.11 gets very cranky and demands that you reboot with some pretty dire warnings about how you have disturbed the sanctity of the system integrity or somesuch. It's mostly about how I'm talking to SoundBlaster card. So I'm limited to working in DOS, and using Windows for the occasional task outside of the normal development iteration process.

A lot of the Windows 3.11 networking features do work in DOS. The TCP/IP driver is not one of those features, as far as I can tell. At the moment I can use the "net" command to use network features like mounting network shares, but I'm limited to non-TCP protocols like Netbeui. So I'm still out of luck as far as mounting my Linux machine across the network while in DOS on the 486.

The "Solution"

Linux and modern Windows OSes like Windows 10 don't talk Netbeui, but another DOS/Win3.11 machine in a VM does! And no, I can't mount that Windows 3.11 share from a Linux box. I tried. The idea of both the DOS and Linux machines mounting the same share (through Netbeui and TCP respectively) to both have shared access to the files is so close to working, but the Linux CIFS/Samba tools seem to half-understand the Win3.11 shares. It can see a directory structure but no files, and fails to mount with stuff like smbfs.

So that's the state I'm in right now. Code files hosted on a DOS/Win3.11 VM, which I occasionally bring down so that the filesystem can then be mounted as a loopback device on my desktop and I can do commits to version control. It's a pretty weird setup, but it works.

There might be another solution to this, which would be to use something like Windows XP in a VM. It's old enough to still support Netbeui (I checked) and new enough that maybe smbfs won't screw up talking to it.

Honorable mentions

I made a couple of unsuccessful, or barely-half-successful attempts to mount the Linux drive on the DOS machine directly, or the DOS drive on the Linux machine directly. Sadly, neither of these worked very well.

I tried using mTCP's FTPSRV.EXE + CurlFTPFS on Linux to mount a DOS drive over the network. This seems to result in a sort of half-working filesystem that can read files okay, but can't edit them. I don't know if I need to blame CurlFTPFS or mTCP for this one.

Another thing I tried was NFS and, holy crap, the NFS protocol is much older than I knew. There are some NFS servers for DOS, which allowed me to mount from Linux after a LOT of messing around. Of the two NFS servers I tried, one just didn't work, and the other wouldn't allow me to read any directory where a listing would use more than 1024 bytes of data. Oh well.

Update: Since writing this article, I experimented with some other Windows operating systems in a VM. Windows XP didn't work (the DOS machine couldn't mount it). Windows 95 didn't work (the Linux machine couldn't mount it). Windows 98SE... did work!

So my code and data live on a Windows 98SE VM, which has a shared folder mounted by both the Linux and DOS machines. The rest of the Git repo lives on the Linux machine, but compiling and testing happens on the DOS machine.

Update 2 (2020-11-17): EtherDFS is a much better DOS/Linux shared drive setup. Use that instead of any of this garbage!

Posted: 2017-04-12

Tags: dos, devlog