Re: Virtual serial port in usermode?



On 2008-01-27, Philip Pemberton <philpem@xxxxxxxxx> wrote:

... which means there isn't an "RTS" handshake line to
monitor, so it's not a possible solution to the problem I
wanted to solve.

Right -- at least not with the present pty driver.

In summary, you can't do anything even close to a virtual
serial port under Linux in user-space. The pty device only
supports a fraction of the features required. So, you have to
write a serial-driver that talks to the line-discipline layer.

OK then. I've got a copy of the LKMPG, and I'm (slowly)
reading through it, and paying close attention to the chapter
on serial drivers.

Which chapter is that? I've been scanning the LKMPG, and I
don't really see anything very relevent.

Serial drivers don't seem to be mentioned at all. A serial
driver isn't a character device driver that hooks to the normal
open/read/write/ioct syscall interface using a file_operations
struct. It's a lower-level driver that hooks on to the
"bottom" of the tty line-discipline layer. The API is somewhat
similar to that of a character device driver, but the API is
different. [The line discipline layer is a character driver as
described in the LKMPG.]

The only documentation I'm aware of for writing a serial driver
is tty.txt in the Documentation directory of the source tree
(and sources for other serial drivers -- you should probably
pay particular attention to drivers for network attached
devices).

--
Grant Edwards grante Yow! I'm a nuclear
at submarine under the
visi.com polar ice cap and I need
a Kleenex!
.