I'd like to know how to create a terminal device to simulate a piece of hardware connected through a serial port. Basically, tty device with a certain baud rate that can be read from and written to between two processes. From what I understand, a psuedo-terminal is what I'm looking for, and the makedev can apparently make one.I've also found the following set of instructions:su to rootcd /devmkdir ptymknod pty/m0 c 2 0mknod pty/s0 c 3 0ln -s pty/m0 ttyp0ln -s pty/s0 ptyp0chmod a+w pty/m0 pty/s0Is there a better way of making pseudo-terminal, or is this pretty much the standard way of make one in the shell?
Creating a terminal device for interprocess communication
linux;terminal;devices;tty;ipc
That's probably how pty device files get created, but you don't want to do that whenever you want a pty. Any given machine usually has a complement of pty device files already created.Pseudo TTYs are fairly OS specific and you don't mention what you want to do this on. For a modern linux, I'd take a look at openpty(3).  You can find working example code in the OpenSSH source code, sshpty.c.  You will probably have to find code that calls pty_allocate() to fully understand.