Hardware Reference
In-Depth Information
machine. Over this connection it can then exchange data in both directions, typi-
cally using the TCP/IP protocol. Since networking technology has been in UNIX
for decades and is very stable and mature, a substantial fraction of the servers on
the Internet run UNIX .
Since there are many implementations of UNIX , it is difficult to say much
about the structure of the operating system since each one is somewhat different
from all the others. However, in general, Fig. 6-31 applies to most of them. At the
bottom, there is a layer of device drivers that shield the file system from the bare
hardware. Originally, each device driver was written as an independent entity, sep-
arate from all the others. This arrangement led to a lot of duplicated effort, since
many drivers must deal with flow control, error handling, priorities, separating data
from control, and so on. This observation led Dennis Ritchie to develop a frame-
work called streams for writing drivers in a modular way. With a stream, it is pos-
sible to establish a two-way connection from a user process to a hardware device
and to insert one or more modules along the path. The user process pushes data
into the stream, which then is processed or transformed by each module until it
gets to the hardware. The inverse processing occurs for incoming data.
User
mode
Shell
User program
System call interface
File system
Process management
Kernel
mode
Block cache
IPC
Scheduling
Signals
Memory mgmt.
Device drivers
Hardware
Figure 6-31. The structure of a typical UNIX system.
On top of the device drivers comes the file system. It manages file names, di-
rectories, disk block allocation, protection, and much more. Part of the file system
is a block cache , for holding the blocks most recently read in from disk, in case
they are needed again soon. A variety of file systems have been used over the
years, including the Berkeley fast file system (McKusick et al., 1984), and
log-structured file systems (Rosenblum and Ousterhout, 1991, and Seltzer et al.,
1993).
The other part of the UNIX kernel is the process-management portion. Among
its various other functions, it handles IPC (InterProcess Communication), which al-
lows processes to communicate with one another and synchronize to avoid race
conditions. A variety of mechanisms are provided. The process-management code
 
 
Search WWH ::




Custom Search