CORRECT MINOR NUMBER FOR COM PORT (SELECT FAILS)
authorChristoph Robitschko <chmr@edvz.tu-graz.ac.at>
Sun, 9 Aug 1992 00:00:00 +0000 (00:00 +0000)
committerChristoph Robitschko <chmr@edvz.tu-graz.ac.at>
Sun, 9 Aug 1992 00:00:00 +0000 (00:00 +0000)
commitbe5839e23e2cf7f06e5c533cf0d1da1fa5242451
treed0004f2335301fb0318db157af31d66b56a09eaf
parente39f1b2be6c67d7480db9ea83cd8d3c3611c7990
CORRECT MINOR NUMBER FOR COM PORT (SELECT FAILS)

I had the problem with select() not working on com ports. I got no
response from a post regarding this one, so I started to look into it
myself. I found out that the com driver calculates unit = minor(dev) -1;
This has the following implications:
        /dev/com1 corresponds to COM0, /dev/com2 to COM1 (very confusing
                in kernel messages)
        It is incompatible with the config file entries com1 at..., com2 at...
        Unpredictible results will occur if someone puts a com0 at.. in
                his config file.
        It is incompatible with the DOS usage of COM1, COM2 (But who cares 8-)
        ttselect() calculates unit = minor(dev), and uses this as an index in
                com_tty. Because this index is different from that used
                in the com driver, select() on /dev/com1 looks at
                /dev/com2 and select() on /dev/com2 looks at an undefined
                entry in com_tty and returns always true.

WARNING: RE-mknod /dev/com1, /dev/com2, and modify your kernel config!

AUTHOR: Christoph Robitschko (chmr@fstgds01.tu-graz.ac.at)
386BSD-Patchkit: patch00018
usr/src/sys.386bsd/i386/isa/com.c