APPENDIX F
OS/2
CONFIGURATION
Under OS/2 2.x and OS/2 Warp
operating system, the PCCOM device driver provides total 96 ports and
baud rate up to 115200. PCCOM also supports device driver for high
speed card, and the baud rate can be up to 460800. The device driver
works for 8250, 16450, 16550 (FIFO), 16650 etc.
F.1 Installation
The installation procedures are shown in the following.
1.
|
Add command into
CONFIG.SYS file then reboot. |
DEVICE=C:\PCCOM4.SYS/D/Axxx
/Iyy/Czz /4
if "/C" is not use, the first
port is COM3.
if option /C1 or /C2 is use, the port COM1 or COM2
is a logical port but not compatible to COM1 or COM2 on a PC machine.
2.
|
To
set up communication parameters, please use
the MODE.COM command from OS/2, or use PCCOM.EXE command. We highly
recommend to use PCCOM.EXE command, because MODE.COM can be used only
for COM1 to COM9 and for maximum baud rate to 57600. |
The
PCCOM.EXE can be used to set COM1 to COM96. The syntax of PCCOM.EXE
is the same as MODE.COM.
|
For example : |
1. Set two
cards from COM3 to COM6 and COM7 to COM10.
DEVICE=C:\PCCOM4.SYS /A2A0 /I5 /C3
DEVICE=C:\PCCOM4.SYS /A1A0
/I7 /C7
2. Set up
communication parameters.
C:\PCCOM
COMx:38400,N,8,1,TO=OFF,XON=OFF,
IDSR=ON, ODSR=ON, OCTS=ON,
RTS=OFF,DTR=OFF
C:\PCCOM COMx:115200,N,1
F.2 Utilities
COMTEST.EXE is a general
testing program for COM port. It will create
the threads associated with each communication port that will be test.
The testing function includes OPEN/CLOSE/READ/WRITE/Non-Destructive
Read/Non-Destructive WRITE/Get Status/Device IOCTL. Due to lack of OS/2
API, Non-Destructive I/O is not support for OS/2 even this device
driver has implemented this feature.
In the COMTEST program, you can
use up-right arrow to choice the
option, and use enter/escape to start/stop the program.
The ComSent/ComRecv are a pair
of communication programs for testing
the performance of communication port. You have to connect the test
ports with a null modem before you test communication port. You can use
PCCOM.EXE to change the parameters of communication port. Then use this
program to test heavy (transmission) duty on communication port.
F.3 API
Communication Functions
In the following, there are API
communication functions, for more
detail information, please refer to Control Program Programming Ref. of
OS/2, and programming Guide Vol. I-III of OS/2.
|
DosClose - Close a Handle to a File,
Pipe, or
Devices |
|
#define INCL_DOSFILEMGR
APIRET
DosClose(HFILE FileHandle); |
|
DosDevConfig - Get Information about
Attached
Devices |
|
#define
INCL_DOSPROCESS APIRET
DosDevConfig(PVOID pDeviceInfo, ULONG ulDeviceType); |
|
DosDevIOCtl - Perform Control
Function on a Device
Specified by an Opened Device Handle |
|
#define
INCL_DOSPROCESS APIRET
DosDevIOCtl(HFILE DevHandle, ULONG ulCategory, ULONG ulFunction, PVOID
pParmList, ULONG ulParmLengthMax, PULONG pParmLengthInOut, PVOID
pDataArea, ULONG ulDataLengthMax, PULONG pDataLengthInOut); |
|
DosOpen - Open a File |
|
#define
INCL_DOSFILEMGR APIRET DosOpen(PSZ
pszFileName, PHFILE ppFileHandle, PULONG pActionTaken, ULONG
ulFileSize, ULONG ulFileAttribute,ULONG ulOpenFlag, ULONG
ulOpenMode, PEAOP2 ppEABuf); |
|
DosRead - Read from a File, Pipe, or
Device to a
Buffer |
|
#define
INCL_DOSFILEMGR APIRET
DosRead(HFILE FileHandle, PVOID pBufferAre, ULONG ulBufferLength,
PULONG pByteRead); |
|
DosWrite - Write to a File from a
Buffer |
|
#define
INCL_DOSFILEMGR APIRET
DosWrite(HFILE FileHandle, PVOID pBufferArea, ULONG ulBufferLength,
PULONG pByteWritte); |
|