home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / sliphw.zip / comsetup.txt < prev    next >
Text File  |  1995-10-02  |  7KB  |  165 lines

  1. COMSETUP.TXT
  2.  
  3. Notes on Configuring COM ports for OS/2 Warp
  4. --------------------------------------
  5.  
  6. Some people have reported problems setting up COM ports, so here is some
  7. general advice and ideas on how to detect problems.
  8.  
  9. RMVIEW.EXE
  10. ----------
  11.  
  12. RMVIEW should be in the \OS2 directory. It is an excellent debugging tool that
  13. will tell you a great deal of information about your OS/2 system. Run rmview
  14. from an OS/2 command prompt. Type "rmview /?" to get a list of options. Some
  15. useful commands are:
  16.  
  17. rmview /hw         displays a list of all the hardware.
  18.              It should list "SERIAL_0 Serial port controller"
  19.  
  20. rmview /irq         displays all IRQ's.
  21.              It should list IRQs 4 and 3 as belonging to COM1 and COM2
  22.  
  23. System Information Tool
  24. -----------------------
  25.  
  26. This is a very powerful graphical system analyzer that comes with the OS/2
  27. Bonus Pack. If you have installed it, it should be in the System Setup Folder.
  28. The file is called SYSIGUI.EXE and it is usually located in \OS2\APPS.
  29.  
  30. If you don't have it, look on the Bonus Pack CD-ROM in the directory
  31. \US\SYSINFO. Run SYSI.CMD in that directory to install it.
  32.  
  33. When you get it installed, just double click the icon. After it gathers data
  34. it will display an icon "Parallel and Serial Port Information". Double click
  35. that to learn about your serial ports.
  36.  
  37. Your Serial Card
  38. -------------
  39.  
  40. PC serial ports use a chip called a "Universal Asycronous Receiver
  41. Transmitter" or UART. This is the chip that transfers all the data between the
  42. modem cable and your PC.
  43.  
  44. The original PC used a UART chip called the "8250". This chip does not have a
  45. buffer. When the chip receives a byte from your modem, the PC must get the
  46. byte from the chip before the next byte arrives from the modem. If the PC
  47. isn't fast enough, the next byte arrives and overwrites the previous byte, which is lost. The important questions are
  48.  
  49. (1) how often does your PC have to get a byte from the UART?
  50. (2) can your PC get them this fast?
  51.  
  52. Recent v34 modems send data at 28,800 bits per seconds. However, this data may
  53. have been compressed 4:1 by the LAP compression that is part of the standard.
  54. When your modem gets data at 28800 bps and decompresses it, the resulting data
  55. stream from the modem to your serial port transfers 115200 bits per second.
  56. Your PC has to get bytes from the UART at this rate to keep up.
  57.  
  58. A byte is normally 8 bits. But when a byte is received there is also a stop
  59. bit, making 9 bits of data received per byte. Divide 115200 by 9 to get 12800.
  60. That's how many times each second your PC must stop what it is doing and get a
  61. byte from an 8250 UART to avoid losing data.
  62.  
  63. When your PC interupts what it is doing and gets a byte, it is called a
  64. HARDWARE INTERRUPT. PC's are not capable of executing more than a few 1000 per
  65. second.
  66.  
  67. The solution is to get a UART with a buffer. The 16550 UART was introduced
  68. several years ago. It has a 16 byte buffer. Hence, the required number of
  69. interrupts to operate at 115200 bps is 12800/16 or 800 interrupts per second.
  70.  
  71. Unfortunately, the new PC's you buy today often have the old 8250 UART's. I am
  72. amazed that people buy these machines when a 16550 UART would only have cost a
  73. few cents more. I STRONGLY RECOMMEND that you spend $30 and buy a new serial
  74. card with a 16550 UART.
  75.  
  76. OS/2 COM Drivers and Ray Gwinn's SIO drivers
  77. ----------------------------------------
  78.  
  79. Your config.sys has the following lines:
  80.  
  81. DEVICE=H:\OS2\BOOT\COM.SYS
  82. DEVICE=H:\OS2\MDOS\VCOM.SYS
  83.  
  84. COM.SYS is IBM's serial port driver. VCOM.SYS is a driver for virtual DOS
  85. machines (DOS and Windows). VCOM.SYS makes DOS programs think there is a
  86. serial port. However, all the data they transfer to VCOM.SYS is transferred to
  87. to COM.SYS, which controls the real serial port.
  88.  
  89. IBM's COM drivers were written for compatility and not speed. Ray Gwinn wrote
  90. much better  designed drivers, which can run much faster. Some DOS and Windows
  91. programs may have trouble with the SIO drivers because they are not as
  92. compatible as COM.SYS. You can find the file SIOxxx.ZIP on various BBS's and
  93. Internet sites. The latest version is SIO152.ZIP. After you install it, your
  94. config.sys will look something like this:
  95.  
  96. REM DEVICE=H:\OS2\BOOT\COM.SYS
  97. REM DEVICE=H:\OS2\MDOS\VCOM.SYS
  98. DEVICE=H:\SIO\SIO.SYS
  99. DEVICE=H:\SIO\VSIO.SYS
  100.  
  101. Notice that I can switch back to COM.SYS by removing the REM in front of these
  102. drivers and putting a REM in front of the SIO drivers.
  103.  
  104. The SIO drivers run at much higher priority than normal software. Even with an
  105. 8250 UART they can do interrupts much faster than normal software and make the
  106. 8250 UART operate under conditions where it wouldn't normally function.
  107.  
  108. Example
  109. ------
  110.  
  111. I recently set up an office PC as a SLIP server and to which I connect from
  112. home. I forgot the old PC had an 8250 UART and tried to communicate at 57600
  113. bps. I got a lot of data errors transferring large ZIP and GIF files.
  114.  
  115. When I switched this PC to the SIO drivers all data errors disappeared. Here
  116. is the technical explanation.
  117.  
  118. At 57600 bps, an 8250 UART would require 6400 interrupts per second. This is
  119. too many for even OS/2 software, but not to many for a device driver like SIO.
  120. SIO gets the bytes from the 8250 UART at this rate and stores them. Then it
  121. pretends to be a 16550 UART from the point of view of DOS and OS/2 software.
  122. The actual OS/2 program that is running (SLIP.EXE in my example) can get 16
  123. bytes at a time. Hence, SLIP.EXE only needs to process interrupts at the rate
  124. of 400 per second.
  125.  
  126. Before I installed SIO, SLIP.EXE had to talk to COM.SYS which is designed for
  127. compatibility with DOS and Windows programs. It is too poorly designed to
  128. function at 57600 bps.
  129.  
  130. If you use SIO and you have a 16550 UART, your PC can communicate at 115200 in
  131. the background easily without a noticable slowdown of your other software.
  132.  
  133. Checking out Hardware
  134. ------------------
  135.  
  136. My favorite hardware checkout program is NDIAGS.EXE, which is part of the
  137. Norton Untilities. DOS programs can get access to the hardware in ways that
  138. OS/2 programs cannot. Norton comes with loopback plugs for the serial and
  139. parallel ports. Use these and run NDIAGS to make sure your hardware can handle
  140. various speeds without errors.
  141.  
  142. If you encounter a hardware problem, just buy a multiI/O cards with 16550
  143. UARTS and check it out. Take it back right away if it doesn't perform.
  144.  
  145. Serial Cables
  146. ----------
  147.  
  148. There are a lot of old cables around which do not have all the wires
  149. connected. To use high speeds, you need to use "hardware flow control". Buy a
  150. good quality cable with all of the 9 wires that are used with a 9 pin
  151. connector. The cable with 24 pins don't need more than these 9 wires.
  152.  
  153. My Setup
  154. -------
  155.  
  156. I have 16550 UARTS and use COM2. When I boot OS/2 my com ports are initialized
  157. and locked at 115200 bps. Here is how I do it.
  158.  
  159. I created a program object by dragging a program template to the StartUp
  160. folder. The program reference object runs MODE115.CMD, which is in the \CMD
  161. directory (on my path) where I keep OS/2 CMD files. MODE115.CMD has these two lines:
  162.  
  163. @mode com2 115200,n,8,1,DTR=ON
  164. @su 2 lock 115200
  165.