Computer English
Chapter 4 Data Structure
Chapter 5 Operating System
计算机专业英语 5-2
Key points:
Function and structure of
Operating System
Difficult points:
Resource allocation and
related functions
User interface functions
Chapter 5 Operating System
计算机专业英语 5-3
Requirements:
1,了解操作系统是如何实现资源分配和用户接口功能的。
2,通过学习操作系统功能的演化,认识操作系统在实现过程中采用的基本概念与技术,了解操作系统设计中的概念。
3,认识操作系统的结构,了解当前常见操作系统的特点
4,掌握被动语态的翻译技巧。
Chapter 5 Operating System
计算机专业英语 5-4
New Words & Expressions:
OS (Operating System) 操作系统 binding n,捆绑
mutual interference 相互干扰 interface n.界面,接口
facilitate vt,推动,帮助,促进 allocation n.分配,安置
constraint n.约束,强制,局促 criteria n.标准
embody vt.具体表达,使具体化 entry n,条目,登录
privilege n.特权; vt.给与,..特权 partition vt.分区
approach n,方法,途径 a priori 预先,事前
perceive v.感知,感到,认识到 preemption n.抢占
suboptimal adj.未达最佳标准的 entrust v.委托
sequential adj,顺序的,串行的 exclusive use 专用
concurrent adj.并发的,并行的 de-allocate vt,释放
scheduling n.调度 salient features 特征,特色
initiate vt,vi,开始,发动
5.1 OS Function
Chapter 5 Operating System
计算机专业英语 5-5
OS functions can be classified into
Resource allocation and related functions
User interface functions.
The resource allocation function implements resource sharing
by the users of a computer system,Basically,it performs
binding of a set of resources with a requesting program,that is,
it associates resources with a program,The related functions
implement protection of users sharing a set of resources
against mutual interference.
操作系统的功能可分为,
1,资源分配及相关功能。
2,用户接口功能资源分配功能 负责实现计算机系统的用户共享资源。它主要将资源和提出需求的程序绑定在一起,即使资源和程序相关联。与之相关的一些功能实现不同用户在共享资源时的保护,以免发生相互干扰。
5.1 OS Function
Chapter 5 Operating System
计算机专业英语 5-6
The user interface function facilitates creation and
use of appropriate computational structures by a user,
This function typically involves the use of a command
language or a menu.
用户接口功帮助 用户创立并使用适当的计算结构,这一功能通常涉及命令、语言或菜单的应用。
5.1 OS Function
Chapter 5 Operating System
计算机专业英语 5-7
The resource allocation function allocates resources for use by a
user's computation,Resources can be divided into system
provided resources like CPUs,memory areas and IO devices,or
user-created resources like files which are entrusted to the OS,
资源分配功能分配资源供用户计算使用。资源可分为系统提供的资源(如 CPU、存储器区域及 I/O设备群)和用户创建的资源(如由操作系统管理的文件等)。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-8
Resource allocation criteria depend on whether a resource is a
system resource or a user-created resource,Allocation of system
resources is driven by considerations of efficiency of resource
utilization,Allocation of user-created resources is based on a set
of constraints specified by its creator and typically embodies the
notion of access privileges.
资源分配的标准根据资源的分类确定,系统资源的分配要考虑资源利用的效率,而用户创立资源的分配则基于该资源的创立者所设定的特种限制,比如访问权限。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-9
Two popular strategies for resource allocation are:
Partitioning of resources
Allocation from a pool
资源分配通常采取以下两种策略;
1,资源分区。
2,从资源池中分配。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-10
In the resource partitioning approach,the OS decides a priori
what resources should be allocated to a user computation,This
approach is called static allocation because the allocation is
made before the execution of a program starts,Static resource
allocation is simple to implement,however,it could lead to
suboptimal utilization because the allocation is made on the
basis of perceived needs of a program,rather than its actual
needs.
在资源分区方式中,操作系统预先决定把哪些资源分配给某个用户计算使用,这种方法也称为静态分配,因为分配是在程序执行前进行的。静态资源分配易于实现,但由于它不是从程序的实际需要出发,而是根据程序预先提出的需求来做决定,所以容易导致系统利用率下降。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-11
In the latter approach,the OS maintains a common pool of
resources and allocates from this pool on a need basis,Thus,
OS considers allocation of a resource when a program raises a
request for a resource,This approach is called dynamic
allocation because the allocation takes place during the
execution of a program,Dynamic resource allocation can lead
to better utilization of resources because the allocation is made
when a program requests a resource.
在后一种分配方式中,操作系统维护一个公共资源池,并按照程序的需要对资源进行分配。这样,OS只在程序提出对一个资源的需求时才进行资源分配,这种方式也称为动态分配,因为分配是在程序执行的过程中进行的。动态存储分配的资源利用率较高,因为它是在程序需要资源时才进行分配。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-12
An OS can use a resource table as the central data structure
allocation,The table contains an entry for each resource unit in
the system,The entry contains the name or address of the
resource unit and its present status,i.e,whether it is free or
allocated to some program,When a program raises a request
for a resource,the resource would be allocated to it if it is
presently free,If many resource units of a resource class exist
in the system,a resource request only indicates the resource
class and the OS checks if any resource unit of that class is
available for allocation.
操作系统可以利用资源表作为资源分配的中心数据结构。表中包含系统的每一资源单位项数据项中记录资源单位的名称或地址以及当前状态,即它是空闲的还是己经分配给某一程序。当程序对某一资源提出请求后,若该资源是空闲的,则它将被分配给那个程序。若系统中同一资源类中存在许多资源单位,程序的资源请求只指明要求哪类资源而由操作系统检查该类中是否有可用的资源单位可以分配。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-13
In the partitioned resource allocation approach,the OS decides
on the resources to be allocated to a program based on the
number of resources and the number of programs in the
system,For example,an OS may decide that a program can be
allocated 1 MB of memory,2000 disk blocks and a monitor.
Such a collection of resources is referred to as a partition,In
effect,a set of partitions can be predefined in the system,The
resource table can have an entry for each resource partition.
When a new program is to be started,an available partition is
allocated to it.
在资源分区分配中,操作系统依据系统中的资源数目和程序数目决定如何进行资源分配。例如,操作系统可能会决定一个程序可以使用 1MB内存、
20O0个磁盘块及 1个监视器,这一系列资源可以作为一个分区。系统可以提前定义出一系列这样的区,资源表中为每一资源区保存相应的数据项。当新的程序开始时将分配给它一个可用的分区。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-14
Resource preemption
There are different ways in which resource can be shared by a
set of programs,Some of these are:
Sequential sharing
Concurrent sharing
资源抢占资源被一系列程序分享可以有多种不同的方式,如:
串行共享
并行共亨
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-15
In sequential sharing,a resource is allocated for exclusive use
by a program,When the resource is de-allocated,it is marked
free in the resource table,Now it can be allocated to another
program,In concurrent sharing,two or more programs can
concurrently use the same resource,Examples of concurrent
sharing are data files,Most other resources cannot be shared
concurrently,Unless otherwise mentioned,all through this text
resources are assumed to be only sequentially shareable.
在串行共享中,一个资源只能分配给一个程序,当资源被释放后,它在资源表中被标记为“空闲”,这时它才能被分配给下一个程序。在并行共亨中,两个以上的程序可以同时使用同样的资源。并行共享的例子是数据文件,其他资源通常不能被并行共享。在本文中以后若无特殊说明,所有资源都被假设为只能串行共享。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-16
When a resource is sequentially shareable,the system can de-
allocate a resource when the program makes an explicit request
for de-allocation,Alternatively,it can de-allocate a resource by
force,This is called resource preemption,that is,forceful de-
allocation of a resource.
当资源可以串行共享时,系统可以在程序明确地提出释放分配的请求后,对资源进行释放。或者,系统也可强行释放资源,
这称为资源抢占。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-17
Preemption of system resources is used by the OS to enforce
fairness in their use by programs,or to realize certain system
level goals,A preempted program cannot execute unless the
preempted resource unit,or some other resource unit pi' the
same resource class,is allocated to it once again,The shorter
term preemption is used preemption of the CPU,and the full
term resource preemption is used for preemption of other
resources.
资源抢占是能指强行释放资源。操作系统依靠对系统资源的抢占确保程序对资源的平等利用,或实现一些系统级的目标。对于资源被抢占的程序来说,除非把被抢占的资源单位或同一资源类的其他资源单位重新分配给它,否则无法继续执行。我们称抢占 CPU为抢占,而称抢占其他资源为资源抢占。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-18
CPU sharing
The CPU can be shared in a sequential manner only,Hence only one
program can execute at any time,Other programs in the system have
to wait their turn,It is often important to provide fair service to all
programs in the system,Hence preemption is used to free the CPU so
that it can be given to another program,Deciding which program
should be given the CPU and for how long is a critical function,This
function is called CPU Scheduling,or simply scheduling,Partitioning
is a bad approach for CPU Sharing,allocation from a pool is the
obvious approach to use.
CPU共享
CPU只能串行共享,因此它一次只能执行一个程序,其他程序必须依次等待。
通常情况下,系统会要求平等对待所有的程序,用抢占来释放 CPU以执行其他程序。因此决定该执行哪个程序并执行多长时间是一个十分重要的功能,这一功能被称为 CPU调度或简称调度。显然,资源分区不适用于 CPU
共享,同此,从资源池中分配成为惟一的选择。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-19
Memory sharing
Like the CPU,the memory also cannot be shared concurrently,
However,unlike the CPU,its availability can be increased by
treating different parts of memory as different resources,Both the
partitioning and the pool-based allocation approaches can be used to
manage the memory resource,Memory preemption can also be used
to increase the availability of memory to programs,Special terms are
used for different memory preemption techniques,hence the term
“memory preemption” is rarely used in our discussions.
存储器共享和 CPU一样,存储器也不能并行共享。但与 CPU不同的是,可以把存储器的不同部份看作不同的资源,因此可以增加它的可用性。资源分区和基于资源池的分配方式都适用于存储器资源管理。存储器抢占也可用于提高程序对存储器的可用性,但由于对不同的存储器抢占技术都有专用术语,故在本书很少使用“存储器抢占”的说法。
5.1.1 Resource allocation and related functions
Chapter 5 Operating System
计算机专业英语 5-20
The purpose of a user interface is to provide for the use of OS
resources,primarily the CPU,for processing a user's
computational requirements,OS user interfaces typically use
command languages,The user uses a command to set up an
appropriate computational structure to fulfill a computational
requirement.
用户接口的目的是为用户提供使用操作系统资源 (主要是 CPU)
的接口来完成用户的计算请求。操作系统用户接口一般使命令语言,用户通过命令建方合适的计算结构以满足计算要求。
5.1.2 User interface related functions
Chapter 5 Operating System
计算机专业英语 5-21
A variety of computational structures can be defined by an OS,
A sample list of computational structures is as follows,
1,A single program
2,A sequence of single programs
3,A collection of programs.
不同的计算结构可由操作系统决定。计算结构举例如下:
1,单一程序
2,单一程序的序列
3,程序集合
5.1.2 User interface related functions
Chapter 5 Operating System
计算机专业英语 5-22
These computational structures will be defined and described in
later chapters; here we only point out a few salient features,It is
assumed that each program is individually initiated by the user
through the user interface,The single program consists of the
execution of a program on a given set of data,The user initiates
execution of the program through a command,Two kinds of
programs can exist sequential and concurrent,A sequential
program,which matches with the conventional notion of a
program,is the simplest computational structure.
以上这些计算结构将在以后各章中定义和描述,此处只指出一些简单的特征。
例如每个程序都是由用户通过用户接口分别进行初始化的,单一程序是由在给定的数据集上的一个程序执行组成的,用户通过命令启动程序。 程序可以分为两种:顺序的和并发的。 顺序程序符合传统的程序概念,是最简单的计算结构。
5.1.2 User interface related functions
Chapter 5 Operating System
计算机专业英语 5-23
In a concurrent program,different parts of the program can
execute concurrently,For this,the OS has to be aware the
identities of the different parts which can execute concurrently.
This function is typically not served by the user interface of the
OS,In this chapter it is assumed that each program is
sequential in nature.
而在并发程序中,程序的不同部分可被同时执行。为此,操作系统需要了解这些可以同时执行的不同部分的实体,操作系统的用户接口通常不支持这一功能。在本章中,假设所有的程序都是顺序执行的。
5.1.2 User interface related functions
Chapter 5 Operating System
计算机专业英语 5-24
In a sequence of programs,each program is initiated by the
user individually,However,the programs are not independent
of each other---executing of a program is meaningful only if the
previous programs in the sequence execute successfully.
However,since the programs are initiated individually,their
interface with one another is set up explicitly by the user.
在一个程序序列中,每个程序是由用户单独启动的,但程序之间并非相互独立,只有当前一程序执行成功后,下一个程序的执行才有意义,但由于程序是独立启动的,它们之间相互的接口由用户明确设定。
5.1.2 User interface related functions
Chapter 5 Operating System
计算机专业英语 5-25
In a collection of programs,the user names the programs
involved in the collection in his command,Thus,their identities
are indicated to the OS through the user interface itself,The
interface between the programs is handled by the OS.
在程序集合中,用户在其命令中为集合中涉及的程序命名。由此它们将通过用户接口被操作系统识别,程序间的接口由操作系统处理。
5.1.2 User interface related functions
Chapter 5 Operating System
计算机专业英语 5-26
New Words & Expressions:
inherent adj.固有的,内在的,与生俱来的
execute vt.执行,实行,完成
Pascal n.〈 计 〉 PASCAL语言
compilation n.编辑,汇编
bat abbr.[计 ] 批处理文件的扩展名
script n.脚本,UNIX(命令 )过程
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-27
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,新的用户需求。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-28
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.
不同操作系统采取不同的方法处理这些问题,但几乎所有的操作系统都拥有一些功能相似的部分,如存储器管理、进程管理和用户保护。尽管不同的操作系统采取的具体技术不同,但其基本概念是一致的。由于它们之间的相似性才使我们可以对其进行研究。因此,只需学习操作系统设计的基本概念及一些操作系统实现的实例,即可了解操作系统原理,而不用学习大量的操作系统。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-29
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.
本章我们将通过学习操作系统功能的演化和认识操作系统在实现过程中采用的基本概念与技术,了解操作系统设计中的概念,还将介绍一些概念和相关术语的正式定义。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-30
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,
作业、程序和进程操作系统的基本功能是在计算机系统中组织用户计算的执行。因此它在设计中要求对用户计算有恰当的特征描述。通常在用户计算中使用以下三种特征记述 ——作业、程序和进程。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-31
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.
程序是计算的传统观点,它由一系列程序单元构成,包括从库中获取的程序单元,并组成可执行的目标代码。 进程是一个程序或一个程序部分的一次执行。在应用并行编码技术时,许多进程可以执行同一程序或其一部分,这时进程与程序是不同的。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-32
Jobs,programs and processes
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程序进行编译和执行的作业包括以下三步:
用编译程序对程序进行编译,用链接程序准备对编译好的程序的执行,以及执行刚刚链接好的目标程序。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-33
Jobs,programs and processes
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脚本。
5.2 Evolution of OS Function
Chapter 5 Operating System
计算机专业英语 5-34
New Words & Expressions
interrupt vt.& n.中断 bulk n,成批,大量,整体
monolithic adj.整体式的,一致的 ;n.单片 share vt.& n.共享
segregate v.隔离 interact vi.互相作用,互相影响
kernel n.核心,内核 invoke v.调用
process scheduling 过程调度 virtual adj.虚拟的
interprocess adj.进程间的 recovery n.恢复
initiation n.开始,初始化 microkernel n.微核
portability n.可移植性 extensibility n.可延长性,展开性
stratify vt,分层,层化 hierarchy n.层次,层级
detract v.转移 devise vt.设计,发明,图谋,作出
not-so-small 并不十分小 real time 实时
interpretation n.解释,阐明,口译,通译 QNX 一种操作系统
Mach 一种采用微内核技术的 UNIX操作系统
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-35
OS design strongly depends on two factors,architectural
features of the computer on which it operates,and features of
its application domain,Dependence on architectural features is
caused by the need to exercise complete control over all
functional units of the system,Hence,the OS needs to know
the addressing structure,interrupt structure,IO organization
and memory protection features of the computer system.
操作系统的设计主要基于以下两个因素:它所操作的计算机的结构特征及它的应用域特征。对结构特征的依赖是由对系统的所有功能单位进行完全控制的需要而产生的。因此,操作系统需要了解计算机系统的地址结构、中断结构,I/O体系结构及存储器保护特性。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-36
OS policies typically depend on its application domain,For
example,the CPU scheduling policy depends on whether the
OS will be used for time sharing,or for real time applications.
The dependence on these two factors poses obvious difficulties
in using an OS on computers with different architectures and
different application domains.
操作系统的策略通常由它的应用域决定:例如,CPU的调度策略是由操作系统是用于分时应用还是实时应用来决定。对这两方面因素的依赖导致在不同应用域中的不同结构的计算机上使用同一操作系统的巨大困难。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-37
Consider the development of an OS for a similar application
domain on two computer systems Cl and C2,These two OSs
differ in terms of architecture specific OS code,Remainder of
the code,which forms the bulk of the total OS code,does not
have any architectural dependencies,
考虑设计一个操作系统,使它能应用于在相似的应用域中的两个计算机系统 C1和 C2上。下面的两个操作系统与结构相关的操作系统代码有所不同,其余的大部分操作系统代码都与结构无关。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-38
It would be tempting to consider development of the OS for cl
and c2 in the following manner:
1,Develop the OS for computer system Cl,Let this be called
OS1.
2,Modify OS1 to obtain the OS for computer system C2,i.e,
OS2.
That is,OS2 is obtained by porting OS1 to C2.
则可以考虑采用以下方式开发用于 Cl和 C2的操作系统:
1,设计用于计算机系统 Cl的操作系统,设其为 OS1。
2,把 OS1修改为能在计算机系统 C2上使用的操作系统,
也就是说,OS2是通过把 OS1移植到 C2上得到的。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-39
In early operating systems,this approach faced several
difficulties due to the monolithic structure of the OS,Thus,
OSs did not provide clean interfaces between the architecture
specific and architecture independent parts of their code,
Hence the total porting effort was determined by the total size
of OS code,rather than by the size of its architecture specific
part,Historically,this difficulty has been addressed by
developing an OS structure which separates the architecture
specific and architecture size of its architecture specific parts
of an OS,
由于早期的操作系统均是整体结构,这就给这种方式的实施造成了困难。因为操作系统并没有为结构相关的及结构无关的代码之间提供正确的接口,因此移植工作就要涉及全部的操作系统代码,而不是其中只和结构相关的部分。历史上,这一困难是通过设计一种把结构相关的部分与结构无关的部分分开的操作系统结构来克服的。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-40
This enables OSs for different computer systems to share much of their
design,When OSs are coded in a high level language,this even permits
code sharing across OSs,To see how the separation of architecture specific
and architecture independent parts can be implemented,consider the
nature of a typical OS component,The component governs a class of
resources,e.g,the processor(s) of the computer system,its memory,etc,
Resource control actions of the module can be classified into
1,Policies governing the use of resources.
2,Mechanisms to implement the policy.
这样可以使不同计算机系统的操作系统分享大部分的设计。若操作系统是用高级语言编写的,则不同的操作系统之间甚至可以共享代码。为理解与结构相关的部分和与结构无关的部分是如何分开的,我们考虑一下一个典型操作系统组件的特性。每个组件都管理一类资源,如引算机的处理器和存储器等。模块的资源控制动作可以分为:
1,控制资源使用的策略。
2,执行策略的机制。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-41
Policies are usually architecture independent,while
mechanisms are often architecture dependent,Hence the
policy routines and mechanisms should be segregated to
achieve separation of the architecture specific and architecture
independent parts of OS,Figure 5-1 shows an OS structure
which separates the architecture specific and architecture
independent parts into two modules.
策略通常是与结构无关的,而机制通常是与结构相关的。因此,
为使与结构相关的部分和与结构无关的部分分开,策略例程序与机制分开。图 5-1显示了一个把与结构相关的部分及与结构无关的部分分成两个模块的操作系统结构。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-42
The module containing the policy routines is architecture
independent and the part containing the mechanisms is
architecture specific,The policy routines invoke the
mechanisms as and when necessary,Such an OS can be ported
to a new computer system by rewriting the mechanisms
module for the new system,and integrating it with the policy
module.
包含策略例程的模块是与结构无关的,而包含机制的模块是与结构相关的,策略例程只在必要的情况下才使用机制。这样的操作系统只重写机制模块就可以与策略模块结合,移植到新的系统上。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-43
The structuring principle shown in Fig.5-1 is implemented
using the layered organization shown in Fig.5-2 which is based
on the notion of extended machines,Each software layer
enhances the capabilities of the architecture by adding new
features,In effect,it elevates the architectural interface closer
to the user interface,For example,the lowest layer offers a
machine which has in-built mechanisms for scheduling,
memory management and I/O control,This simplifies the
functioning of the layer above it.
图 5-1所示的结构原理是由图 5-2所示的基于扩展机概念的分层结构实现的。
每个软件层都通过添加新特性来扩展结构的性能。实际上,这使得结构接口更接近于用户端口。例如最底层提供了一个内置的调度、存储器管理及
I/O控制机制的机器,这就简化了上面各层的功能。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-44
Mech an is ms
Policies
U s er I n terface
Kern el
N on - Kern el Mod u les
U s er I n terface
Fig.5-1 Structure of an OS Fig,5-2 OS layers
Chapter 5 Operating System
计算机专业英语 5-45
Each layer only communicates with the adjoining layers
through well defined interfaces,Thus,a user command may
percolate through the layers to reach the lowest layer which
directly interacts with the architecture,This layer is called the
OS kernel,Many modem OSs,particularly Unix,use such OS
structure,The porting effort of such an OS is determined by
the size of the OS kernel.
每层只需通过定义好的接口与相邻的层通信。因此,用户的指令可以透过各层直接达到与结构直接交互的最底层,这一层又称为操作系统内核。许多现代的操作系统,特别是 Unix,
都使用这种结构。这种操作系统的移植难度大小只由系统内核的大小决定。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-46
OS kernel
The typical mechanisms contained in the OS kernel are listed
in Table 5-1,The kernel gets control when
1,An exceptional situation arises in the system.
2,An OS policy module explicitly invokes a kernel mechanism.
操作系统内核系统内核中包含的一般机制在表 5-1中列出,内核在下列情况下获得控制权:
1,系统小出现异常情况,
2,一个操作系统策略模块明确地激活一个内核机制。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-47
OS kernel
In the former case,the entry is through the interrupt
processing mechanism which senses the occurrence of a
hardware interrupt,In the latter case,the OS policy module
typically transfers control to the kernel through a software
interrupt,Thus,in either case the entry to the kernel is
through the interrupt processing mechanism,For this reason,
the OS kernel is often said to be interrupt-driven.
在前一种情况下,控制是通过一个负责感知硬件中断的中断处理机制传递的。在后一种情况下,操作系统的策略模块通常会通过 —个软件中断来把控制交给内核。因此,无论在哪种情况下都是通过中断处理机制进入内核。因此,系统内核常被称为
“中断驱动的”。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-48
OS kernel
Many well-known OS kernels include functionalities not
shown in Table 5-1,for example,process scheduling,device
drivers,core file system services and certain memory
management functions,This simplifies the writing of non-
kernel software,However,it tends to detract from the porting
advantages of the kernel based OS structure.
许多著名操作系统的内核包含一些并未在表 5-1中列出的功能。
如过程调度、设备驱动程序、核心文件系统服务及一些存储器管理功能。这样可以简化非内核软件的编程,但也削弱了基于内核的操作系统结构的移植优势。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-49
OS microkernels
The notion of microkernels was developed in the early 1990's to
enhance the portability,extensibility and reliability of operating
systems,The primary motivation for a microkernel arises from
disadvantages of the layered OS model based on kernels,The
main problem with the layered model is that every OS
functionality is stratified into a hierarchy of layers,Thus,every
part of the functionality is subject to the constraints imposed by
the interface of the OS layer to which it belongs.
操作系统微内核微内核的概念是在 90年代初期为了提高操作系统的可移值性、可扩充性和可靠性而出现的。微内核出现的主要原因是出于是于内核的分层操作系统模型存在缺陷,主要是操作系统的每个功能部件都被分成了一系列层。因此功能组件的每部分都受到它所属层接口的限制
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-50
OS microkernel
Problems with the layered OS model can be summarized as follows,The OS
kernel has the potential to offer good portability,However it may also contain
architecture independent code,which detracts from the goal of portability,The
layered architecture of the kernel-based design offers poor extensibility,This is
due to the fact that addition of a new functionality requires changes in the
interfaces of many OS layers,e.g,new software interrupts have to be devised to
activate the code located in the kernel,The reliability of the kernel may be poor
because of its not-so-small size,The kernel supports a large number of calls,
many of which are infrequently used,Their implementations across different
versions of the kernel are likely to be unreliable.
分层操作系统的问题可被总结如下:系统内核有潜力提供良好的可移值性,但它同样包含与结构无关的代码,而这恰恰削弱了可移植性。基于内核的分层结构设计的可扩充性很差,这是由于添加新的功能组件意味着需要更改许多层的接口,即需要设计新的软件中断来激活内核中的代码。内核的可靠性不高,因为它并不十分小。内核支持许多的调用,但其中有很多并不常用。所以它们在不同版本的内核间的实现是很不可靠的。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-51
OS microkernel
The OS microkernel is an essential core of the OS code,It
provides the minimal functionalities necessary to support
architecture independent code,It does not provide a layered
interface,instead it supports a few well documented OS calls,This
enhances the portability and reliability in an obvious manner.
操作系统微内核是操作系统代码中的重要核心,它提供了支持与结构无关的代码所必需的最小功能组件。它不支持分层接口,而是支持一些有良好文档定义的 OS调用。这显然增强了可移植性和可靠性。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-52
OS microkernel
Extensibility is enhanced because many components previously
considered to be parts of the OS kernel,e.g,process scheduling,
now reside outside it in the OS,These components can be replaced
at will to modify or extend the OS behaviour,It is thus possible to
use the same microkernel to implement time sharing or dedicated
real time systems,This simplifies the development of an OS for a
new application domain.
由于以前被认为是内核一部分的组件 (如进程调度 )现在被放在内核之外,因此可扩充性也增强了。如果想修改或扩展系统性能,可以通过替换这些组件实现,可以使用同一个微内核来实现分时或实时系统,这简化了在新的应用域中对操作系统的开发。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-53
OS microkernel
It is to be noted that microkernel designs vary greatly due to
different interpretations of the term 'essential core of OS code'.
Variations mainly concern the location of the process scheduler
and the device drivers within the OS,For example,the Mach
microkernel by IBM leaves the process scheduling policy and the
device drivers outside the kernel while certain other microkernels
include both these features.
应当注意,微内核的设计会因为对“操作系统代码的重要核心”的不同解释而大相径庭。差异主要集中在系统内的进程调度程序和设备驱动程序的位置,例如 IBM的 Mach微内核就不包括过程调度策略和设备驱动程序,而其他一些微内核则包括这两项特性。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-54
OS microkernel
Some well-known microkernels include the QNX kernel which is
only 8K bytes in size and includes process scheduling,interrupt
handling,interprocess communication and core network services.
一些知名的微内核包括一个只有 8Kb大小,但包含过程调度、
中断处理、进程间通信及核心网络服务的 QNX内核。
5.3 OS Structure
Chapter 5 Operating System
计算机专业英语 5-55
被动语态的翻译技巧一、翻译成汉语的主动句
1、英语原文中的主语在译文中仍做主语在采用此方法时,我们往往在译文中使用“加以”,“经过”,
“用 … 来”等词来体现原文中的被动含义。
例 1,Other questions will be discussed briefly.
其他问题将简单地加以讨论 。
例 2,In other words mineral substances which are found on
earth must be extracted by digging,boring holes,artificial
explosions,or similar operations which make them available to
us.
换言之,矿物就是存在于地球上,但须经过挖掘、钻孔、人工爆破或类似作业才能获得的物质。
Chapter 5 Operating System
计算机专业英语 5-56
被动语态的翻译技巧一、翻译成汉语的主动句
2,将英语原文中的主语翻译为宾语,同时增补泛指性的词语
(人们,大家等 )做主语例 1,It could be argued that the radio performs this service as
well,but on television everything is much more living,much
more real,
可能有人会指出,无线电广播同样也能做到这一点,但还是电视屏幕上的节目要生动、真实得多。
下列的结构也可以通过这一手段翻译,
It is asserted that … 有人主张 ……
It is believed that … 有人认为 ……
It is generally considered that … 大家 (一般人 )认为
It is well known that … 大家知道 (众所周知 )……
It will be said … 有人会说 ……
It was told that … 有人曾经说 ……
Chapter 5 Operating System
计算机专业英语 5-57
被动语态的翻译技巧一、翻译成汉语的主动句
3,将英语原文中的 by,in,for等做状语的介词短语翻译成译文的主语,而英语原文中的主语一般被翻译成宾语。
例,And it is imagined by many that the operations of the
common mind can be by no means compared with these
processes,and that they have to be acquired by a sort of special
training,
许多人认为,普通人的思维活动根本无法与科学家的思维过程相比,而且认为这些思维过程必须经过某种专门的训练才能掌握。
Chapter 5 Operating System
计算机专业英语 5-58
被动语态的翻译技巧一、翻译成汉语的主动句
4、翻译成汉语的无主句例,Many strange new means of transport have been developed
in our century,the strangest of them being perhaps the
hovercraft,
在我们这个世纪内研制了许多新奇的交通工具,其中最奇特的也许就是气垫船了。
It is hoped that … 希望 ……
It is reported that … 据报道 ……
It is said that … 据说 ……
It is supposed that … 据推测 ……
It may be said without fear of exaggeration that … 可以毫不夸张地说 …
It must be admitted that … 必须承认 ……
It must be pointed out that … 必须指出 ……
It will be seen from this that … 由此可见 ……
Chapter 5 Operating System
计算机专业英语 5-59
被动语态的翻译技巧一、翻译成汉语的主动句
5、翻译成带表语的主动句例 1.The decision to attack was not taken lightly,
进攻的决定不是轻易做出的。
例 2,On the whole such an conclusion can be drawn with a
certain degree of confidence,but only if the child can be
assumed to have had the same attitude towards the test as the
other with whom he is being compared,and only if he was not
punished by lack of relevant information which they possessed.
总的来说,得出这种结论是有一定程度把握的,但必须具备两个条件:能够假定这个孩子对测试的态度和与他比较的另一个孩子的态度相同 ; 他也没有因为缺乏别的孩子已掌握的有关知识而被扣分。
Chapter 5 Operating System
计算机专业英语 5-60
常用英汉互译技巧二、译成汉语的被动语态英语中的许多被动句可以翻译成汉语的被动句。常用“被”,
“给”,“遭”,“挨”,“为 …… 所”,“使”,“由 …”,,受到”等表示。
例 1,These signals are produced by colliding stars or nuclear
reactions in outer space.
这些讯号是由外层空间的星球碰撞或者核反应所造成的 。
例 2,Over the years,tools and technology themselves as a
source of fundamental innovation have largely been ignored by
historians and philosophers of science.
工具和技术本身作为根本性创新的源泉多年来在很大程度上被科学史学家和科学思想家们忽视了。