> 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-yi-bu-fen-gai-lan/2.13.-xi-tong-yun-xing.md).

# 2.13 系统运行

系统靠自举机制启动运行。首先，UNIX 内核必须装入处理器的主存。装入之后，内核要经过一个初始化阶段，把硬件设置到已知状态。接着，内核必须做自动配置——一个发现并配置接在处理器上的外设的过程。系统先以单用户方式开始运行，由一个启动脚本检查磁盘，并启动记账和配额检查。最后，启动脚本启动通用系统服务，把系统带入完整的多用户运行。

多用户运行期间，进程在为用户访问配置的终端线路和网络端口上等待登录请求。检测到登录请求时，产生一个登录进程并做用户验证。登录验证成功后，创建一个登录 shell，用户可以从它运行更多进程。

## 习题

2.1 用户进程如何向内核请求服务？

2.2 数据怎样在进程与内核之间传输？有哪些可选方案？

2.3 进程如何访问一个 I/O 流？列出三种 I/O 流。

2.4 进程生命周期的四个步骤是什么？

2.5 4.3BSD 为什么要提供进程组？

2.6 内核有哪些与机器相关的功能？

2.7 描述绝对路径名与相对路径名的区别。

2.8 在添加 `mkdir` 系统调用之前，在当前目录下创建一个新目录 **foo** 需要哪三个系统调用？给出 `mkdir` 系统调用加入 4.2BSD 的三条理由。

2.9 定义分散/聚集 I/O。它为什么有用？

2.10 块设备与字符设备有什么区别？

2.11 列出终端驱动提供的五种功能。

2.12 管道与套接字有什么区别？

2.13 描述如何创建管道线中的一组进程。

\*2.14 解释进程间通信与联网的区别。

## 参考文献

Accetta et al., 1986. M. Accetta, R. Baron, D. Golub, R. Rashid, A. Tevanian, & M. Young, “Mach: A New Kernel Foundation for UNIX Development,” Technical Report, Carnegie Mellon University, Pittsburgh, PA (August 1986).

Cheriton, 1988. D. R. Cheriton, “The V Distributed System,” *Comm ACM* **31**(3), pp. 314–333 (March 1988).

Ewens et al., 1985. P. Ewens, D. R. Blythe, M. Funkenhauser, & R. C. Holt, “Tunis: A Distributed Multiprocessor Operating System,” *USENIX Association Conference Proceedings*, pp. 247–254 (June 1985).

Fitzgerald & Rashid, 1986. R. Fitzgerald & R. F. Rashid, “The Integration of Virtual Memory Management and Interprocess Communication in Accent,” *ACM Transactions on Computer Systems* **4**(2), pp. 147–177 (May 1986).

Gingell et al., 1987. R. A. Gingell, J. P. Moran, & W. A. Shannon, “Virtual Memory Architecture in SunOS,” *USENIX Association Conference Proceedings*, pp. 81–94 (June 1987).

Joy et al., 1986. W. N. Joy, R. S. Fabry, S. J. Leffler, M. K. McKusick, & M. J. Karels, “Berkeley Software Architecture Manual, 4.3BSD Edition,” pp. 6:1–43 in *UNIX Programmer's Supplementary Documents, Volume I, 4.3 Berkeley Software Distribution, Virtual VAX-11 Version*, USENIX Association, Berkeley, CA (1986).

Kernighan & Pike, 1984. B. W. Kernighan & R. Pike, *The UNIX Programming Environment*, Prentice-Hall, Englewood Cliffs, NJ (1984).

McKusick et al., 1985. M. K. McKusick, M. Karels, & S. Leffler, “Performance Improvements and Functional Enhancements in 4.3BSD,” *USENIX Association Conference Proceedings*, pp. 519–531 (June 1985).

McKusick & Karels, 1988. M. K. McKusick & M. J. Karels, “Design of a General Purpose Memory Allocator for the 4.3BSD UNIX Kernel,” *USENIX Association Conference Proceedings*, pp. 295–304 (June 1988).

Ritchie, 1988. D. M. Ritchie, “Early Kernel Design,” private communication (March 1988).


---

# 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-yi-bu-fen-gai-lan/2.13.-xi-tong-yun-xing.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.
