VOGONS

Common searches


First post, by Alkarion

User metadata
Rank Member
Rank
Member

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.

[serial]
serial1=modem listenport:23
serial2=dummy
serial3=disabled
serial4=disabled

phonelistsize=3
phone1=localhost:1023
phone2=xxxxx.dialin.net
phone3=192.168.0.1

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).

[serial]
serial1=directserial realport:com1
serial2=dummy
serial3=disabled
serial4=disabled

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...

Troubleshooting:

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.

Reply 1 of 1, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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:
123.5.167.189
(port defaults to 23)

123.5.167.189:2000
(port 2000)

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

1230051671892000
(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. mode.com to set the serial port parameters before running your application. (Freedos mode.com 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.