DOS_COM.TXT Serial Utility Diskette 1997 ********************************************************************* Technical Note August, 1993 Subject: MS-DOS and PC-DOS Serial Communications - COM: Ports with DOS Starting with MS-DOS and PC-DOS version 3.30, four COM: ports are supported by the operating system. Versions of DOS prior to version 3.30 only supported COM1: and COM2:. MS-COMPAQ DOS version 3.31 only supported two COM: ports. - Default Address and Interrupts The default address and interrupts for COM: Ports are outlined in the following table: COMx: Base Address Interrupt (IRQ) ------------------------------------------- 1 3F8 Hex 4 2 2F8 Hex 3 3 3E8 Hex 4 * 4 2E8 Hex 3 * * NOTE: COM3: and COM4: Interrupts are not standard settings, merely the most used DOS setting. These values may be different for different applications (Refer to the section below on Interrupts). - BIOS support When DOS or a DOS application uses a COM: port, the address of the port is retrieved from the BIOS / DOS Data Segment, located in low memory at segment 0040 hex, offset 0000 (0040:0000). A two byte space is reserved for each port that is supported under DOS. This data segment holds information about hardware settings and miscellaneous system information. During 'boot up', the BIOS Power On Self Test (POST) will test the default COM: Port Address and initialize the Data Segment if a valid port is found. This usually does not present a problem, however some older POST routines only test for two COM: ports. If this is the case then the BIOS / DOS Data Segment for COM3: and COM4: are left empty, signaling to DOS that COM3: and COM4: are not present. This problem is easily remedied by the utility program SETCOM. This program will initialize the BIOS / DOS Data Segment with the Base Address of your COM: Port, allowing DOS and DOS applications access to your COM3: and COM4:. Another unique advantage of the SETCOM utility is that it allows the use of non-standard COM: Port address. This would be very useful if there was an I/O address conflict with another interface adapter installed in the computer. The SETCOM utility program is available on the Serial Utility Diskette that is provided with the hardware. - Interrupts and COM: Ports Typically COM1: and COM3: are assigned to IRQ4 and COM2: and COM4: are assigned to IRQ3. This setting is the typical setting for interrupts and DOS COM: ports, but not the standard. DOS does not assign Interrupts (IRQs) to a COM: Port. The COM: Port services provided by DOS through Interrupt 14h are not interrupt driven. This results in very poor performance when using the DOS interrupt 14h calls to service the COM: Port. Typically, applications assign each COM: Port an interrupt and service the port in an interrupt driven fashion. This allows the COM: Port to be serviced more efficiently. When this is true, COM3: and COM4: usually are assigned an interrupt other than IRQ4 or IRQ3 because the mouse driver is loaded into memory and is servicing IRQ4 or IRQ3 (depending on where the serial mouse is installed). Many DOS applications use IRQ5 or IRQ7 if an LPT: port is not used. Like the COM: Ports, the LPT: Ports under DOS are not Interrupt Driven. If an interrupt is used, it is up to the application to program the system accordingly. IRQ2 is also available on an 'XT' machine, but on an 'AT' machine IRQ2 is actually IRQ9 and must be programmed accordingly. - Adding more COM: Ports and COM: Port Programming Due to the nature of the operating environment of DOS, only one application is running at a time. Although this does have its drawbacks, it does allow more flexibility in system configurations. If an application wishes to use more than four COM: ports, the only thing developers need to do is define the desired serial port addresses and interrupts then program the ports by directly accessing the hardware. This is often the case when intelligent or non-intelligent multi-port communications cards are used, however the same approach will work if you have COM: cards that can be addressed to unique I/O address and interrupts. When an application programs the COM: ports, multiple ports may share the same interrupt if proper programming is utilized. --------------------------------------------------- For technical support, refer to your user manual or the label on your software utility disk for the appropriate correspondence.