Transfer Files From Linux To DOS Over Serial Cable A Comprehensive Guide
Hey guys! Ever found yourself needing to bridge the gap between your modern Linux machine and a classic DOS system? Maybe you're itching to play some retro games, or perhaps you need to update software on an older machine. Whatever the reason, transferring files between these two operating systems can seem like a daunting task. But fear not! This guide will walk you through the process of transferring files from Linux to DOS using a null modem serial cable, a method that's both reliable and surprisingly straightforward.
Why Serial Transfer?
In a world dominated by USB drives and network connections, you might be wondering why we're even talking about serial cables. Well, for older DOS machines, options can be limited. Many lack USB support, and networking can be a hassle to set up. Serial communication, on the other hand, is a tried-and-true method that's been around for ages. It's a direct connection between two computers, allowing for simple file transfers without the need for complex network configurations. Plus, it's a fantastic way to dust off those old serial ports and put them to good use!
What You'll Need
Before we dive into the nitty-gritty, let's gather our tools. Here's what you'll need for this file-transferring adventure:
- A DOS computer: This is your vintage machine, the one you'll be transferring files to. Make sure it has a serial port (usually a 9-pin or 25-pin connector).
- A Linux computer: This is your modern machine, the source of the files. It also needs a serial port, or you can use a USB-to-serial adapter if your computer doesn't have one.
- A null modem serial cable: This is the key to our operation. Unlike a standard serial cable, a null modem cable has its transmit and receive lines crossed, allowing two computers to talk directly to each other. You can find these cables online or at most electronics stores.
- INTERLNK.EXE and INTERSVR.EXE (for DOS): These are the classic DOS programs that facilitate serial file transfer. They usually come with MS-DOS versions 5.0 and later. If you don't have them, you can find them online with a quick search.
- A terminal program (for Linux): We'll need a terminal program like
minicom
,screen
, orPuTTY
to establish the serial connection on the Linux side.
Setting Up the DOS Side
Let's start by configuring the DOS machine. This involves setting up the INTERSVR program, which will act as the file server on the DOS side.
- Copy INTERLNK.EXE and INTERSVR.EXE to your DOS computer: If you don't already have these files on your DOS machine, you'll need to transfer them somehow. Floppy disks are a common option, but if you have a network card and drivers for DOS, you could also use a network share.
- Connect the null modem cable: Plug the null modem cable into the serial port on both the DOS and Linux computers. Make a note of which COM port you're using on the DOS side (e.g., COM1, COM2).
- Run INTERSVR: Open a DOS prompt and navigate to the directory where you copied INTERSVR.EXE. Then, run the program. You might need to specify the COM port you're using, like this:
INTERSVR /COM1
orINTERSVR /COM2
. If you don't specify a port, INTERSVR will try to detect one automatically. - INTERSVR Interface: Once INTERSVR is running, you'll see a screen showing the drives on your DOS computer and the corresponding drive letters that will be assigned to them on the Linux side. This is how INTERSVR shares your DOS files.
Configuring the Linux Side
Now, let's move on to the Linux side and set up the connection.
- Install a terminal program: If you don't already have one, install a terminal program like
minicom
,screen
, orPuTTY
. These programs allow you to communicate with the serial port.- For Debian/Ubuntu:
sudo apt-get install minicom
- For Fedora/CentOS:
sudo yum install minicom
- For Debian/Ubuntu:
- Identify the serial port: Determine the serial port device on your Linux system. It's usually something like
/dev/ttyS0
(for COM1) or/dev/ttyS1
(for COM2) for physical serial ports, or/dev/ttyUSB0
if you're using a USB-to-serial adapter. You can use thedmesg
command or check/dev/
to find the correct device. - Configure the terminal program: Open your terminal program and configure it to use the correct serial port, baud rate, and other settings. Here's how to do it with
minicom
:- Run
sudo minicom -s
to enter the setup menu. - Go to "Serial port setup."
- Set the serial device to your port (e.g.,
/dev/ttyS0
). - Set the baud rate to 115200 (a common choice, but you can try lower rates if you have issues).
- Set the data bits to 8, parity to None, and stop bits to 1 (8N1).
- Disable hardware and software flow control.
- Save the configuration and exit the setup menu.
- Run
- Connect with INTERLNK: In your terminal program, run INTERLNK. You'll need to specify the COM port you're using on the Linux side. For example, if you're using
/dev/ttyS0
, runINTERLNK /COM1
(assuming COM1 corresponds to /dev/ttyS0). If INTERSVR is running correctly on the DOS side, INTERLNK should connect and display the shared drives.
Transferring Files
With both sides set up, you can now transfer files! INTERLNK essentially creates virtual drives on your Linux machine that correspond to the drives on your DOS computer. You can use standard DOS commands like COPY
to move files between these drives.
For example, let's say your DOS computer's C drive is mapped to drive E: in INTERLNK. To copy a file named MYFILE.TXT
from your Linux machine's current directory to the C drive on your DOS machine, you would use the following command in the INTERLNK session:
COPY MYFILE.TXT E:
Similarly, to copy a file from the DOS machine to the Linux machine, you would reverse the source and destination:
COPY E:\MYFILE.TXT C:
Remember that the drive letters may be different depending on your setup. The INTERLNK screen will show you the drive mappings.
Troubleshooting Tips
File transfers don't always go smoothly. Here are a few tips for troubleshooting common issues:
- Connection Problems: If INTERLNK can't connect to INTERSVR, double-check your serial port settings (baud rate, data bits, parity, stop bits) in both the terminal program and INTERSVR. Make sure the null modem cable is securely connected.
- Data Corruption: If you experience corrupted files, try lowering the baud rate. Higher baud rates can be more prone to errors, especially on older hardware.
- INTERLNK Errors: If you get errors from INTERLNK, make sure you're using the correct COM port and that INTERSVR is running on the DOS side.
- Permissions Issues: On the Linux side, ensure you have the necessary permissions to access the serial port device. You might need to add your user to the
dialout
group (e.g.,sudo usermod -a -G dialout yourusername
) and log out and back in for the changes to take effect.
Alternatives to INTERLNK/INTERSVR
While INTERLNK and INTERSVR are classic solutions, there are other options for serial file transfer. Here are a couple of alternatives:
- Kermit: Kermit is a file transfer protocol that's been around for decades. It's robust and reliable, and there are Kermit clients for both DOS and Linux. Setting up Kermit can be a bit more complex than INTERLNK, but it's a solid choice if you need more advanced features or are having trouble with INTERLNK.
- Serial Terminal Programs with File Transfer Capabilities: Some serial terminal programs, like
minicom
, have built-in file transfer protocols like Xmodem, Ymodem, and Zmodem. These protocols can be used to send and receive files directly through the terminal.
Conclusion
Transferring files from Linux to DOS via serial cable might seem like a blast from the past, but it's a practical solution for anyone working with older DOS machines. With the right tools and a bit of patience, you can easily bridge the gap between your modern and vintage computers. So go ahead, dust off that null modem cable, and get those files moving! You will be playing Doom on your vintage machine in no time! Have fun, guys!