




免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
操作系统作业1_1 翻译what is an operating system1.1 WHAT IS AN OPERATING SYSTEM?Most computer users have had some experience with an operating system, but it is difficult to pin down precisely what an operating system is. Part of the problem is that operating systems perform two basically unrelated functions, extending the machine and managing resources, and depending on who is doing the talking, you hear mostly about one function or the other. Let us now look at both.大多数计算机用户有一些作业系统的经验,但很难牵制正是一个操作系统。这个问题的部分原因是,作业系统执行两个基本无关的功能,延长机器和管理资源,以及是谁在说话,你听到的多半是一个函数或其他而定。现在让我们看看两者。1.1.1 The Operating System as an Extended MachineAs mentioned earlier, the architecture (instruction set, memory organization, I/O, and bus structure) of most computers at the machine language level is primitive and awkward to program, especially for input/output. To make this point more concrete, let us briefly look at how floppy disk I/O is done using the NEC PD765 compatible controller chips used on most Intel-based personal computers.如前所述,该架构(指令集,内存组织,我/ O和总线结构的大多数计算机)在机器语言水平是原始和笨拙的方案,特别是输入/输出。为了使这一点更具体,让我们简单地看一看软盘磁盘I / O是使用NEC PD765进行兼容控制器在大多数基于英特尔芯片的个人电脑使用的芯片。 (Throughout this book we will use the terms “floppy disk” and “diskette” interchangeably.) The PD765 has 16 commands, each specified by loading between 1 and 9 bytes into a device register. These commands are for reading and writing data, moving the disk arm, and formatting tracks, as well as initializing, sensing, resetting, and recalibrating the controller and the drives.(在本书中我们将使用术语“软盘”和“软盘”互换。)的PD765有16个命令,由1至9载入字节每个指定到一个设备寄存器。这些命令用于读取和写入数据,移动磁盘的手臂,和格式曲目,以及初始化,传感,复位,并重新调整了控制器和驱动器。The most basic commands are read and write, each of which requires 13 parameters, packed into 9 bytes. These parameters specify such items as the address of the disk block to be read, the number of sectors per track, the recording mode used on the physical medium, the intersector gap spacing, and what to do with a deleted-data-address-mark. If you do not understand this mumbo jumbo, do not worry; that is precisely the pointit is rather esoteric. When the operation is completed, the controller chip returns 23 status and error fields packed into 7 bytes. As if this were not enough, the floppy disk programmer must also be constantly aware of whether the motor is on or off. If the motor is off, it must be turned on (with a long startup delay) before data can be read or written. The motor cannot be left on too long, however, or the floppy disk will wear out. The programmer is thus forced to deal with the trade-off between long startup delays versus wearing out floppy disks (and losing the data on them).最基本的命令是读,写,每一个都需要13个参数,为9个字节包装。这些参数指定为磁盘的块地址等项目予以,每磁道的市场领域,在录音mode used上的物理介质,在intersector gap间距,以及如何处理与已删除- data -地址的马克。如果你不明白这怪诞的偶像,不要担心,这就是问题所在,它是相当深奥。当操作完成后,返回23控制器芯片领域的地位和错误包装成7个字节。仿佛这还不够,软盘程序员也必须不断电机是否知道或关闭。如果汽车是关闭,必须打开(用长启动延迟),然后数据可以被读取或写入。电动机不能离开太久,但是,或软盘将失效。程序员因此被迫处理与贸易之间的长时间的启动延迟起飞与磨损软盘(和失去对他们的数据)。Without going into the real details, it should be clear that the average programmer probably does not want to get too intimately involved with the programming of floppy disks (or hard disks, which are just as complex and quite different). Instead, what the programmer wants is a simple, high-level abstraction to deal with. In the case of disks, a typical abstraction would be that the disk contains a collection of named files. Each file can be opened for reading or writing, then read or written, and finally closed. Details such as whether or not recording should use modified frequency modulation and what the current state of the motor is should not appear in the abstraction presented to the user.The program that hides the truth about the hardware from the programmer and presents a nice, simple view of named files that can be read and written is, of course, the operating system. Just as the operating system shields the programmer from the disk hardware and presents a simple file-oriented interface, it also conceals a lot of unpleasant business concerning interrupts, timers, memory management, and other low-level features. In each case, the abstraction offered by the operating system is simpler and easier to use than that offered by the underlying hardware.如果没有进入真正的细节之前,应该明确指出,一般的程序员可能不希望太密切与编程的软盘(或硬盘,这也同样复杂,涉及完全不同)。相反,程序员要的是什么简单的,高层次的抽象处理。在磁盘的情况下,将是典型的抽象的磁盘包含一个名为文件的集合。每个文件可以打开阅读或书写,然后阅读或书写,并最终关闭。例如是否应该或不使用改装详细记录调频以及电机的当前状态是不应该出现的抽象呈现给用户。隐藏的程序对程序员从硬件真相,并提出一个不错的,名为可读写当然,操作系统文件的简单看法。正如屏蔽操作系统从磁盘硬件编程,并提出一个简单的文件型接口,它也掩盖了许多不愉快的有关业务中断,定时器,内存管理,以及其他低级别的功能。在每一种情况下,抽象由操作系统提供的简单,易于使用的底层硬件提供的。In this view, the function of the operating system is to present the user with the equivalent of an extended machine or virtual machine that is easier to program than the underlying hardware. How the operating system achieves this goal is a long story, which we will study in detail throughout this book. To summarize it in a nutshell, the operating system provides a variety of services that programs can obtain using special instructions called system calls. We will examine some of the more common system calls later in this chapter.这种观点认为,该操作系统的功能是展示用的一个扩展机或虚拟机更易于program equivalent用户不是底层的硬件。如何达到这个目标操作系统是一个漫长的故事,我们将详细研究在整个这本书。总结总括来说,作业系统提供各种各样的服务程序可以使用称为系统调用获得特别指示。我们将研究一些较常见的系统调用将在本章后面。1.1.2 The Operating System as a Resource ManagerThe concept of the operating system as primarily providing its users with a convenient interface is a top-down view. An alternative, bottom-up, view holds that the operating system is there to manage all the pieces of a complex system. Modern computers consist of processors, memories, timers, disks, mice, network interfaces, printers, and a wide variety of other devices. In the alternative view, the job of the operating system is to provide for an orderly and controlled allocation of the processors, memories, and I/O devices among the various programs competing for them.Imagine what would happen if three programs running on some computer all tried to print their output simultaneously on the same printer. The first few lines of printout might be from program 1, the next few from program 2, then some from program 3, and so forth. The result would be chaos. The operating system can bring order to the potential chaos by buffering all the output destined for the printer on the disk. When one program is finished, the operating system can then copy its output from the disk file where it has been stored to the printer, while at the same time the other program can continue generating more output, oblivious to the fact that the output is not really going to the printer (yet).作为主要的提供了一个方便的界面的用户操作系统的概念是一个自上而下的看法。另一种方法,自下而上,观点认为,这种操作系统是有管理的所有作品的一个复杂的系统。现代电脑的处理器组成,回忆,定时器,磁盘,鼠标,网络接口,打印机,以及其他各种设备。在另一种看法,该操作系统的工作是提供一个对处理器,内存分配秩序,控制和I /他们之间竞争的各种方案O设备。试想一下如果3个程序在某些计算机上运行的所有试图在同一台打印机上打印输出的同时。在打印头几行可能是从方案一,方案二从未来数,然后从方案三部分,等等。其结果将是一片混乱。操作系统可以带来秩序混乱的潜在缓冲所有的磁盘上的打印机输出目的地。当一个程序完成后,操作系统就可以复制其从磁盘上的文件如已存储到打印机输出,而在同一时间,其他程序能够继续创造更多的产出,无视这一事实,即输出是不真的到打印机(至今)。When a computer (or network) has multiple users, the need for managing and protecting the memory, I/O devices, and other resources is even greater, since the users might otherwise interfere with one another. In addition, users often need to share not only hardware, but information (files, databases, etc.) as well. In short, this view of the operating system holds that its primary task is to keep track of who is using which resource, to grant resource requests, to account for usage, and to mediate conflicting requests from different programs and users.Resource management includes multiplexing (sharing) resources in two ways: in time and in space. When a resource is time multiplexed, different programs or users take turns using it. First one of them gets to use the resource, then another, and so on. For example, with only one CPU and multiple programs that want to run on it, the operating system first allocates the CPU to one program, then after it has run long enough, another one gets to use the CPU, then another, and then eventually the first one again. Determining how the resource is time multiplexed who goes next and for how long is the task of the operating system. Another example of time multiplexing is sharing the printer. When multiple print jobs are queued up for printing on a single printer, a decision has to be made about which one is to be printed next.当一台计算机(或网络)有多个用户,管理和保护的存储器的需求,I / O设备,和其他资源的更大,因为用户可能会以其他方式干扰对方。此外,用户往往需要分享,不仅硬件,但信息(文件,数据库等),以及。总之,这种操作系统观点认为,其首要任务是了解谁在使用哪些资源,给予资源请求,占使用量,并从不同的程序和调解冲突的用户要求。资源管理包括两个方面多路复用(共享)的资源:在时间和空间。当资源是时间复用,不同的程序或用户轮流使用。首先,他们一得到利用的资源,然后再一次,等等。例如,只有一个CPU,而且要在其上运行多个程序时,操作系统首先在CPU分配到一个程序,然后运行后,它已经足够长的时间,一个又一个得到使用的CPU,然后再一次,并最终第一个了。资源是如何确定的时间多工 - 未来和谁去多久 - 是操作系统的任务。另一个例子是时间复用共享的打印机。当多个打印作业排队印刷了一台打印机,必须作出决定哪一个是对要打印的未来。The other kind of multiplexing is space multiplexing, instead of the customers taking turns, each one gets part of the resource. For example, main memory is normally divided up among several running programs, so each one can b
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 耕地抛荒面试题及答案
- 质监系统考试试题及答案
- 台湾民法考试题及答案
- 校园保安反恐防暴安全知识培训课
- 政工人员试题及答案
- 函数高考试题及答案
- 2025年贵阳市城乡建设学校外聘教师招聘考试试题(含答案)
- 医院和住院环境医学必看试题带答案
- 《婚姻继承法知识点》通关试题(附答案)
- 主治医师放射科辐射安全与应急预案模拟试题(含答案)
- 业务跟单培训
- 河北省唐山市路北区2023-2024学年八年级下学期期末数学试题
- DL-T-5161.13-2018电气装置安装工程质量检验及评定规程第13部分:电力变流设备施工质量检验
- 安全顾问聘请协议
- 糖尿病酮症酸中毒的护理课件
- 设备材料进场报验单
- 班组长计划管理能力考试题库-上(选择题)
- (完整版)《机械制造工艺基础》教案
- 小学四年级数学口算题(每页60道直接打印).文档
- 诱思探究理论
- 铣床日常点检保养记录表
评论
0/150
提交评论