Tactical Software Tech Note

 


All Tech Notes

Using Tactical Redirectors with DOS Applications

Overview

Tactical Software redirectors primarily support Windows applications that interact with the virtual COM ports created by the redirector.  Tactical Software redirectors also also include limited support for DOS applications running under Windows.

There are two types of DOS applications that use COM ports. They are:

  1. Direct COM port access.  This common type of DOS application uses a COM port by directly accessing the COM port hardware (also known as the UART).  
  2. System BIOS access.  Found less often, this type of DOS application may also use a COM port through the system BIOS that leverages an interface known as INT14.  Many programs intended for use with bulletin board systems (BBSs) use an enhanced version of this interface known as FOSSIL.

UART-based Applications

Under Windows XP, NT and 2000, DOS applications that manipulate the UART hardware directly are able to access both virtual COM ports and standard ports in the COM 1-4 range using the NTVDM driver (NT Virtual DOS Machine) that ships with these versions of Windows.  The NTVDM is a library that maps 16-bit APIs into 32-bit APIs. It is installed by default.

DOS applications will not be able to access ports above COM4 using this mechanism.   Also be aware that Tactical Software's testing has shown that not all DOS applications perform well under NTVDM, even with the standard COM port driver.

Under Windows 98 and Me, DOS applications that access the UART (universal asynchronous receiver-transmitter) directly are not supported directly by Tactical Software redirectors.

INT14 / FOSSIL Applications

Tactical Software redirectors support INT14/FOSSIL applications on all Windows platforms.  This includes FOSSIL-5 with the X00 extensions as well as the simpler INT14 BIOS interface.  A DOS application that supports INT14 or FOSSIL will be able to use any of the virtual COM ports created by Tactical Software redirectors.

Note: In order to use INT14 applications, the Tactical Software INT14 utility software must be installed. This loads a driver which enables the DOS sessions to take place. To get this software, download DOSINT.exe.zip.  This ZIP archive contains the setup program.

Under Windows 98 and Me, the INT14/FOSSIL driver is loaded automatically at boot time.  However, under Windows XP, NT and 2000, this driver support is by default loaded only on demand.  For these operating systems, installing a Tactical Software redirector adds a new command called "tsnt14."  For any given DOS window, be sure to run the tsnt14 command prior to running any DOS applications which require INT14 or FOSSIL support.  This loads the INT14/FOSSIL driver support for that DOS Window only.

Note: This command is required to be run in each DOS Window which requires INT14/FOSSIL support to be activated.

It is also possible to unload the driver by rerunning the command using a /u option.  For example, to run a BBS which requires FOSSIL — and then unload the FOSSIL driver use the following commands:

tsnt14
bbs
tsnt14  /u   NOTE: In Windows 2000, this must be tsnt14 //u

In certain situations it may be desirable to have the FOSSIL driver enabled for all DOS sessions.  One example is hosting a BBS that spawns external programs. In this case add the tsnt14 command to the end of the autoexec.nt file. To edit the autoexec.nt file, simply use the Run command in the Start menu and enter the following command:

notepad %SYSTEMROOT%\SYSTEM32\autoexec.nt

INT14 / FOSSIL Options

The DOS/INT14 settings for each COM port can be changed through the DOS/INT14 Configuration Utility.  To open the utility, go to the Windows Control panel and open the DOS/INT14 Configuration Utility icon. This opens the DOS/INT14 Configuration Utility window.

A list of all Windows COM ports appears in the box on the left.  For each selected port, the right section is divided into three sections: Settings, Queue Sizes and Options values.

Settings. These COM port settings are applied to the COM port when it is first opened via INT14.  Note: The default value for each setting is "no default." This means that no extra COM port configuration is done by the INT14 driver. The example shown above is keeping the original default settings.

  • Baud Rate. Use this if a DOS application needs to operate at a particular modem speed. In most cases the "no default" choice works fine.
     
  • Word Length. Use this if a DOS application needs to operate with a particular word length. In most cases the "no default" choice works fine.
     
  • Parity. Use this if a DOS application needs to operate with a particular parity setting. In most cases the "no default" choice works fine.
     
  • Stop Bits. Use this if a DOS application needs to operate with a particular stop bit setting. In most cases the "no default" choice works fine.
     
  • Lock Settings on Port. When checked, the default COM port settings are "locked" to the COM port. Subsequent attempts to change the COM port settings via INT14 are ignored by the driver. When unchecked, a client application is free to override the default settings.

Queue Sizes. These two fields set the number of bytes that the INT14 driver will request for the transmit and receive queues on the highlighted COM port. The default is 4096, and the value can range from 16 to 16384. For most applications 4096 will be adequate, given that TCP/IP connections implement their own flow control.

Options. The following checkbox options are presented:

  • Enable Fossil Driver. When checked (the default setting), the built-in INT14 redirector will respond to requests on the highlighted COM port. When unchecked, requests on this COM port are passed along to the next driver, if one is present.
     
  • Coalesce Outgoing Data. To minimize ring transitions and to optimize throughput, the built-in INT14 redirector will buffer small amounts of outgoing data (from the client application to the COM port) for up to 50ms before releasing it. If this option is checked (the default setting), this buffering is enabled. If unchecked, the buffering is disabled and outgoing data is always handed over immediately to the COM port.
     
  • Release Time Slices When Port Idle. When checked (the default setting), the INT14 driver will release the time slice for the DOS session when it detects the port is idle and the session has requested a data-related INT14 service. The port is considered idle when DCD is low and there is no data in the transmit or receive queues. If a client application is suffering from performance or throughput issues, try disabling this option.
     
  • Hold Port Open During MSDOS Session. The default behavior (unchecked) is for the INT14 driver to close the COM port 6 to 10 seconds after seeing a FOSSIL close request, or after 30 seconds of inactivity when the DOS application is using the minimal INT14 BIOS interface. Checking this option will cause the INT14 driver to never close the COM port during the DOS session in which it was opened.

    Note: If checked, the INT14 BIOS applications will not timeout, and the FOSSIL close request will be ignored. This option is mainly used for BBS programs with "doors" that open FOSSIL ports in a non-standard way.

The TSLOCK Utility

The TSLOCK command allows the parameters found in the Settings area of the DOS / INT14 Configuration Utility window to be changed with a DOS command. The TSLOCK command line and options are:

tslock COMx [baud,length,parity,stop] [ locked |
unlocked ]

The first parameter is the COM port to be adjusted. Following that can be the port settings and/or the locking status for those settings. For example, to set COM4 to a 57600 8-N-1 and lock those settings, use the following:

tslock COM4 57600,8,N,1 locked

To then unlock COM4's settings without affecting their current value, use the following:

tslock COM4 unlocked

To change COM4 to 38400 7-E-1 without affecting the locking status, use the following:

tslock COM4 38400,7,E,1

Note: This command changes the settings as seen in the DOS / INT14 Configuration Utility window interface, where you can see the results of running this command. These settings will only take effect upon the following conditions:

  1. A FOSSIL application opens or reopens the COM port.
     
  2. A FOSSIL application attempts to change the settings of the port.

Application Summary

For most client applications such as terminal programs, the default DOS port settings should be sufficient. For most BBS-hosting programs, the recommended settings are to disable the Release Time Slices option and to enable the Host Port Open option.

Note: All DOS-related settings have no effect on Windows applications. It is counterproductive to experiment with these settings when troubleshooting Tactical Software redirectors in conjunction with non-DOS applications.