Re: Virtual serial port in usermode?



On 2008-01-27, Grant Edwards <grante@xxxxxxxx> wrote:

So, back to your problem: the easiest way to do what you want
to do is to use two real serial ports with a null-modem cable
connecting them. [...]

Actually, another method that might work is to "pre-load" your
own open(), close(), ioctl(), read(), and write()
implimentations that override/wrap the normal libc ones. You
could then split out calls directed at your user-space
"virtual" serial ports and hand off the calls to another
program using some IPC mechanism rather than calling the libc
equivalent.

You'd have to check to see what serial-port related libc calls
the app in question is useing. If it's using select(), poll(),
epoll() on a mixture of real and virtual devices, then things
get sort of complicated.

Here's page that discusses how to override libc functions, but
the site seems to be offline at the moment:

http://www.ibm.com/developerworks/linux/library/l-glibc.html

Good luck. Let us know how you end up solving the problem.

--
Grant Edwards grante Yow! Let's climb to the
at TOP of that MOUNTAIN and
visi.com think about STRIP MINING!!
.