OS/2 2.0 Asynchronous Communication Fact Sheet

First Edition (September, 1992)

The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law:

INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time.

It is possible that this publication may contain reference to, or information about, IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country.

Requests for technical information about IBM products should be made to your IBM Authorized Dealer or your IBM Marketing Representative.

TABLE OF CONTENTS

NOTICES. . . . . . . . . . . . . . . . . . . . . . . . . . . . iv

TRADEMARKS AND SERVICE MARKS. . . . . . . . . . . . . . . . . iv

1.0   AT BUS ARCHITECTURE OVERVIEW. . . . . . . . . . . . . . 1

1.1   RECOMMENDATIONS FOR ISA BUS ARCHITECTURE. . . . . . . . 1

2.0   OS/2 2.0 COMMUNICATION DRIVERS. . . . . . . . . . . . . 4

2.1   OS/2 2.0 GA DRIVER PARAMETERS. . . . . . . . . . . . . 4

2.2   OS/2 2.0 REPLACEMENT DRIVERS. . . . . . . . . . . . . . 5

2.2.1 COM_DIRECT_ACCESS DOS property. . . . . . . . . . . . . 6

2.2.2 COM_SELECT DOS Property. . . . . . . . . . . . . . . . 6

2.2.3 COMM.DRV will now support COM3 and COM4 under WINOS2. . . . . . . . . . . . . . . . . . . . . . . . . 6

2.3   OS/2 2.0 COMMUNICATION DRIVER DIFFERENCES. . . . . . . 6

3.0   OS/2 2.O COMMUNICATION TROUBLE SHOOTING. . . . . . . . 7

3.1   PORT IS NOT RECOGNIZED OR DOES NOT WORK. . . . . . . . 7

3.2   APPLICATION HANGS. . . . . . . . . . . . . . . . . . . 9

3.3   DOS/WINDOWS APPLICATIONS. . . . . . . . . . . . . . . . 9

3.4   POOR PERFORMANCE, RELIABILITY. . . . . . . . . . . . . 10

3.5   USING THE MODE COMMAND. . . . . . . . . . . . . . . . . 11

NOTICES
References in this publication to IBM products, programs, or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any of IBM's intellectual property rights or other legally protectible rights may be used instead of the IBM product, program, or service. Evaluation and verification of operation in conjunction with other products, programs, or services, except those expressly designated by IBM, are the user's responsibility.

IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Commercial Relations, IBM Corporation, Purchase, NY 10577.

TRADEMARKS AND SERVICE MARKS Terms denoted by a single asterisk (*) in this publication are trademarks of the IBM Corporation in the United States and/or other countries. These terms include: IBM Micro Channel Operating System/2 OS/2 PS/2 WIN-OS/2 Workplace Shell XGA Terms denoted by a double asterisk (**) in this publication are trademarks of other companies. Other trademarks appearing in this publication are owned by their respective companies.

Microsoft, MS Bookshelf, MS Excel, MS Flight Simulator, MS Money, and Windows are trademarks of Microsoft Corporation.

IBM DISCLAIMS ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WITHOUT LIMITATION, WARRANTIES OF FITNESS AND MERCHANTABILITY WITH RESPECT TO THE INFORMATION IN THIS DOCUMENT. BY FURNISHING THIS DOCUMENT, IBM GRANTS NO LICENSES TO ANY RELATED PATENTS OR COPYRIGHTS.

Copyright IBM Corporation, 1992, all rights reserved.

1.0 AT BUS ARCHITECTURE OVERVIEW

The original ISA machine (the IBM PC-AT) allowed for the definition of up to four serial communications ports. However, there has never been any hardware architectural standard that defined the I/O port addresses or Interrupt Request (IRQ) lines associated with communication ports #3 or #4. Over the years a convention was established which places the port addresses for COM3 and COM4 at 03E8 and 02E8 respectively. This is a generally accepted convention and is not a standard.

If multiple hardware adapters of any kind (not just communications) are using the same I/O address, then the effect on your computer will be totally unpredictable.

