> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/4.3-bsd-unix-cao-zuo-xi-tong-she-ji-yu-shi-xian/di-san-bu-fen-io-xi-tong/9.7.-rs-232-yu-tiao-zhi-jie-tiao-qi-kong-zhi.md).

# 9.7 RS-232 与调制解调器控制

多数终端和调制解调器经异步 RS-232 串行端口连接。这种连接除收发数据的线路外还支持若干线路，UNIX 通常只支持其中几条。最常用的是表明两端设备已准备好传输数据的线路。RS-232 电气规范是不对称的：每条线路由相连的两台设备之一驱动、由另一台采样。因此，任何正常连接的一端必须接成数据终端设备（DTE），如终端；另一端接成数据通信设备（DCE），如调制解调器。注意 DTE 里的 *terminal* 意为 **端点**：供人敲键盘的终端是 DTE，计算机也是 DTE。数据终端就绪（DTR）线是 DTE 端的输出，充当 **就绪** 指示；反方向上，数据载波检测（DCD）线表示 DCE 设备准备好传输数据。VAX 终端接口都接成 DTE（可直接连调制解调器，或用零调制解调器电缆连接本地终端）。因此 4.3BSD 终端驱动和命令的用语反映这一取向——尽管许多计算机错误地用了相反的惯例。

终端设备打开时，DTR 输出置位，让所连的调制解调器或其他设备得以开始工作。线路上若支持调制解调器控制（modem control），open 不会完成，数据也不传输，直到检测到 DCD 输入 **载波**。因此，对连着调制解调器的线路做 open 会阻塞到连接建立——通常发生在收到远程调制解调器呼叫之时。载波保持期间可以传输数据。调制解调器丢掉连接时 DCD 线关闭，此后的读写以失败告终。

接本地终端或其他 DTE 设备的端口，用一条把每端的 DTR 接到对端 DCD 的零调制解调器（null modem）电缆连接；也可以把主机端口的 DTR 输出 **环回** 到 DCD 输入；最后，驱动还可以配置成无视调制解调器控制输入。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://book.bsdcn.org/4.3-bsd-unix-cao-zuo-xi-tong-she-ji-yu-shi-xian/di-san-bu-fen-io-xi-tong/9.7.-rs-232-yu-tiao-zhi-jie-tiao-qi-kong-zhi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
