Other Output console overflow if "cat /dev/cuau0" on two connected machines with serial ports

In order to enable remote gdb through serial ports on two machines (both of them are installed as VM on Hyper-V), I connected the two host machine (Windows) through com ports, and I also enabled Windows named pipe for the two VM. I did an experiment and found something interesting.

Login the two VM through putty, suppose the two clients are A1 and B1 which connect VM A and VM B, and execute cat /dev/cuau0 on both of them to pull information from serial ports.

Open a new putty client to connect, for example VM A again, the client is A2, and execute echo "hello" > /dev/cuau0, then I observed the console of both A1 and B1 output quite a lot of information and the screen is always flush by "\r\n". I have stoped the output through "CTRL + C". The whole process is illustrated as follows:

Step 1:
A1: cat /dev/cuau0
B1: cat /dev/cuau0

Step 2:
A2: echo "hello" > /dev/cuau0

A1 and B1's screen is flushed by "\r\n" and never stops the output.

Why does it happen?
 
I got the answer from some other forum. I need to use stty -f /dev/cuau0.init -echo to shield the standard input. Then the issue disappears.
 
Back
Top