《计算机专业英语》Operating System

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Computer English Chapter 5 Operating System
Key points:
F unction and structure of Operating System
Difficult points:
R esource allocation and related functions
U ser interface functions
Requirements:
1. 了解操作系统是如何实现资源分配和用户接口功能的。

2. 通过学习操作系统功能的演化,认识操作系统在实现过程中采用的基本概念与技术,了解操作系统设计中的概念。

3. 认识操作系统的结构,了解当前常见操作系统的特点
4. 掌握被动语态的翻译技巧。

5.1 OS Function
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
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
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.1 Resource allocation and related functions
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 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 Two popular strategies for resource allocation are:•Partitioning of resources
•Allocation from a pool
资源分配通常采取以下两种策略;
1. 资源分区。

2. 从资源池中分配。

5.1.1 Resource allocation and related functions
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
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
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
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 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
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
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 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
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 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.2 User interface related functions
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
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
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
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
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
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.2 Evolution of OS Function
New Words & Expressions:
inherent adj.固有的, 内在的, 与生俱来的execute vt.执行, 实行, 完成
Pascal n.〈计〉PASCAL语言compilation n.编辑, 汇编
bat abbr.[计] 批处理文件的扩展名script n.脚本,UNIX(命令)过程
5.2 Evolution of OS Function
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
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
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
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
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
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
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.3 OS Structure
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
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
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
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
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
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
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
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
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
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控制机制的机器,这就简化了上面各层的功能。

Mechanisms Policies
User Interface
Kernel
Non-Kernel Modules
User Interface Fig.5-1 Structure of an OS Fig. 5-2 OS layers
5.3 OS Structure
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
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
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
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
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
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.
分层操作系统的问题可被总结如下:系统内核有潜力提供良好的可移值性,但它同样包含与结构无关的代码,而这恰恰削弱了可移植性。

基于内核的分层结构设计的可扩充性很差,这是由于添加新的功能组件意味着需要更改许多层的接口,即需要设计新的软件中断来激活内核中的代码。

内核的可靠性不高,因为它并不十分小。

内核支持许多的调用,但其中有很多并不常用。

所以它们在不同版本的内核间的实现是很不可靠的。

相关文档
最新文档