> 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.9.-qi-ta-hang-gui-cheng.md).

# 9.9 其他行规程

我们用标准面向终端的行规程例程考察了终端 I/O 系统的运作——这些例程既实现伯克利的新行规程，也实现第七版 UNIX 的旧行规程。为求完整，现在描述系统中的其他几种行规程。注意，前文对终端多路复用驱动运作的讨论，对这些规程与对面向终端的规程同样适用。

**Berknet**

串行线替代用途的第一个替代行规程例子是 Berknet 行规程。*Berknet* 是一个已废弃的面向批处理的网络，曾用 9600 波特串行线连接 PDP-11 与 VAX 的 UNIX 系统。由于标准行规程输入处理的开销，人们设计了一种功能精简的专用网络规程：提供七位数据通路传输以换行结尾的数据块；确认与校验和在系统之外完成。Berknet 规程为每条线路分配单个缓冲，一次缓冲一行输入（网络软件每确认一行才允许发下一行）。`l_rint` 收字符例程在多数多路复用驱动中展开内联，以尽量压缩开销。

**串行线路 IP 规程**

另一种行规程——串行线路 IP（Serial Line IP，SLIP）——供更现代的网络软件在异步串行线上封装和传输网际协议（IP）数据报 \[Romkey, 1988]。（IP 的资料见第 11、12 章。）**slattach** 程序打开一条串行线路，设置线路速度，进入 SLIP 行规程。SLIP 行规程的 open 例程把终端线路与一个预配置的网络接口关联，准备收发网络分组。用 **ifconfig** 程序设置接口的网络地址后，网络就会经 SLIP 线路路由分组，到达线路所连的系统。分组用简单的方案成帧：一个成帧字符（八进制 0300）分隔分组。分组内部出现的成帧字符用转义字符（八进制 0333）引用并换位（为八进制 0334）；分组内的转义字符同样转义并换位（为八进制 0335）。

每次向 SLIP 接口输出分组时启动输出通路。SLIP 规程把成帧字符和分组数据放上 `tty` 的输出队列，按需转义成帧和转义字符，然后调用 `ttstart()` 启动传输——后者转而调用 `tty_t_oproc` 字段引用的设备启动例程。只要队列空间够、系统不缺 C-list 块，它可以在返回前放上多个分组。传输完成时，设备驱动调用 SLIP 的 start 例程，继续往输出队列放数据，直到全部分组发出或队列再次填满。

使用 SLIP 规程的线路上收到字符时，被转义的字符翻译回来，数据字符放进网络缓冲。成帧字符结束分组时，分组交给网络，缓冲重新初始化。

SLIP 规程让没有专门高速网络硬件的机器也能获得中等速度的网络连接。

**图形输入板规程**

tablet 行规程用来经串行线把数字化仪等图形设备接入系统。进入规程后，它持续从设备接收图形数据，允许应用程序从线路读取来轮询最新信息。返回信息的格式取决于设备提供的形式；支持多种格式。


---

# 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.9.-qi-ta-hang-gui-cheng.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.