OS/2 2.0 is an interrupt driven operating system and requires unique I/O addresses and Interrupt Request lines (IRQs) for each adapter in the system on an ISA computer system. ISA systems have what are called "edge triggered" interrupts in contrast to Micro Channel (MCA) and EISA which use "level sensitive" interrupts. Edge triggered interrupts can only be sensed for a very short period of time. If a second interrupt arrives from another adapter while the first interrupt is still being processed, then the second interrupt will be lost. Also, if two adapters are sharing the same PHYSICAL IRQ, then the processor does not know which adapter (and therefore which OS/2 session) should get the Interrupt Request (IRQ). In a single tasking operating system such as DOS, the sharing of interrupts is not a problem as only one application is in use at a time. OS/2, however, presents a different set of problems. If we have two, three, or four serial communications adapters, the probability is now pretty high that we might try to use two or more of them at the same time. If some of them have previously been set up using shared interrupts, then the stage is set for mysterious things to happen that probably didn't happen under DOS.

1.1 RECOMMENDATIONS FOR ISA BUS ARCHITECTURE

On an ISA machine there are a total of 15 IRQ levels available. The standard settings, in order of priority, follow: IRQ# Device Associated

0      System Timer 1      Keyboard 2      Secondary Interrupt Controller  (see note) 8   Realtime Clock 9   --- (see note) 10   --- free 11   --- free 12   --- free - reserved for aux dev 13   Math Coprocessor 14   Hard Disk 15   --- free 3       COM2 (Serial Communications Port #2) 4       COM1 (Serial Communications Port #1) 5       LPT2 (Parallel Printer Port #2 - add. 278) 6       Diskette 7       LPT1 (Parallel Printer Port #1 - add. 3BC or 378) (Note: On the IBM-AT (ISA bus) the IRQ9 pin is identical with the IRQ2 pin on the original IBM-PC. If you have an older, 8-bit adapter whose documentation states that it uses IRQ2, then be aware that this will actually be seen as IRQ9 when plugged into the 16-bit ISA bus.)

OS/2 can detect that an interrupt line is shared and will disallow the simultaneous use. Assume that COM1 and COM3 were sharing IRQ4 (a fairly common real situation). If we tried to use both COM ports at the same time, OS/2 would refuse to allow the second one to start. A well-written OS/2 communications program would see and report the error from OS/2 that the port could not be opened. A DOS application, however, will likely be unprepared to respond to this strange situation, and it may simply hang, waiting for the port that will never open.

To avoid these problems, make sure that all of your hardware adapters have their own unique I/O addresses and IRQ assignments. Unfortunately, on an ISA machine, OS/2 has no way to query the computer to find out what these settings are. Therefore, after checking and setting the adapters according to the instruction manuals, you must also tell OS/2 what you've done by placing explicit information into the CONFIG.SYS file.

TO SUMMARIZE:

Even though there is some flexibility for printer and COM port assignments, try to stick to the standard assignment as shown in the IRQ table above.

The I/O addresses and IRQs are determined by the HARDWARE. The parameters passed to COM.SYS do NOT set the hardware; these parameters are a reflection of the physical hardware settings.

Available interrupts, in order of priority, are: IRQ10, IRQ11, IRQ12, IRQ15, IRQ3 (if not used for COM2), and IRQ5 (if not used for LPT2).

Physical addresses and interrupts can be indicated in OS2 to the communication drivers. Usual default settings follow: COM1 - 3F8 - IRQ 4 (OS/2 & industry default) COM2 - 2F8 - IRQ 3 (OS/2 & industry default) COM3 - 3E8 - (industry practice) COM4 - 2E8 - (industry practice) There is no OS/2 default setting for COM3 and COM4. It must be specified by the device=x:\OS2\COM.SYS statement in the config.sys file.

Printer port addresses and IRQ levels are hard coded in OS/2 as follows: 3BC or 378     ==> IRQ7 (LPT1) 278            ==> IRQ5 (LPT2) Unlike the COM ports, where the addresses and the interrupts can be specified by parameters to the COM.SYS in the CONFIG.SYS file, the printer port addresses and IRQs shown above are fixed. OS2 assigns LPT1 to the highest printer port address being used. The printer address is specified in the printer adapter board. With OS/2 you can not use both addresses 3BC and 378 as printer port addresses. Both LPTs would be sharing IRQ7. Unlike DOS, OS/2 uses interrupts for printing. The interrupt is triggered by the signal line, ACK, from the printer. If the IRQs are not configured correctly or if the printer cable is missing the ACK line, the printer may work under DOS and have problems under OS/2.

An example of address and interrupt assignments follows: COM1 - 3F8,IRQ4 COM2 - 2F8,IRQ3 COM3 - 3E8,IRQ5 (IRQ5 not being used by lpt2) COM4 - 2E8,IRQ10 LPT1 - 378,IRQ7 If interrupt devices are occasionally losing data, try moving to a higher priority unused interrupt.

2.0 OS/2 2.0 COMMUNICATION DRIVERS

Different sets of communication drivers exist. You can identify which version you are using by the date and time associated with the files. The OS/2 2.0 GA communication drivers will have a date of 3-30-92. The most current drivers will have a date of 8-10-92 or later. The version of the driver determines which parameters may be passed to COM.SYS. The driver names are: COM.SYS    The COM.SYS driver is the main OS/2 2.0 communications driver. This file is located in                  the \OS2 directory. COM.SYS processes all passed parameters. COM.SYS should be located towards the end of the CONFIG.SYS after all other serial device drivers (i.e. MOUSE.SYS).

VCOM.SYS   The VCOM.SYS driver is used in every Virtual Dos Machine (VDM). This file is located in the \OS2\MDOS directory. The purpose of the VCOM.SYS is to virtualize all interfaces to DOS applications. There are no parameters passed. VCOM.SYS should follow COM.SYS in the CONFIG.SYS file.

COMM.DRV   The COMM.DRV is used in WIN-OS2 sessions. This file is located in the \OS2\MDOS\WINOS2\SYSTEM directory. There are no parameters passed. COMM.DRV is NOT in the CONFIG.SYS file.

2.1 OS/2 2.0 GA DRIVER PARAMETERS

Those customers who have AT BUS machines and wish to use COM3, COM4, or non-standard I/O addresses must modify the config.sys file to include the following parameters for the COM.SYS driver. The parameters for the COM.SYS driver dated *** 3-30-92 *** are: DEVICE=C:\OS2\COM.SYS (n,a,i) [(n,a,i)]. . . where the last parameter is optional n = the Com port a = COM port I/O address (e.g. 03E8, 02E8) i = IRQ level For example, to specify that COM3 is at address 03E8 on IRQ5 and that COM4 is at address 02E8 on IRQ10, use the following statement (assuming that OS/2 is installed on the C: drive): DEVICE=C:\OS2\COM.SYS (3,3E8,5) (4,2E8,10) Note that this syntax is actually quite general. Non-standard parameters for COM1 and COM2 are set the same way.

The I/O address and IRQ level should be noted in the documentation that came with the adapter. Either or both might be fixed values or adjustable to a range of values via jumpers or switches. In some cases, you may find that the values are fixed or that the range of settings available to you is insufficient to avoid the sharing conflict.

2.2 OS/2 2.0 REPLACEMENT DRIVERS

Those customers who have AT BUS machines and wish to use COM3, COM4 or non-standard I/O addresses must modify the config.sys file to include the following parameters for the COM.SYS driver. The parameters for the COM.SYS driver dated *** 8-10-92 or later *** are: DEVICE=C:\OS2\COM.SYS (n,xxxx,ii,s) [(n,xxxx,ii,s)]. . . where the last parameter is optional. n    :  COM port number (usually 3 and 4 but it is possible                to configure 1 or 2 to a different IRQ or I/O                address

xxxx :  COM port address

ii   :  IRQ level

s    :  Spurious interrupt handling switch values: D or d  :  to deinstall COM driver if more than 1000 consecutive spurious interrupts occur.

I or i  :  to ignore spurious interrupts �               P or p   :  to post an error if more than 1000 consecutive interrupts occur. Some applications are not prepared for the posted error and may hang.

NOTE :  Some UART chips or malfunctioning modems can create interrupts when no interrupt is expected. These interrupts are known as spurious interrupts.

2.2.1 COM_DIRECT_ACCESS DOS property

When COM_DIRECT_ACCESS is ON, VCOM.SYS will allow a DOS application to access the communication ports directly. This DOS property makes LapLink III, FastLynx, FSDUAT, AS/400 Asynch Router, and MS WORD work in a VDM session. However, since the buffers in COM.SYS cannot be used, characters may be lost and some applications may suffer from the lack of buffering. With most DOS applications, COM_DIRECT_ACCESS should be set to OFF as the default setting.

2.2.2 COM_SELECT DOS Property

COM_SELECT allows the DOS session to select only one communication port to be used by the session. The communication ports which are not selected will be hidden from the DOS session. There are some DOS applications which take over every available communication port. This DOS property is effective in preventing those DOS applications from taking over all the communication ports. An example of a DOS application which attempts to control all the communication ports is LapLink Pro. If LapLink Pro and another application which accesses a communication port are executed at the same time, it is necessary to set COM_SELECT. The default setting is ALL.

2.2.3 COMM.DRV will now support COM3 and COM4 under WINOS2

The WINOS2 driver, COMM.DEV, will now support COM3 and COM4. This support was not provided under the General Availability (GA) release of OS/2 2.0.

2.3   OS/2 2.0 COMMUNICATION DRIVER DIFFERENCES

The major differences between the GA release of the OS/2 2.0 communication device drivers and the later release of the communication device drivers are:

a. The enhancements noted in sections 2.2.1, 2.2.2 and 2.2.3.

b. There are some ISA asynchronous devices which are not recognized by the GA COM.SYS driver. This has been corrected in the later release of COM.SYS.

3.0   OS/2 2.O COMMUNICATION TROUBLE SHOOTING

This section will give some insight into trouble shooting communication problems with OS/2 2.0. Past experience shown that most problems will be resolved by one or more of the solutions listed below.

3.1   PORT IS NOT RECOGNIZED OR DOES NOT WORK

Most problems with IRQ and I/O address settings occur on AT BUS (ISA) machines as a limitation of the hardware. IRQs are allowed to be shared on a micro channel (MCA) machine provided the adapter is MCA compatible and can be configured with the reference diskette.

A. Verify that all IRQ levels and I/O addresses are unique for every adapter. The usual problem is that communication adapters (internal modems, FAXes, etc) use COM3 and IRQ4 which is already in use by COM1. You must PHYSICALLY change the IRQ on the adapter to one which is         not in use. You need to refer to the documentation which came with the adapter and Section 1.1 of this document.

B. Verify that you are passing the correct parameters to the COM.SYS driver in the CONFIG.SYS file. Depending on         which driver you have loaded, refer to Section 2.1 or 2.2 of this document.

C. Obtain the latest OS/2 2.0 communication drivers. See Section 2.0 to verify which driver you have. You can obtain the new drivers from various bulletin boards. (Call 1-800-547-1283 for information about registering         for and accessing the IBM OS/2 BBS, or call          1-800-237-5511 for the OS/2 Support Line.)

D. If error message during boot : COMx not installed because interrupt already in use, check for an IRQ conflict with other device drivers or hardware.

E. If system (AT bus or MCA) boots without error but a COM port is still not working at all, issue a MODE command (from an OS/2 command prompt) to the problem COM port (i.e. MODE COMx:). If it indicates that the COMx port is not installed, check for IRQ conflicts. (See Section         3.5).

(If the mouse is on a COM port, the MODE command will         report a SYS1620, the COM port specified is not          installed, since the mouse has taken that COM port.)

F. If the MODE command fails, check the CMOS data area to         verify that the I/O address is listed. The OS2/DOS utility, DEBUG, will show the I/O addresses listed at         location 40:0. The procedure follows:

1. Start a DOS Full Screen Session (command prompt). 2. Enter DEBUG and press the enter key. 3. At the '-' prompt, enter D 40:0 and press the enter key. 4. You will see 40000000:00000000 followed by pairs of             hexadecimal numbers. These numbers are the I/O addresses recognized by COM.SYS. Below is an example of COM1 and COM2:

40000000:00000000 F8 03 F8 02 00 00 00 00-

This represents 03f8 (COM1) and 02f8 (COM2). If COM3 was present, it would follow COM2's address.

5. Enter Q and press the enter key to leave DEBUG.

G. If the application is a DOS communication program, set the DOS_SETTINGS to the following:

COM_HOLD:           ON          COM_DIRECT_ACCESS    ON or OFF              (*) COM_SELECT          specific COMx          (*) DOS_DEVICE:         x:\os2\mdos\comdd.sys  (+) HW_ROM_TO_RAM:      ON          HW_TIMER:            ON          IDLE_SECONDS         60 IDLE_SENSITIVITY   100

(*)  Requires the latest device drivers. (See Section               2.2).

(+)  The DOS_DEVICE (COMDD.SYS) may not be the only one required depending on the application. (For               example, Intel's SatisFAXion board requires a                device driver loaded into each VDM which will use                that adapter). The COMDD.SYS driver is usually required only for older DOS communication applications. Do not use COMDD.SYS for EVERY DOS communication session; use it only if it resolves the problem.

H. To provide a higher priority to ALL communication programs, change the following parameters in the CONFIG.SYS file:

PRIORITY_DISK_IO:   NO                   MAXWAIT:              1

I. Some DOS applications will open ALL of the COM ports. Use the COM_SELECT DOS setting for all of the VDM communication sessions (See section 2.2.1).

3.2   APPLICATION HANGS

A. If it is an OS/2 application: => Ensure your COM port works in stand alone DOS. => Using MODE command, turn off IDSR, ODSR, and OCTS (See            Section 3.5)

B. If an OS/2 application is experiencing a lot of data loss: => Lower the baud rate => Use the latest communication drivers => Change settings in the CONFIG.SYS file

C. If it is a DOS or Windows application: => Some DOS applications will open ALL of the COM ports. Use the COM_SELECT Dos Setting in all of the DOS communication sessions (VDMs). => Review previous section

3.3   DOS/WINDOWS APPLICATIONS

A. Using a BBS communication package. => WILDCAT BBS: Version 3.0 of this DOS application has been reported to work under OS/2 2.0. => Set COM_HOLD DOS_SETTING to ON. => If using a FOSSIL Driver (e.g. X00.SYS), place a REM before the VCOM.SYS in the CONFIG.SYS or set COM_DIRECT_ACCESS to ON if you have the latest communication drivers.

B. Using a FAX application which uses a COM port. => Known limitation need to operate < 9600 bps. => Use an OS/2 application for high speed fax (Currently            FAXPM, PMFAX and BitFax).

C. An application which uses QBASIC or BASIC CTTY => DOS_DEVICE: x:\os2\mdos\comdd.sys. => DOW JONES Link software requires this.

D. Some other ASYNC application. Check "Application Considerations" in the README file. Example: => CrossTalk for Windows needs BUFFER=OFF. => Mirror III is similar to CrossTalk. BUFFER can be            controlled with MODE command. => LapLink PRO, set IDSR, ODSR, and OCTS of all COM ports to OFF. (See Section 3.5.) => LapLink III, remark out VCOM.SYS or use COM_DIRECT_ACCESS. => INTEL SatisFAXion modem will ONLY work in a VDM because it requires the SATISFAX.SYS DOS device driver. => PMFAX will work with the INTEL SatisFAXion Classic card; the earlier version of CASMGR does not work on             a MCA class machine.

E. In Auto Answer mode and a call comes in: => This is a known problem for which the latest communication drivers provide better support (COM_DIRECT_ACCESS)

3.4   POOR PERFORMANCE, RELIABILITY

A. Using an OS/2 or DOS application => Try increasing/decreasing CACHE to reduce disk activity. Decreasing DISK CACHING may reduce swapping. You must experiment on your machine. => Review previous sections concerning config.sys changes and DOS_SETTINGS => Using MODE command, turn off IDSR, ODSR, and OCTS. (See Section 3.5.) => In the config.sys file, set: PRIORITY_DISK_IO:   NO             MAXWAIT:              1

B. OS/2 2.0 is a multi-tasking/processing operating system. => Slower microprocessors (i.e. 386/16mhz) are not going to have enough cycles to support communications above 9600 BAUD.

C. Even on faster machines there may be problems with supporting high speed communications. Some internal modems have been known to induce spurious interrupts which take away from the total number of interrupts that can be processed. Much depends on the quality of the hardware and the ability of the software to work with advanced communication processors such as the 16550AFN.

3.5  USING THE MODE COMMAND

Use MODE from an OS/2 Command line or DOS command line and set IDSR, ODSR, and OCTS equal to OFF. For example: MODE COM3:9600,N,8,1,OCTS=OFF,ODSR=OFF,IDSR=OFF sets COM3 to 9600, no parity, 8 data bits, 1 stop bit, OCTS, ODSR and IDSR to OFF.

If OCTS and/or ODSR are set to ON, the COM port will not transmit data unless CTS and/or DSR signal lines are enabled. If set to OFF, the COM port will transmit regardless of the state of signal lines CTS and/or DSR.

If IDSR is set to ON, the COM port will discard the incoming data unless DSR signal line is enabled. If set to OFF, the port will receive data regardless of the state of DSR.

If any problems transmitting or receiving, set OCTS=OFF, ODSR=OFF, IDSR=OFF to ensure that the hardware connected to the COM port is not preventing the port from transmitting or receiving.

The original (GA) MODE command is broke; it shows the BUFFER=N/A even though a 16550AFN buffered UART communication processor is present. The new MODE command which is shipped with the latest communication drivers corrects this problem.