没有合适的资源?快使用搜索试试~ 我知道了~
很好的UNIX入门级资料
资源推荐
资源详情
资源评论
T
T
HE
HE
UNIX O
UNIX O
PERATING
PERATING
S
S
YSTEM
YSTEM
William Stallings
This document is an extract from
Operating Systems: Internals and Design Principles, Fifth Edition
Prentice Hall, 2005, ISBN 0-13-147954-7
Copyright 2005 William Stallings
-2-
T
T
ABLE OF
ABLE OF
C
C
ONTENTS
ONTENTS
2.6 TRADITIONAL UNIX SYSTEMS....................................................................................3
History............................................................................................................................3
Description.....................................................................................................................4
2.7 MODERN UNIX SYSTEMS .............................................................................................5
System V Release 4 (SVR4)..........................................................................................5
Solaris 9..........................................................................................................................6
4.4BSD...........................................................................................................................6
3.5 UNIX SVR4 PROCESS MANAGEMENT.........................................................................7
Process States.................................................................................................................7
Process Description........................................................................................................9
Process Control ............................................................................................................13
4.5 SOLARIS THREAD AND SMP MANAGEMENT ........................................................15
Multithreaded Architecture..........................................................................................15
Motivation....................................................................................................................16
Process Structure..........................................................................................................18
Thread Execution.........................................................................................................18
Interrupts as Threads....................................................................................................20
6.7 UNIX CONCURRENCY MECHANISMS......................................................................22
Pipes.............................................................................................................................22
Messages......................................................................................................................23
Shared Memory............................................................................................................23
Semaphores..................................................................................................................23
Signals..........................................................................................................................25
6.9 SOLARIS THREAD SYNCHRONIZATION PRIMITIVES..........................................27
Mutual Exclusion Lock................................................................................................27
Semaphores..................................................................................................................28
Readers/Writer Lock....................................................................................................28
Condition Variables .....................................................................................................29
8.3 UNIX AND SOLARIS MEMORY MANAGEMENT ....................................................31
Paging System..............................................................................................................31
Data Structures.................................................................................................31
Page Replacement............................................................................................34
Kernel Memory Allocator............................................................................................35
9.3 TRADITIONAL UNIX SCHEDULING..........................................................................38
10.4 UNIX SVR4 SCHEDULING .........................................................................................40
11.8 UNIX SVR4 I/O..............................................................................................................42
Buffer Cache ................................................................................................................42
Character Queue...........................................................................................................43
Unbuffered I/O.............................................................................................................44
UNIX Devices..............................................................................................................44
12.7 UNIX FILE MANAGEMENT .......................................................................................46
Inodes...........................................................................................................................46
File Allocation..............................................................................................................48
Directories....................................................................................................................49
Volume Structure.........................................................................................................49
-3-
2.6 TRADITIONAL UNIX SYSTEMS
History
The history of UNIX is an oft-told tale and will not be repeated in great detail here. Instead, we
provide a brief summary.
UNIX was initially developed at Bell Labs and became operational on a PDP-7 in 1970.
Some of the people involved at Bell Labs had also participated in the time-sharing work being
done at MIT's Project MAC. That project led to the development of first CTSS and then Multics.
Although it is common to say that the original UNIX was a scaled-down version of Multics, the
developers of UNIX actually claimed to be more influenced by CTSS [RITC78]. Nevertheless,
UNIX incorporated many ideas from Multics.
Work on UNIX at Bell Labs, and later elsewhere, produced a series of versions of UNIX.
The first notable milestone was porting the UNIX system from the PDP-7 to the PDP-11. This
was the first hint that UNIX would be an operating system for all computers. The next important
milestone was the rewriting of UNIX in the programming language C. This was an unheard-of
strategy at the time. It was generally felt that something as complex as an operating system,
which must deal with time-critical events, had to be written exclusively in assembly language.
The C implementation demonstrated the advantages of using a high-level language for most if
not all of the system code. Today, virtually all UNIX implementations are written in C.
These early versions of UNIX were popular within Bell Labs. In 1974, the UNIX system
was described in a technical journal for the first time [RITC74]. This spurred great interest in the
system. Licenses for UNIX were provided to commercial institutions as well as universities. The
first widely available version outside Bell Labs was Version 6, in 1976. The follow-on Version
7, released in 1978, is the ancestor of most modern UNIX systems. The most important of the
non-AT&T systems to be developed was done at the University of California at Berkeley, called
UNIX BSD (Berkeley Software Distribution), running first on PDP and then VAX machines.
AT&T continued to develop and refine the system. By 1982, Bell Labs had combined several
-4-
AT&T variants of UNIX into a single system, marketed commercially as UNIX System III. A
number of features was later added to the operating system to produce UNIX System V.
Description
Figure 2.14 provides a general description of the UNIX architecture. The underlying hardware is
surrounded by the operating system software. The operating system is often called the system
kernel, or simply the kernel, to emphasize its isolation from the user and applications. This
portion of UNIX is what we will be concerned with in our use of UNIX as an example in this
book. However, UNIX comes equipped with a number of user services and interfaces that are
considered part of the system. These can be grouped into the shell, other interface software, and
the components of the C compiler (compiler, assembler, loader). The layer outside of this
consists of user applications and the user interface to the C compiler.
A closer look at the kernel is provided in Figure 2.15. User programs can invoke operating
system services either directly or through library programs. The system call interface is the
boundary with the user and allows higher-level software to gain access to specific kernel
functions. At the other end, the operating system contains primitive routines that interact directly
with the hardware. Between these two interfaces, the system is divided into two main parts, one
concerned with process control and the other concerned with file management and I/O. The
process control subsystem is responsible for memory management, the scheduling and
dispatching of processes, and the synchronization and interprocess communication of processes.
The file system exchanges data between memory and external devices either as a stream of
characters or in blocks. To achieve this, a variety of device drivers are used. For block-oriented
transfers, a disk cache approach is used: a system buffer in main memory is interposed between
the user address space and the external device.
The description in this subsection has dealt with what might be termed traditional UNIX
systems; [VAHA96] uses this term to refer to System V Release 3 (SVR3), 4.3BSD, and earlier
versions. The following general statements may be made about a traditional UNIX system. It is
Hardware
Kernel
System Call
Interface
UNIX Commands
and Libraries
User-written
Applications
Figure 2.14 General UNIX Architecture
剩余67页未读,继续阅读
资源评论
fengmin862008
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功