bash works with STDIN, STDOUT and STDERR. When
xterm is opened,
it allocates the pseudo tty. Then xterm forks child process and STDIN, STDOUT, STDERR are tied to
exec is called with
bash. This is good.
But how to make
bash work with TTY directly? How to make
open("/dev/ttyS0", O_RDWR)? So that I could attach a device to
/dev/ttyS0 and execute commands in
bash from the device.