I'm using simulation software for unix (ucsim) that runs two simulated programs that supposed to connect to each other via its own simulated serial ports.

The software provides me with these methods for interaction: By way of port addressing (localhost ip with custom port) By way of pairs of fifos (generated with mkfifo) By connecting directly to a terminal device.

The first two I'm unsuccessful with but I want to try the last one.

So far, I feel the best idea to achieve my job is to take a physical serial port cable, strip it, and connect the TXD and RXD lines together and plug it into my computer then I can use /dev/ttySx as the terminal device for the program.

But instead of having to connect the cable to the computer, is there something equivalent I can do within unix without needing the cable (or any cable), even if it means downloading a special virtual serial device kernel driver of some sorts and using it?

I also want to be able to set all of the properties using stty on such a device just like I can on the real /dev/ttyS serial devices.


1 Answer 1


Would socat be helpful?

description: socat is a relay for bidirectional data transfer between two independent data channels. Each channel may be a file, pipe, device (serial line etc. or a pseudo terminal), a socket (UNIX, IP4, IP6 - raw, UDP, TCP), an SSL socket, proxy CONNECT connection, a file descriptor (stdin etc.), the GNU line editor (readline), a program, or a combination of two of these. These modes include generation of 'listening' sockets, named pipes, and pseudo terminals.

Source: http://www.dest-unreach.org/socat/doc/socat.html

Virtual serial port redirection using socat - https://tewarid.github.io/2015/04/07/virtual-serial-port-redirection-using-socat.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .