Directserial and Modem Guide

For Documentation: Userguides and howto's.

Directserial and Modem Guide

Postby Alkarion » 2006-2-28 @ 23:17

As many users have problems setting up directserial/modem connections, here's a short guide to getting Dosbox talk to the outside world. Since directserial/modem support is still being updated regularly, you need a recent CVS, links can be found in the Dosbox Development Forum (For the most recent Windows binaries see this page).

Configuration of directserial/modem functionality is quite easy and is done (surprise!) via dosbox.conf.

Suppose you want an emulated modem on COM1 listening on port 23, then the following configuration can be used.

serial1=modem listenport:23


Only the settings of the first paragraph are really needed. The second paragraph specifies phonenumbers to be used with programs that don't support dots in between numbers. Which brings me to the next point: setting up a connection. On a second computer (or with a second instance of Dosbox, for testing) the same configuration is used. Start dosbox and the game you want to use the modem with (one side has to be configured for answering, the other dials). The number dialed should be the full IP address of the computer to which you want to connect (with dots). If it is not possible to dial such an address, you have to specify the address in the phone list (second paragraph of [serial] config) and simply dial x (where x is the number in the phonelist, eg 1 for phone1).

Ok, so much about modems. Directserial is a lot easier, as in most cases there's not much to be set up. The following configuration can be used to set up a directserial connection to the real COM1 of your computer (realport) which shows up in Dosbox as COM1 (ie serial1).

serial1=directserial realport:com1

Well, if you're lucky, it already works with this simple setup. If you're not you may try to configure the more advanced options as there are: irq, startbps, bytesize,stopbits, parity (all optional).
These are all give by adding the parameter (in the same line) in the form parameter:value. Example:

serial1=directserial realport:com1 startbps:1200 parity:e bytesize:8 stopbits:1 irq:4

I can't give any further advice on this, though, since I know almost nothing about this. Perhaps Hal (who by the way, greatly enhanced or added to dosbox all this functionality) can add some information here. If you have an app requiring additional parameters you should know what you're doing anyway...


1)Check every line of dosbox.conf in the [serial] section. Small errors can be disastrous...
If the modem is correctly set up, the dosbox console should have a line "MODEM: Port listener installed at port 23" in it on startup. For directserial, the corresponding line is "Serialport at xxx: Opening COMx"

Also, if the modem is initialized or dialing starts, there should be corresponding output on the console. If this is missing, either the modem is not correctly configured or the game/app is not yet supported.
2)Check your firewall setup. Is Dosbox blocked? Are the modem ports blocked?
3)Set core=normal, some games/apps have still problems with the dynamic core
4)Make sure the com port isn't used my something else.
5)Increase or decrease cycles.

I'll gladly add information I forgot or correct mistakes. Feel free to add info or to submit the names of successfully tested games. If you have questions concerning directserial/modem these should go here.
User avatar
Posts: 230
Joined: 2003-9-21 @ 18:07
Location: Bonn/Germany

Re: Directserial and Modem Guide

Postby h-a-l-9000 » 2006-3-01 @ 01:52

Hey, nice work. I wonder if some of it should be put into readme?

My remarks:

phone* and phonelistsize are not part of CVS, only in my modem patch. I also got rid of phonelistsize because it did not work as intended. Instead there are now 10 fixed phone*.

Listenport is optional, port 23 (Telnet) is default. On Linux computers ports < around 1024 can only be used with root access, so if you are on a linux computer use listenport:[something > 1023]. In that case on the computer that 'dials in' you have to specify the port number.

Formats that the modem dial (phone number) can use:
(port defaults to 23)
(port 2000)

(for modem apps that don't allow anything but numbers, mind the 005)

(port 2000)

computername/DNS name
(for modem apps that do allow letters)
(but only if your network is set up properly)

computername/DNS name:2000
(port 2000)

There is a trick with games that don't like the modem and support direct serial connection. Use a modem terminal software to establish the connection, then tell the terminal to go to command line and run your game pretending to have a direct serial cable connection. It sometimes works.

The serial ports can be changed at runtime - type i.e.
serial1 modem
at the Dosbox command prompt to change to modem. Useful if you started Dosbox and realized that your conf has no modem set ;)

irq, startbps, bytesize,stopbits, parity:
irq (hardware interrupt) can sometimes be chosen in the modem application. It should match here. Normally you would not have to bother. Defaults are (as on real computers):
COM1 irq4
COM2 irq3
COM3 irq4
COM4 irq3

The other settings are only required if you had to use i.e. to set the serial port parameters before running your application. (Freedos appeared to work with Dosbox serial ports.)

realport:COM5 and up can be used - useful for USB/serial converters.

If you get overrun errors or timeout problems (symptoms can vary) increase the emulation speed, your application may need more processing power to compute all data.

Limitations of the Dosbox serial ports:

The DOS COMx devices are not emulated, your last chance ist to boot a DOS inside Dosbox (see Guides forum on how to do this) if your app needs them.

Timing is different than on real hardware. I.e. Sending data will immediately trigger an interrupt, while it would take some little time on a real serial port. This could be a problem for some apps.

A modem 'dialing' will immediately say it's connected while it's still 'ringing' on the other side.
DOSBox Author
Posts: 4512
Joined: 2005-2-23 @ 00:14

Return to DOSBox Guides

Who is online

Users browsing this forum: No registered users and 1 guest