QNX_com.txt Serial Utility Diskette 1997 ****************************************************************** Technical Note: February, 1997 Subject: QNX 4.23 Serial Communications This document details the installation of serial ports under QNX. Installation notes are included for non-intelligent serial interfaces. This file also provides suggestions for testing the serial ports. WARNING: Follow the procedure for adding ports very carefully, since it is necessary to change the "sysinit" files. Back up all files before making changes. Make sure that you have a working alternate boot configuration (boot image and "altsysinit" file) for recovery should mistakes occur. NOTE: The "QNX Operating System Installation & Configuration" book details serial port installation. For further reference, refer to Chapter 4, "Connecting Serial & Parallel Devices". Quick Start Details: 1. Open the file "/etc/config/sysinit.node" using a text editor (where node is a number representing the network address of the PC). 2. Modify the "Dev.ser &" line to match your serial port settings. To enter parameters for a port, type the port address, followed by a comma, followed by the port IRQ. For multiple ports, seperate each set of port parameters by a space. Use the following example for a standard two port setup: Dev.ser 3f8,4 2f8,3 & Each successive pair of settings defines a new serial port. The serial ports will show up in the "/dev" directory, starting at "/dev/ser1", and ending at "/dev/sern" (where n is the number of serial ports defined on the Dev.ser line). 3. Other options can be set on the Dev.ser line, including baud rate, parity, and stop bits. The "-b" switch defines the baud rate for all ports defined after the switch. Use the following example to configure two standard serial ports at 9600 baud, and a third port at address 0x1500 and IRQ 0x10 working at 19200 baud: Dev.ser -b 9600 3f8,4 2f8,3 -b 19200 1500,10 & For a list of other Dev.ser parameters, see the "QNX Operating System Utilites" reference. 4. Reboot the machine. 5. The serial ports should appear in the "/dev" directory. Interrupt Sharing: Excerpt from "QNX Operating System Installation & Configuration": QNX allows for many serial ports to share the same interrupt, since Dev.ser will check every UART that shares an interrupt (page 54). Testing Installed Serial Ports: Several tests can be performed to verify that the serial port is functioning poperly. Use one or more of the following test options: 1. Transferring files from one serial port to another using a NULL modem cable: This can be done using two computers or using one computer and two serial ports. 1. Attach a null modem cable between the two serial ports. 2. Set up a redirection from the receiving serial port to a desired file. For example: cat /dev/ser3 > /tmp/serial3_in & would transfer data received on serial port 3 to the file "/tmp/serial3_in". 3. Set up a redirection from a desired test file to the transmitting serial port. For example: cat /etc/config/sysinit > /dev/ser2 & would transfer the file "/etc/config/sysinit" to serial port 2. In keeping with our previous example, if we had a null modem set up accross serial ports 2 and 3, the file "/etc/config/sysinit" would be transfered accross the null modem link to the file "/tmp/serial3_in". End the redirection from the receiving port using the kill command. Compare the transmitted file to the recieved file (using "cmp"). In our example, we would compare "/etc/config/sysinit" to "/tmp/serial3_in". 2. Using a NULL Modem and qtalk to open terminal sessions: This can be performed using two seperate computers, or on one machine using two serial ports and two consoles. It is also possible to use a dumb terminal. 1. Attach a null modem between the two desired ports. If using one computer, open two consoles (Ctr-Alt-Console#). 2. Execute qtalk (or some other terminal emulation program) on both serial ports. The following is an example of using qtalk to communicate with serial port 2: qtalk -m /dev/ser2 Press "Ctrl-A" to bring up the options screen. From this screen, it is possible to send and recieve files. If you are using one computer and two consoles, you will need to open qtalk on both consoles. When you type on one console, the text should appear on the other. Note: Since each console requires a full screen view, a switch to the receiving console is necessary to view the received characters. 3. Using a dumb terminal to log into QNX through a serial port: QNX allows users to log onto the system through a serial port. The easiest method is to connect a dumb terminal to the desired port using a null modem cable. It is also possible to use a terminal emulation program on another computer, or even on the same computer using a different console. 1. Configure the desired serial port to accept logins. The "tinit" command will set up the serial ports for this purpose. The following example sets up serial ports 2 and 3 to accept logins: tinit -T /dev/ser2 /dev/ser3 & This can be done either in the "/etc/config/sysinit.node" file, or directly from the command prompt. For more information on configuring the serial ports for logins, refer to "QNX Operating System Installation and Configuration" Chapter 4 "Configuring Serial Lines for Terminals and Users", or look up "tinit" in the utilities reference. 2. Connect a terminal to a serial port using a null modem cable. Hit any key on the terminal. If the port is correctly set up to accept logins, and if the communication settings (baud, parity, etc.) are correct, then a login prompt will appear on the terminal screen. If you have any further questions, refer to the "QNX Operating System Installation and Configuration" guide, Chapter 4 (Connecting Serial & Parallel Devices), or to the "QNX Operating System Utilities" reference under "Dev.ser" or "tinit". For technical support, refer to your user manual or the label on your software utility disk for the appropriate correspondence.