操作系统功能的演化
Operating system (OS) functions have evolved in response to the following considerations and issues:
1. Efficient utilization of computing resources
2. New features in computer architecture
3. New user requirements.
操作系统的功能因为以下一些原因而不断演化:
1. 计算资源的有效应用。
2. 计算机结构的新特性。
3. 新的用户需求。
Different operating systems address these issues in different manner, however most operating systems contain components which have similar functionalities. For example, all operating systems contain components for functions of memory management, process management and protection of users from one another. The techniques used to implement these functions may vary from one OS to another, but the fundamental concepts are the same.
不同操作系统采取不同的方法处理这些问题,但几乎所有的操作系统都拥有一些功能相似的部分,如存储器管理、进程管理和用户保护。尽管不同的操作系统采取的具体技术不同,但其基本概念是一致的。由于它们之间的相似性才使我们可以对其进行研究。因此,只需学习操作系统设计的基本概念及一些操作系统实现的实例,即可了解操作系统原理,而不用学习大量的操作系统。
In this chapter we study the concepts in OS design by studying the evolution of OS functions and identifying the fundamental concepts and techniques used in their implementation. We also introduce formal definitions of concepts and relevant terminology.
本章我们将通过学习操作系统功能的演化和认识操作系统在实现过程中采用的基本概念与技术,了解操作系统设计中的概念,还将介绍一些概念和相关术语的正式定义。
Jobs, programs and processes
The primary function of an OS is to organize the execution of user computations in a computer system. A suitable characterization of user computations is therefore fundamental to its design. Three characterizations of user computations have been used to date--jobs, programs and processes.
作业、程序和进程
操作系统的基本功能是在计算机系统中组织用户计算的执行。因此它在设计中要求对用户计算有恰当的特征描述。通常在用户计算中使用以下三种特征记述——作业、程序和进程。
A program is the classical view of a computation. It consists of a set of program units, including program units obtained from libraries, which constitute an object code to be executed. A process is an execution of a program or of a part of a program. It differs from a program when concurrent programming techniques are used for coding the program. In such a case many processes can execute a program or a part of a program.
程序是计算的传统观点,它由一系列程序单元构成,包括从库中获取的程序单元,并组成可执行的目标代码。进程是一个程序或一个程序部分的一次执行。在应用并行编码技术时,许多进程可以执行同一程序或其一部分,这时进程与程序是不同的。
A job is a computational structure which is a sequence of programs. It consists of a sequence of job steps, each job step constituting the execution of a program. Thus, a job for the compilation and execution of a Pascal program involves the following three job steps---execution of the Pascal compiler to compile the Pascal program, execution of the linker to prepare the compiled program for execution and execution of the object program which has just been linked.
作业是一个程序序列的计算结构。它由一系列作业步组成,每一步都是一个程序执行的一部分。例如,一个对Pascal程序进行编译和执行的作业包括以下三步:用编译程序对程序进行编译,用链接程序准备对编译好的程序的执行,以及执行刚刚链接好的目标程序。
Note that it is not meaningful to execute a job step unless each of the previous job steps has executed success fully, e.g. linking is not meaningful unless compilation was successful. The notion of a job was important in early computer systems which did not support interactive computing it is of marginal relevance in most contemporary systems, for example the BAT files of MS DOS and shell scripts of Unix resemble the notion of jobs.
每一步都要在前一步执行成功后才能执行。比如,除非编译成功,否则链接就毫无意义。在早期不支持交互计算的计算机系统中,作业的概念很重要。它在现代系统中也有应用,如MS-DOS中的Bat文件和Unix中的shell脚本。