实例介绍
操作系统概念 (操作系统恐龙书) Operating System Concepts 注意!这个是书中的习题答案,不是原书。
preface This volume is an instructors manual for the Seventh Edition of Operating System Concepts, by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne It consists of answers to the exercises in the parent text Although we have tried to produce an instructors manual that will aid all of the users of our book as much as possible there can always be im provements (improved answers, additional questions, sample test questions, programming projects, alternative orders of presentation of the material, addi- tional references, and so on). We invite you to help us in improving this manual If you have better solutions to the exercises or other items which would be of use with Operating-System Concepts, we invite you to send them to us for con Sideration in later editions of this manual. All contributions will, of course, be . ly credited to their contribut Internet electronic mail should be addressed to os-book@cs. yale. edu Physical mail may be sent to Avi Silberschatz, Department nof Computer Sc ence, Yale University 51 Prospect Street, New Haven, CT06520, USA A s P.B. G Contents Chapter 1 Introduction Chapter 2 Operating-System Structures Chapter 3 Processes 15 Chapter 4 Threads 23 Chapter 5 CPU Scheduling 27 Chapter 6 Process Synchronization............. Chapter 7 Deadlocks....... 鲁鲁 47 Chapter8 Memory Management.……………………,55 Chapter 9 Virtual Memory 61 Chapter 10 File-Systems Interface 71 Chapter 11 File-Systems Implementation 75 Chapter 12 Mass Storage Structure .91 Chapter 13 I/o systems 鲁看 Chapter 14 protection Chapter15 Security.∴……………………… 秦普 105 Chapter 16 Network Structures................... 111 Chapter 17 Distributed Communication 117 Chapter18 Distributed- File Systems∴…………121 Chapter 19 Multimedia Systems 127 Chapter 20 Embedded Systems ....131 Chapter 21 The Linux System 137 Chapter 22 Windows XF ..145 Chapter 23 Influential Operating systems 149 CHAPTER Chapter 1 introduces the general topic of operating systems and a handful of important concepts(multiprogramming time sharing, distributed system, and so on). The purpose is to show why operating systems are what they are by showing how they developed. In operating systems, as in much of computer science, we are led to the present by the paths we took in the past, and we can better understand both the present and the future by understanding the past Additional work that might be considered is learning about the particular systems that the students will have access to at your institution. This is still just a general overview, as specific interfaces are considered in Chapter 3 Exercises 1.1 In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems a. What are two such problems? b. Can we ensure the same degree of security in a time-shared ma chine as in a dedicated machine? Explain your answer. Answer a. Stealing or copying one's programs or data; using system re sources( CPU, memory, disk space, peripherals)without proper accounting b. Probably not, since any protection scheme devised by humans can inevitably be broken by a human, and the more complex the scheme, the more difficult it is to feel confident of its correct implementation Chapter 1 Introduction 1.2 The issue of resource utilization shows up in different forms in differ- ent types of operating systems. List what resources must be managed carefully in the following settings a. Mainframe or minicomputer systems b. Workstations connected to servers Handheld computers Answer a. Mainframes: memory and CPU resources, storage, network band width b. Workstations: memory and cPu resouces C. Handheld computers: power consumption, memory resources 1.3 Under what circumstances would a user be better off using a time sharing system rather than a PC or single-user workstation Answer: When there are few other users the task is arge, and hardware is fast time-sharing makes sense. The full power of the system can be brought to bear on the users problem. The problem can be solved faster than on a personal computer. Another case occurs when lots of other users need resources at the same time A personal computer is best when the job is small enough to be exe- cuted reasonably on it and when performance is sufficient to execute the program to the user's satisfaction 1.4 Which of the functionalities listed below need to be supported by the operating system for the following two settings: (a)handheld devices and (b) real-time systems a. Batch programming b.Ⅴ irtual memory C. Time sharing Answer: For real-time systems, the operating system needs to support virtual memory and time sharing in a fair manner. For handheld systems the operating system needs to provide virtual memory but does not need to provide time-sharing. Batch programming is not necessary in both settings 1.5 Describe the differences between symmetric and asymmetric multipro- cessing. What are three advantages and one disadvantage of multipro cessor syste Answer: Symmetric multiprocessing treats all processors as equals and I/o can be processed on any cPu. asymmetric multiprocessing has one master cpu and the remainder cpus are slaves The master distributes tasks among the slaves, and iyo is usually done by the master only. Multiprocessors can save money by not duplicating power supplies, housings, and peripherals. They can execute programs more quickly and can have increased reliability. They are also more complex in both hardware and software than uniprocessor systems xercises 1.6 How do clustered systems differ from multiprocessor systems? What is required for two machines belonging to a cluster to cooperate to provide a highly available service Answer: Clustered systems are typically constructed by combining multiple computers into a single system to perform a computationa task distributed across the cluster Multiprocessor systems on the other hand could be a single physical entity comprising of multiple CPUs. A clustered system is less tightly coupled than a multiprocessor system. Clustered systems communicate using messages, while processors in a multiprocessor system could communicate using shared memory In order for two machines to provide a highly available service the state on the two machines should be replicated and should be consistently updated When one of the machines fail, the other could then take-over the functionality of the failed machine 1.7 Distinguish between the client-server and peer-to-peer models of dis tributed systems Answer: The client-server model firmly distinguishes the roles of the client and server. Under this model, the client requests services that are provided by the server. The peer-to-peer model doesnt have such strict roles. In fact, all nodes in the system are considered peers and thus may act as either clients or servers-or both. A node may request a service from another peer, or the node may in fact provide such a service to other peers in the system For example, let's consider a system of nodes that share cooking recipes Under the client-server model, all recipes are stored with the server. If a client wishes to access a recipe it must request the recipe from the specified server. Using the peer-to-peer model, a peer node could ask other peer nodes for the specified recipe. The node(or perhaps nodes with the requested recipe could provide it to the requesting node. notice how each peer may act as both a client (i.e. it may request recipes)and as a server(it may provide recipes. 1.8 Consider a computing cluster consisting of two nodes running a database Describe two ways in which the cluster software can manage access to the data on the disk. discuss the benefits and disadvantages of each Answer: Consider the following two alternatives: asymmetric cluster ing and parallel clustering With asymmetric clustering, one host runs the database application with the other host simply monitoring it. If the server fails, the monitoring host becomes the active server. This is appropriate for providing redundancy. However, it does not utilize the potential processing power of both hosts With parallel clustering, the database application can run in parallel on both hosts. The difficulty implementing parallel clusters is providing some form of distributed locking mechanism for files on the shared disk 1.9 How are network computers different from traditional personal com puters? Describe some usage scenarios in which it is advantageous to use network computers Answer: A network computer relies on a centralized computer for most of its services. It can therefore have a minimal operating system Chapter 1 Introduction to be capao ts resources. A personal computer on the other hand has to manage le of providing all of the required functionality in a stand- lone manner without relying on a centralized manner. Scenarios where administrative costs are high and where sharing leads to more efficient use of resources are precisely those settings where network computers are preferred 1.10 What is the purpose of interrupts? What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? If so, for what purpose? Answer: An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction. A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an i/o to obviate the need for device polling. A trap can be used to call operating system routines or to catch arithmetic errors 1.11 Direct memory access is used for high-speed I/o devices in order to avoid increasing the cpus execution load a. how does the cpu interface with the device to coordinate the transfer? b. How does the cpu know when the memory operations are com- plete? C. The CPU is allowed to execute other programs while the DMa controller is transferring data. Does this process interfere with the execution of the user programs? If so, describe what forms of interference are caused Answer: The CPU can initiate a DMA operation by writing values into special registers that can be independently accessed by the device The device initiates the corresponding operation once it receives a com- mand from the cpu. when the device is finished with its operation it interrupts the cpu to indicate the completion of the operation Both the device and the cpu can be accessing memory simultaneously The memory controller provides access to the memory bus in a fair manner to these two entities. A CPU might therefore be unable to issue memory operations at peak speeds since it has to compete with the device in order to obtain access to the memory bus 1.12 Some computer systems do not provide a privileged mode of operation in hardware. Is it possible to construct a secure operating system for these computer systems? Give arguments both that it is and that it is not possible Answer: An operating system for a machine of this type would need to remain in control (or monitor mode) at all times. This could be accom- plished by two methods a. Software interpretation of all user programs (like some BASIC, Java, and LISP systems, for example). The software interpreter would provide, in software, what the hardware does not provide 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论