247.

contents
Next: Serial Hardware Up: Setting up the Serial Previous: Introduction to Serial Devices

Like all devices in a system, serial ports are accessed through device special files, located in the /dev directory. There are two varieties of device files related to serial drivers, and for each port, there is one device file from each of them. Depending on the file it is accessed by, the device will behave differently.

The first variety is used whenever the port is used for dialing in; it has a major number of-4, and the files are named ttyS0, ttyS1, etc. The second variety is used when dialing out through a port; the files are called cua0, etc, and have a major number of-5.

Minor numbers are identical for both types. If you have your modem on one of the ports COM1 through COM4, its minor number will be the COM port number plus 63. If your setup is different from that, for example when using a board supporting multiple serial lines, please refer to the Serial Howto.

Assume your modem is on COM2. Thus its minor number will be-65, and its major number will be 5 for dialing out. There should be a device cua1 which has these numbers. List the serial ttys in the /dev directory. Columns 5 and 6 should show major and minor numbers, respectively:

            $ ls -l /dev/cua*            crw-rw-rw-   1 root     root       5,  64 Nov 30 19:31 /dev/cua0            crw-rw-rw-   1 root     root       5,  65 Nov 30 22:08 /dev/cua1            crw-rw-rw-   1 root     root       5,  66 Oct 28 11:56 /dev/cua2            crw-rw-rw-   1 root     root       5,  67 Mar 19  1992 /dev/cua3 
If there is no such device, you will have to create one: become super-user and type
            # mknod -m 666 /dev/cua1 c 5 65            # chown root.root /dev/cua1 < /pre> Some people suggest making /dev/modem a symbolic link to your modem device, so that casual users don't have to remember the somewhat un-intuitive cua1. However, you cannot use modem in one program, and the real device file name in another. This is because these programs use so-called lock files to signal that the device is used. By convention, the lock file name for cua1, for instance, is LCK..cua1.  Using different device files for the same port means that programs will fail to recognize each other's lock files, and will both use the device at the same time. As a result, both applications will not work at all. 


contents
Next: Serial Hardware Up: Setting up the Serial Previous: Introduction to Serial Devices

Andrew Anderson
Thu Mar 7 23:22:06 EST 1996



The Network Administrators' Guide
Linux Network Administrators Guide (2nd Edition)
ISBN: B00007FYJC
EAN: N/A
Year: 1992
Pages: 296

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net