USERS MANUAL SIO.SYS and VSIO.SYS, Serial Communications Device Driver for OS/2 V2 (and up) and its Virtual DOS Machines (VDM). Copyright (c) 1993 by Raymond L. Gwinn 12469 Cavalier Drive Woodbridge, Virginia 22192 All Rights Reserved February 27, 1993 FidoNet address 1:265/104 CompuServe 72570,157 Internet 72570.157@compuserve.com Data 703-494-0098 (08:00am to 11:00am GMT) (03:00am to 06:00am EST) i INTRODUCTION SIO.SYS and VSIO.SYS are companion device drivers for Version 2 (and up) of the OS/2 operating system. Both drivers (SIO/VSIO) have been coded with performance in mind, possibly sacrificing some compatibility. For this reason, SIO and VSIO are not exact replacements for the OS/2 drivers COM and VCOM. However, all serial communications programs tested by the author work correctly using SIO/VSIO. This manual is intended for the SIO user. A separate Application Programmers manual is being written. This manual and the software distributed with it is provided with no guarantees. Use it at your own risk. ii TABLE OF CONTENTS WHAT IS SIO . . . . . . . . . . . . . . . . . . . . . . . . . 1 WHAT IS VSIO . . . . . . . . . . . . . . . . . . . . . . . . 2 GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . 3 Installing SIO/VSIO . . . . . . . . . . . . . . . . . . . . . 3 Quick Start . . . . . . . . . . . . . . . . . . . . . . 3 COMMAND LINE OPTIONS . . . . . . . . . . . . . . . . . . . . 4 AUTOMATIC IRQ ASSIGNMENT . . . . . . . . . . . . . . . . . . 5 DOS SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . 6 PROBLEMS AND SOLUTIONS . . . . . . . . . . . . . . . . . . . 7 IRQ SHARING ON ISA . . . . . . . . . . . . . . . . . . . . . 8 Appendix A, Hardware Port and IRQ Assignments . . . . . . . . 9 Addresses and IRQs for COM1 and COM2 . . . . . . . . . . 9 Defacto standard for COM3 and COM4 . . . . . . . . . . . 9 Addresses and IRQ for COM3 through COM8 on the PS/2 . . 9 Appendix B, SIO Chips . . . . . . . . . . . . . . . . . . . 10 8250 . . . . . . . . . . . . . . . . . . . . . . . . . 10 8250A . . . . . . . . . . . . . . . . . . . . . . . . 10 16450 . . . . . . . . . . . . . . . . . . . . . . . . 10 16C451 . . . . . . . . . . . . . . . . . . . . . . . . 11 16550 (Non A . . . . . . . . . . . . . . . . . . . . . 11 16550A . . . . . . . . . . . . . . . . . . . . . . . . 11 16550AF . . . . . . . . . . . . . . . . . . . . . . . 11 16550AFN . . . . . . . . . . . . . . . . . . . . . . . 11 16550s Made by Western Digital . . . . . . . . . . . . 12 16C551 . . . . . . . . . . . . . . . . . . . . . . . . 12 16C552 . . . . . . . . . . . . . . . . . . . . . . . . 12 82510 . . . . . . . . . . . . . . . . . . . . . . . . 12 Appendix C, Multi-Port Serial I/0 Cards . . . . . . . . . . 13 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1 WHAT IS SIO SIO is a Serial Input/Output (SIO) communications driver. It provides an interface between application programs and the serial communications hardware. SIO had been designed as a high performance replacement for the OS/2 device driver COM.SYS. SIO.SYS does not support some features that are provided by COM.SYS. In the view of the author, these features are rarely used and they inhibit good performance on the vast majority of systems. See the programmers reference manual for information about the known differences between COM.SYS and SIO.SYS. SIO only works with 8250 (TYPE) serial I/O devices. Such devices include the 8250A, 16450, 16550, 16550A and the 82510. If you have a PC that is an IBM or near compatible which has a serial communication port, it is likely that it contains one of these devices. SIO will identify the type of serial devices that it finds at load time. Like other Device Drivers, SIO will do very little standing alone. There must be an application(s) program to use SIO before you will gain benefit. 2 WHAT IS VSIO VSIO is a Virtual Device Driver (VDD). Virtual device drivers provide services for DOS programs executing under OS/2. Most Virtual Device Drivers emulate a specific hardware device and/or BIOS service. The primary job of a Virtual Device Driver is to convert misbehaved DOS input/output into well behaved input/output. Using the protection mechanism of the 386 (and up) processor, a Virtual Device Driver can instruct OS/2 to trap all input/output for given hardware ports. Once trapped, the Virtual Device Driver (VDD) appropriately routes information to/from the Physical Device Driver (PDD) and to/from the DOS program. VSIO creates a virtual (imaginary) 16550A or 16450 (UART) in software. VSIO does not emulate any BIOS services. All of the hardware registers of the virtual UART are simulated by VSIO. VSIO does not attempt to simulate the timing of the real UARTs. DOS programs that depend on the timing of real hardware UARTs may have problems executing under VSIO. All DOS programs that execute under VSIO should have RTS/CTS handshaking enabled regardless of the baud rate. Note that this enabling of RTS/CTS handshaking is independent of the RTS/CTS handshaking used by SIO. The virtualization (simulation) provided by VSIO is not (and can not be) exact. However, most well written DOS programs should not have problems. VSIO will only work with SIO installed and the versions of SIO/VSIO must match. If VSIO refuses to install, you most likely have a version mismatch. VSIO will not work with any other device driver like COM.SYS. 3 GETTING STARTED Installing SIO/VSIO SIO is distributed as a ZIP file. To extract the individual files from the distribution file you need the program PKUNZIP or an equivalent. PKUNZIP is a product of PKWARE and can be downloaded from almost any bulletin board system (BBS). You probably already have PKUNZIP and know how to use it, otherwise I doubt that you would be reading this. When PKUNZIP is used to extract the various files, -AV should appear after each file name as it is extracted. In addition, the message: Authentic files Verified! should appear after the extraction process. If this message does not appear, or appears with a name other than Raymond L. Gwinn, the file is not an original SIO distribution file. The only file that the basic user actually needs is SIO.SYS. Virtual DOS machine (VDM) users will also want VSIO.SYS. Copy one or both of these files to a convenient directory or subdirectory on your system. Quick Start Copy SIO.SYS and VSIO.SYS to the root directory of your boot drive or diskette. If you are going to use standard communications ports, either COM1 or COM2 on an ISA buss (AT or clone), or COM1 through COM4 on a PS/2, then add the following line to your CONFIG.SYS file: DEVICE=SIO.SYS DEVICE=VSIO.SYS Be sure to REMark out the COM.SYS and VCOM.SYS device drivers if they exist in your CONFIG.SYS. With the above statements you will be able to use standard COM1 and/or COM2 (if they exist) on any PC system know to the author. If your setup is more complex, you must read on. 4 COMMAND LINE OPTIONS The command line options are included in the command line that loads SIO in the CONFIG.SYS file. VSIO has no command line options. Command line options are usually grouped by port within parenthesis. If you use only COM1 and/or COM2, at the standard IRQ and port addresses, you will not need any command line options. However, up to four serial communications ports, COM1 thru COM4, can be specified at any base port address and any IRQ. On PS/2 systems and some ISA cards, SIO/VSIO supports multiple communications devices sharing the same IRQ. The basic command line syntax is as follows: DEVICE=SIO.SYS (Cn, An, In, Ig, Fc) [(Cn, An, In, Ig, Fc)] Where "Cn" is the comm port number (1 thru 4) or the string COM1 thru COM1. "An" is a hexadecimal number that defines the base hardware I/O port address for the communications port. "In" is an IRQ number (0 thru 15) or the string IRQ0 thru IRQ15. Is is best if one allows SIO to determine the IRQ, see AUTOMATIC IRQ ASSIGNMENT below. "Ig" is an ignored parameter. If exists for compatibility with COM.SYS. "Fc" is the Forced 16550A chip parameter. If an F is placed in this position, a 16550A UART chip type is forced regardless of the automatically detected chip type. For a PC with COM1 and COM2 of standard configuration, the following command line will load SIO correctly: DEVICE=SIO.SYS (1, 3F8, 4) (2, 2f8, 3) A more readable, but identical, command line is: DEVICE=SIO.SYS (COM1,3F8,IRQ4) (COM2,2F8,IRQ3) Forcing a 16550A on COM1 would be as follows: DEVICE=SIO.SYS (COM1,3F8,IRQ4,,F) (COM2,2F8,IRQ3) In a similar manner, up to four serial communications ports can be defined and supported by SIO and VSIO. 5 AUTOMATIC IRQ ASSIGNMENT SIO will automatically locate the IRQ that a comm port is attached to. The IRQ used by SIO for a given comm port is assigned in the following manner: 1 - If an IRQ is specified in the SIO command line then that IRQ is used. However, SIO will display a warning message if the IRQ seems to be other than specified. 2 - If no IRQ is specified in the command line, and if SIO detected the IRQ then the detected IRQ is used. 3 - If no IRQ is specified in the command, and if SIO could NOT detect an IRQ then the default IRQ for the comm port is used. SIO will also display a warning message in this case. The following STYLE command line is recommended for all but the most unusual systems. That is, specify only the port number for those above COM2 (to tell SIO to support those ports) and let SIO do the rest. DEVICE=SIO.SYS (COM3) (COM4) If you do not have a COM3 or COM4, or if the mouse is using the only comm port above COM2 then the following command line should be used. DEVICE=SIO.SYS 6 DOS SETTINGS VSIO gets its operational characteristics from DOS Settings. Three basic DOS Settings are provided. They specify the type of access (if any) that a DOS program is to have to a communication port that SIO controls. All of the DOS Settings default to what most users should use most of the time (which is ON). Also, all of the DOS Settings are prefixed with SIO_. The provided DOS Settings and their meaning follow: "SIO_Allow_Access_COMn" (where n is 1 thru 4). This DOS setting defaults to ON. If this setting is turned OFF for any or all of the ports, the DOS program will not be allowed any access to that port(s). "SIO_Virtualize_COM_Ports" This Dos setting defaults to ON and it applies to all communications ports used by the DOS session. When ON, this DOS setting means VSIO is to act as an interface between the SIO and the DOS program. When OFF, the DOS program is given direct access to the hardware ports of the UART(s). "SIO_Virtualize_16550A" This DOS setting defaults to ON and it applies to all communications ports used by the DOS session. When ON, VSIO will simulate a 16550A. When OFF, VSIO will simulate a 16450. Some DOS programs may not work when a 16550A is simulated. Turning this setting off may allow the program to work (but slower). 7 PROBLEMS AND SOLUTIONS 1 - SIO displays a warning message that the IRQ for a port appears to be wrong, but the port works. SIO probably detected more than one IRQ attached to the comm port. This indicates a hardware problem with your system. 2 - The modem will not initialize. Configure your comm program(s) to insert a delay between modem initialization characters as they are sent to the modem. 3 - Some DOS programs work and some do not work. Try putting the following in your CONFIG.SYS: DEVICE=x:\OS2\MDOS\COMDD.SYS 8 IRQ SHARING ON ISA Sharing the same IRQ for multiple communications ports on ISA systems is not for the weak of heart (or mind). If you have problems with shared IRQs, DO NOT contact the author. Contact the board or computer manufacturer for help. Some general rules are as follows: 1 - Two different boards (plugged into different slots) can not share the same IRQ. This is a hardware limitation of ISA systems and can not be corrected by software. This means that you can not plug in two internal modems, set them for the same IRQ and expect them to work. This does not apply to PS/2 systems. The problem of multiple boards sharing the same IRQ was corrected in the PS/2's buss design. 2 - SIO can not (will not) share an IRQ with other device drivers at the same time. SIO releases IRQs that it is currently not using. This is different form how COM.SYS works. This difference may show up as an unexpected "port already in use" error that does not occur with COM.SYS. I have received reports that the SDLC drivers try to concurrently share IRQs with the ASYNC driver. SIO.SYS will not allow this while COM.SYS will. 9 Appendix A, Hardware Port and IRQ Assignments I have obtained the following information from various sources. Accuracy is not guaranteed. In fact, nothing in this document is guaranteed. Addresses and IRQs for COM1 and COM2 COM1 uses 03F8h and IRQ4 COM2 uses 02F8h and IRQ3 Defacto standard for COM3 and COM4 for PC, XT and AT COM3 uses 03E8h and IRQ4 COM4 uses 02E8h and IRQ3 Addresses and IRQ for COM3 through COM8 on the PS/2 COM3 uses 3220h and IRQ3 COM4 uses 3228h and IRQ3 COM5 uses 4220h and IRQ3 COM6 uses 4228h and IRQ3 COM7 uses 5220h and IRQ3 COM8 uses 5228h and IRQ3 All PCs (know to the author) prior to the PS/2 only used 12 bits to address hardware I/0 ports. Systems prior to the PS/2 and EISA can not address the standard PS/2 addresses for COM3 through COM8. If an AT or below attempts to address COM3 through COM8 using the standard addresses, only the low 12 bits of the address are used. That is, the high digit of the hexadecimal address will be ignored. This means that any reference to COM3 through COM8 will actually address ports 220h through 22Fh. You should avoid expansion boards that use ports 220h through 22Fh unless the expansion board is a serial I/O board. SIO will (attempt to) determine the hardware architecture (ISA/EISA and PS/2) that it is being executed on and use the appropriate hardware port addresses for COM1 thru COM4 as defaults. 10 Appendix B, SIO Chips The following is a collection of comments developed from hearsay, random documents, experience, and technical specifications. So, take it with a grain of salt. Order information from the various manufactures if you want accurate information. Very good reference book are available from National Semiconductor Corporation. The covers most of the SIO devices (also called UARTs) that you will find in many PCs and clones. I am not sure that books can be ordered directly from National semiconductor. They may require that you get it from a distributor. In any case, the address on the back of the one manual is: National Semiconductor Corporation 2900 Semiconductor Drive P.O. Box 58090 Santa Clara, CA 95052-8090 Tel:(408)721-5000 TWX:(910)339-9240 8250 As best that I know, the 8250 was the first SIO chip (integrated circuit) that was used by the IBM PC and many clones. In my opinion, it was a poor choice on the part of IBM. I feel many superior devices, at comparable prices, were readily available. At that time, I feel the 8251A or the 8530 would have been better choices. But, they used the 8250 and therefore we must use it. From a hardware standpoint the 8250 is a relatively slow device. It is advisable that programmers not perform successive inputs or outputs to this device. It seems that software programs can load the various registers of the 8250 faster than it can process the information. The 8250 had a total of 7 registers. The specifications state that 56kb is the maximum baud rate. 8250A I believe the 8250A is the 8250 with some bug fixes. I have no idea what the bugs may have been. A quick glance at the specifications shows the speed of the 8250 and 8250A to be much the same. The 8250A added an 8th register. This additional register enables software to detect if an 8250 is installed. The specifications state that 56kb is the maximum baud rate. 16450 The 16450 seems to be a speeded up version of the 8250A. There 11 is no direct way (that I know of) for software to detect the difference between an 8250A and a 16450. I believe the 16450 was developed to eliminate the need for software to insert delays between successive accesses to the device. The specifications indicate the 16450 is a much faster device than its predecessors. The additional speed is only the speed at which the processor can access the device. The maximum baud rate for the 16450 is still stated at 56kb. However, I have been told by some people that they have run the 16450 successfully at much higher speeds. I do not believe there was ever a 16450A. 16C451 The 16C451 is a CMOS version of the 16450. CMOS is a term for the material and manufacturing process used to make the part. CMOS typically uses less power than other technologies. If you are not designing hardware, you should view the 16C451 as a 16450. 16550 (Non A) It is hard to find a 16550 (Non A). I was told by National Semiconductor that they did everything they could to get all 16550s back. SIO will detect a 16550 and tell you if you have one. I am told that the 16550 was installed in early PS/2 systems. The 16550 was the first shot at a FIFOed version of the 8250 family from National semiconductor. However, I was told by National Semiconductor that the FIFOs of the 16550 are not reliable and they should not be enabled. SIO will treat a 16550 like a 16450. In this mode, they are reliable. National Semiconductor would not provide me with a specification for the 16550. However, I suspect its maximum baud rate is the same as the 16550A which is 256kb. 16550A, 16550AF and 16550AFN In the manuals that I have, National Semiconductor does not explain the differences between the 16550A and the 16550AF. I suspect the AF part may have a few bug fixes. I believe the N in AFN describes packaging, ceramic versus plastic, DIP versus surface mount etc. In the opinion of the author, there is no substitute for the 16550A (and its successors) in the 8250 type series. The 16550A is compatible with most software written for the entire family of 8250 type devices. Programs that are 16550A aware can provide much improved performance over previous devices. The maximum baud rate for the 16550A is specified at 256kb. 12 However, due to the hardware design of the PC et al, 115kb is the maximum baud rate that can be programmed by software. The 16550A can be plugged into the same socket that contains an 8250, 8250A or 16450. If your SIO expansion board has the SIO chips in sockets, you can upgrade to the 16550A by simply removing the old chips and replacing them with 16550As. The key to the performance increase of the 16550A is its FIFOs. It has 16 byte FIFOs for both transmit and receive data. 16550s Made by Western Digital I have been told, but I have not verified for myself, that 16550s made by Western Digital have a problem with their FIFOs when working at 2400 baud or below. 16C551 The 16C551 is a CMOS version of the 16550AF. See the above description of the 16C451 for a discussion of CMOS. Do not feel you need to upgrade from a 16550A or AF to a 16C551. There is no gain from an existing users point of view. 16C552 The 16C552 is two 16C551s on a single chip. These devices will start showing up on multi-port serial I/O cards. 82510 I believe Intel is the only company that manufactures the 82510. The 82510 is feature rich with several modes of operation. Its default mode is to operate as a 16450. The 82510 has a 4 byte FIFO for both transmit and receive data. A 4 byte FIFO is sufficient to provide significant performance over a basic 16450. The 82510 is small in size. Therefore, it is found in many lap tops. The 82510 is somewhat of a sleeper. I believe it would be much more widely used if Intel had promoted it more. However, given a choice between the 82510 and the 16550A, I would select the 16550A. 13 Appendix C, Multi-Port Serial I/0 Cards I have received many requests for information about multi-port serial I/O card. I will describe the boards that I know about (or have heard about) here. I will add to the list as I receive precise information from users or develop it myself. My personal experience and testing of SIO is with a board from B&B computer. However, I had to modify the board to make it share IRQs. Therefore I will not discuss this board. 14 INDEX 16450 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 16550 Non A . . . . . . . . . . . . . . . . . . . . . . . . . 11 16550A . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 16550AF . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 16550AFN . . . . . . . . . . . . . . . . . . . . . . . . . . 11 16550s Made by Western Digital . . . . . . . . . . . . . . . 12 16C451 . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 16C551 . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 16C552 . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 8250 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 8250A . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 82510 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Addresses and IRQ for COM3 through COM8 on the PS/2 . . . . . . 9 Addresses and IRQs for COM1 and COM2 . . . . . . . . . . . . . 9 Allow_Access_COMn . . . . . . . . . . . . . . . . . . . . . . . 6 Appendix A, Hardware Notes . . . . . . . . . . . . . . . . . . 9 Appendix B, SIO Chips . . . . . . . . . . . . . . . . . . . . 10 Appendix C, Multi-Port Serial I/0 Cards . . . . . . . . . . . 13 AUTOMATIC IRQ ASSIGNMENT . . . . . . . . . . . . . . . . . . . 5 COMn already in use . . . . . . . . . . . . . . . . . . . . . . 7 CONFIG.SYS . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Defacto standard for COM3 and COM4 . . . . . . . . . . . . . . 9 DOS SETTINGS . . . . . . . . . . . . . . . . . . . . . . . . . 6 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . 11, 12 GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . . 3 Installing SIO/VSIO . . . . . . . . . . . . . . . . . . . . . . 3 IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 5 IRQ SHARING ON ISA . . . . . . . . . . . . . . . . . . . . . . 8 National Semiconductor Corporation . . . . . . . . . . . . . 10 PDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Physical Device Driver . . . . . . . . . . . . . . . . . . . . 2 PKUNZIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Authentic files . . . . . . . . . . . . . . . . . . . . . 3 PROBLEMS AND SOLUTIONS . . . . . . . . . . . . . . . . . . . . 7 Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . 3 RTS/CTS handshaking . . . . . . . . . . . . . . . . . . . . . . 2 SIO Chips . . . . . . . . . . . . . . . . . . . . . . . . . . 10 UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 VDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Virtual Device Driver . . . . . . . . . . . . . . . . . . . . . 2 Virtualize_16550A_For_COM . . . . . . . . . . . . . . . . . . . 6 Virtualize_COM_Ports . . . . . . . . . . . . . . . . . . . . . 6 WHAT IS SIO . . . . . . . . . . . . . . . . . . . . . . . . . . 1 WHAT IS VSIO . . . . . . . . . . . . . . . . . . . . . . . . . 2