Assembled from FAQ.
이 장은 여러분께 직렬 포트에 관한 몇가지 일반적인 정보를 제공할 것입니다. 이곳에서 원하시는 것을 찾지 못하면 핸드북의 터미널과 다이얼-업 부분을 살펴보십시요.
The ttydX (or cuaaX) device is the regular device you will want to open for your applications. When a process opens the device, it will have a default set of terminal I/O settings. You can see these settings with the command
# stty -a -f /dev/ttyd1
When you change the settings to this device, the settings are in effect until the device is closed. When it is reopened, it goes back to the default set. To make changes to the default set, you can open and adjust the settings of the "initial state" device. For example, to turn on CLOCAL mode, 8 bits, and XON/XOFF flow control by default for ttyd5, do:
# stty -f /dev/ttyid5 clocal cs8 ixon ixoff
A good place to do this is in /etc/rc.serial. Now, an application will have these settings by default when it opens ttyd5. It can still change these settings to its liking, though.
You can also prevent certain settings from being changed by an application by making adjustments to the "lock state" device. For example, to lock the speed of ttyd5 to 57600 bps, do
# stty -f /dev/ttyld5 57600
Now, an application that opens ttyd5 and tries to change the speed of the port will be stuck with 57600 bps.
Naturally, you should make the initial state and lock state devices writable only by root. The MAKEDEV script does not do this when it creates the device entries.