1.1Applied Operating System Concepts
1,Introduction 引论
What is an operating system?什么是操作系统?
Simple Batch Systems简单批处理系统
Multiprogramming Batched Systems多道程序批处理系统
Time-Sharing Systems分时系统
Personal-Computer Systems 个人计算机系统
Parallel Systems并行系统
Distributed Systems分布式系统
Real -Time Systems实时系统
1.2Applied Operating System Concepts
What is an Operating System?什么是操作系统?
A program that acts as an intermediary between a user of a
computer and the computer hardware.
在计算机用户和计算机硬件之间起媒介作用的一种程序。
Operating system goals,操作系统目标
– Execute user programs and make solving user
problems easier.
执行用户程序并使用户问题更易解决。
– Make the computer system convenient to use.
使计算机系统更易使用。
Use the computer hardware in an efficient manner.
以一种效率的方式使用硬件。
1.3Applied Operating System Concepts
Computer System Components计算机系统部件
1,Hardware硬件 – provides basic computing resources (CPU,
memory,I/O devices).提供基本的运算资源
2,Operating system操作系统 – controls and coordinates the use of
the hardware among the various application programs for the
various users.在各种应用程序和用户之间控制与协调对硬件的使用
3,Applications programs 应用程序 –define the ways in which the
system resources are used to solve the computing problems of
the users (compilers,database systems,video games,business
programs).定义解决用户问题的资源使用方式(编译、数据库、视频游戏、事务程序等)
4,Users (people,machines,other computers)用户(人、机、其他计算机),
1.4Applied Operating System Concepts
Abstract View of System Components
系统部件的抽象观点
1.5Applied Operating System Concepts
Operating System Definitions操作系统定义
Resource allocator资源分配者 – manages and allocates
resources.管理和分配资源
Control program控制程序 –controls the execution of user
programs and operations of I/O devices,控制用户程序的运行和 I/O设备的操作
Kernel 内核 – the one program running at all times (all else
being application programs).在全时运行的一个程序(其他的是应用)
1.6Applied Operating System Concepts
Simple Batch Systems简单批处理系统
Hire an operator雇一个操作员
User? operator用户?操作员
Add a card reader添加卡片阅读机
Reduce setup time by batching similar jobs批量处理同类作业减少了设置时间
Automatic job sequencing 自动作业调度 –automatically transfers
control from one job to another,First rudimentary operating system.
自动把控制从一个作业转到另一个作业。第一个基本操作系统。
Resident monitor常驻管理程序
– initial control in monitor 初始化 管理程序
– control transfers to job 转换控制到作业
– when job completes control transfers back to monitor作业完成后转换控制回管理程序
1.7Applied Operating System Concepts
Memory Layout for a Simple Batch System
简单批处理系统的存储器布局
1.8Applied Operating System Concepts
Control Cards作业控制卡
Problems问题
1,How does the monitor know about the nature of the job (e.g.,
Fortran versus Assembly) or which program to execute?
管理程序如何知道作业的性质(如,Fortran还是汇编)或哪个程序要运行?
2,How does the monitor distinguish管理程序如何区别
(a) job from job?一个个的作业?
(b) data from program?数据还是程序?
Solution解法
– Introduce control cards引入作业控制卡
1.9Applied Operating System Concepts
Control Cards作业控制卡 (Cont.)
Special cards that tell the resident monitor which programs
to run特殊卡片通知管理程序哪个程序运行
$JOB
$FTN
$RUN
$DATA
$END
Special characters distinguish control cards from data or
program cards特定的字符把数据卡片和程序卡片区分开来,
$ in column 1
// in column 1 and 2
709 in column1
1.10Applied Operating System Concepts
Control Cards作业控制卡 (Cont.)
Parts of resident monitor常驻管理程序的一部分
– Control card interpreter – responsible for reading and carrying
out instructions on the cards.控制卡片解释器 - 负责读出和执行卡上的指令
– Loader – loads systems programs and applications programs
into memory.装载程序 - 把系统程序和应用程序调入内存
– Device drivers – know special characteristics and properties for
each of the system’s I/O devices.设备驱动程序 - 了解系统每一个
I/O设备的特点和性质
Problem,Slow Performance – I/O and CPU could not overlap ; card
reader very slow.问题:慢 - I/O和 CPU不可能彼此覆盖;卡片阅读器很慢
Solution,Off-line operation – speed up computation by loading jobs
into memory from tapes and card reading and line printing done off-
line.解决:脱机操作 - 从磁带和卡片调作业进入内存,而打印机脱机,加速运算
1.11Applied Operating System Concepts
Spooling
Overlap I/O of one job with computation of another job,
While executing one job,the OS.
一个作业的 I/O 同另一个作业的运算彼此重叠。在执行一个作业时,OS。
– Reads next job from card reader into a storage area on
the disk (job queue).从卡片上把下一个作业读入磁盘存储区(作业队列)
– Outputs printout of previous job from disk to printer.从磁盘到打印机输出先前的作业
Job pool 作业池 –data structure that allows the OS to select
which job to run next in order to increase CPU utilization,一种允许操作系统选择运行作业的数据结构,用以提高 CPU利用率
1.12Applied Operating System Concepts
Multiprogrammed Batch Systems
多道程序批处理系统
Several jobs are kept in main memory at the same time,and the
CPU is multiplexed among them,
在主存中同时有若干个作业,CPU在其中多重切换。
1.13Applied Operating System Concepts
OS Features Needed for Multiprogramming
多道程序对 OS特点的要求
I/O routine supplied by the system.
系统提供 I/O程序
Memory management存储管理 –the system must allocate the
memory to several jobs.系统必须为若干作业分派空间
CPU scheduling CPU调度 – the system must choose among
several jobs ready to run.系统必须在就绪作业中挑选
Allocation of devices.
设备分配
1.14Applied Operating System Concepts
Time-Sharing Systems–Interactive Computing
分时系统 -交互式计算
The CPU is multiplexed among several jobs that are kept in memory
and on disk (the CPU is allocated to a job only if the job is in memory).
对保存在内存和磁盘上的若干作业之间多路( CPU被分配给某个作业仅当该作业在内存)
A job is swapped in and out of memory to the disk.作业在内存和磁盘之间被对换
On-line communication between the user and the system is provided;
when the operating system finishes the execution of one command,it
seeks the next,control statement” not from a card reader,but rather
from the user’s keyboard.提供用户和系统之间的在线通信;操作系统完成了一条命令的执行后,它不从卡片阅读机上而是从用户键盘上寻找下一条控制语句
On-line system must be available for users to access data and code.
在线系统必须使用户能够访问数据和代码
1.15Applied Operating System Concepts
Personal-Computer Systems
个人计算机系统
Personal computers – computer system dedicated to a single user.
个人计算机 - 供个人使用的计算机系统
I/O devices – keyboards,mice,display screens,small printers.
I/O设备 - 键盘、鼠标、显示、小型打印机
User convenience and responsiveness.便利用户和响应
Can adopt technology developed for larger operating system’ often
individuals have sole use of computer and do not need advanced
CPU utilization of protection features.
可采用大型操作系统研发的技术,个人独占计算机不需要高级 CPU使用的保护技术
1.16Applied Operating System Concepts
Migration of Operating-System Concepts and Features
操作系统概念和特性的变迁
1.17Applied Operating System Concepts
Parallel Systems并行系统
Multiprocessor systems with more than one CPU in close
communication.有紧密通信的、多于一个 CPU的多处理器系统
Tightly coupled system – processors share memory and a clock;
communication usually takes place through the shared memory.
紧偶合系统 - 处理器共享内存和时钟;一般通过共享内存进行通信
Advantages of parallel system,并行系统的优点
– Increased throughput增大吞吐量
– Economical 经济
– Increased reliability提高可靠性
graceful degradation( 有故障时)优雅的降低性能
fail-soft systems( 又称)软失效系统
1.18Applied Operating System Concepts
Parallel Systems并行系统 (Cont.)
Symmetric multiprocessing (SMP)对称多处理 器
– Each processor runs an identical copy of the operating system.
每个处理器运行操作系统的相同副本
– Many processes can run at once without performance
deterioration.许多进程可以立即运行不会降低性能
– Most modern operating systems support SMP多数现代操作系统支持 SMP
Asymmetric multiprocessing非对称多处理器
– Each processor is assigned a specific task; master processor
schedules and allocates work to slave processors.每个处理器赋予一个特定任务;主处理器为从处理器调度和分配作业
– More common in extremely large systems常用在非常大的系统中
1.19Applied Operating System Concepts
Symmetric Multiprocessing Architecture
对称多处理器体系结构
1.20Applied Operating System Concepts
Real-Time Systems实时系统
Often used as a control device in a dedicated application such as
controlling scientific experiments,medical imaging systems,industrial
control systems,and some display systems.通常作为控制设备在诸如控制科学实验、医学影象系统、工业控制系统以及一些显示系统中应用
Well-defined fixed-time constraints.严格确定的时间限制
Hard real-time system.硬实时系统
– Secondary storage limited or absent,data stored in short-term
memory,or read-only memory (ROM)有限的或没有次级存储器,数据存在短期存储器或只读存储器中
– Conflicts with time-sharing systems,not supported by general-
purpose operating systems.同分时系统冲突,通用操作系统
Soft real-time system软 实时系统
– Limited utility in industrial control or robotics在工业控制或机器人中有部分应用
– Useful in applications (multimedia,virtual reality) requiring advanced
operating-system features.在需要高级操作系统 功能的应用(多媒体、虚拟现实)中应用
1.21Applied Operating System Concepts
Distributed Systems分布式系统
Distribute the computation among several physical processors.计算分布在若干物理处理器上
Loosely coupled system – each processor has its own local memory;
processors communicate with one another through various
communications lines,such as high-speed buses or telephone lines.
松散偶合系统 - 每个处理器有自身的本地存储器;通过各种通信设施,如高速总线、电话线等进行处理器之间的通信
Advantages of distributed systems.分布式系统的优点
– Resources Sharing 资源共享
– Computation speed up – load sharing 加快计算 - 共享装载
– Reliability可靠
– Communications通信
1.22Applied Operating System Concepts
Distributed Systems分布式系统 (Cont.)
Network Operating System网络操作系统
– provides file sharing 提供文件共享
– provides communication scheme提供通信机制
– runs independently from other computers on the network运行独立于网络上的其他计算机
Distributed Operating System分布式操作系统
– less autonomy between computers在计算机之间少了自治性
– gives the impression there is a single operating system
controlling the network.给出一种印象,有一个操作系统控制网络