Re: Virtual serial port in usermode?
- From: Philip Pemberton <philpem@xxxxxxxxx>
- Date: Sun, 27 Jan 2008 06:56:25 -0800 (PST)
On 27 Jan, 02:01, Grant Edwards <gra...@xxxxxxxx> wrote:
Right. Just be aware that pseudo-ttys only emulate a small
subset of what a real tty does. No modem control/status
ioctls, no control over word length, parity, baud rate,
flow-control, etc.
.... 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.
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.
I've also found a nice example of sending UDP packets from kernel
space on Kernelnewbies, which neatly solves the problem of getting the
data from kernel space to user space to feed to the emulator (emulator
listens for UDP packets from localhost, kernel driver pretends to be a
serial port card reader and feeds the data from the virtual serial
port to the UDP daemon).
Oh well, it's a good excuse to finally learn how to write a kernel
module...
Unless you've got time to pay somebody to
closely follow the kernel mailing list and do continuous
testing with bleeding-edge kernels, you usually find out about
these API overhauls from customers who can no longer build the
driver.
Thankfully the only customer in this case is me, and it only has to
work on a few machines anyway...
Thanks,
Phil.
.
- Follow-Ups:
- Re: Virtual serial port in usermode?
- From: Grant Edwards
- Re: Virtual serial port in usermode?
- References:
- Virtual serial port in usermode?
- From: Philip Pemberton
- Re: Virtual serial port in usermode?
- From: Grant Edwards
- Virtual serial port in usermode?
- Prev by Date: client server programming
- Next by Date: Jacob Watch, WWW.ICEDOUTPLANET.TK Replica Jacob Watch, Jacob Watches, Replica Jacob
- Previous by thread: Re: Virtual serial port in usermode?
- Next by thread: Re: Virtual serial port in usermode?
- Index(es):