Patching OS2 2.0 COM.SYS for baud rates up to 57600

By Jack Grey ( Cserve 76040,342 ) - 1992-05-15

The OS2 2.0 serial port driver COM.SYS ( located in the \OS2 directory ) has a upper speed limitation of 19200 baud. The driver may be patched with DOS( or \OS2\MDOS ) DEBUG to accept baud rates as high as 65535.

In essence, one loads the driver into DEBUG and searches for the the sequence of bytes 3D 00 4B. This is a CMP AX,19200 instruction. ( compare register AX with decimal 19200 ). One simply the replaces instruction with CMP AX,65535.

It is recommended that you make a back up copy your COM.SYS file and patch a second copy to avoid problems in the event of improper entries.

Of course, the assumption that your UART and serial device ( e.g., modem ) can handle baud rates above 19200 is implicit. Using the 16550AFN UART which has a 16-byte internal data queue is recommended to circumvent the OS2 2.0 limit of around 1000 interrupts per second. However, if your application ( e.g., file transfer by Zmodem ) is fault-tolerant, you may still use baud rates higher than 19200 with errors occuring but still gain overall increased throughput. You may want to experiment with various baud rates for best results.

The following capture illustrates the procedure using the COM.SYS file from the GA release. The actual addresses you see will depend on your system configuration. After applying the patch, replace the file in \OS2 with the patched file, shutdown, and reboot in order for the change to become effective.

This patch has also been tested with the OS2 1.3 driver COM02.SYS. The procedure is identical.

This modification should be undertaken entirely at your own risk and is not known to be sanctioned by IBM. However, it works for me and I thought I would share the information.

 E:\>debug com.sys -r 			 ( dump the registers in order to see the file length in BX:CX ) AX=0000 BX=0000  CX=60B8  DX=0000  SP=FFEE  BP=0000  SI=0000  DI=0000 DS=0D14 ES=0D14  SS=0D14  CS=0D14  IP=0100   NV UP EI PL NZ NA PO NC 0D14:0100 4D            DEC     BP -s 100 61b8 3d 00 4b     ( search from the start to the end for the byte sequence ) 0D14:4ECF 		 <== this is the address of the instruction -u 0d14:4ecf 4ed2 	 ( disassemble to confirm ) 0D14:4ECF 3D004B       CMP     AX,4B00 0D14:4ED2 0F           DB      0F -e 0d14:4ed0		 ( enter new values; 0D14:4ED0 00.ff   4B.ff   the space bar steps from one byte to the next ) -u 0d14:4ecf 4ed2	 ( disassemble to confirm ) 0D14:4ECF 3DFFFF       CMP     AX,FFFF 0D14:4ED2 0F           DB      0F -w			 ( write out the changed file ) Writing 60B8 bytes -q 