《操作系统概念第七版问题答案(英文完整版).pdf》由会员分享,可在线阅读,更多相关《操作系统概念第七版问题答案(英文完整版).pdf(90页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、solutions to the exercisesChapter 11.1 In a multiprogramming and time-sharing environment,several users share the systemsimultaneously.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 machine as in a dedi
2、cated machine?Explain your answer.Answer:a.Stealing or copying one 痴 programs or data;using system resources(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,th
3、e more difficult it is to feel confident of its correctimplementation.1.2 The issue of resource utilization shows up in different forms in different types of operatingsystems.List what resources must be managedcarefully in the following settings:a.Mainframe or minicomputer systemsb.Workstationsconne
4、cted to serversc.Handheld computersAnswer:a.Mainframes:memory and CPU resources,storage,network bandwidth.b.Workstations:memory and CPU resoucesc.Handheld computers:power consumption,memory resources.1.3 Under what circumstances would a user be better off using a timesharing system rather than a PCo
5、r single-user workstation?Answer:When there are few other users,the task is large,and the hardware is fast,time-sharingmakessense.The full power of the system can be brought to bear on the user 痴 problem.The problemcanbe solved faster than on a personal computer.Another case occurs when lots of othe
6、r users needresources at the same time.A personal computer is best when the job is small enough to be executed reasonably on it and whenperformance is sufficient to execute the program to the user 痴 satisfaction.1.4 Which of the functionalities listed below need to be supported by the operating syst
7、em for thefollowing two settings:(a)handheld devices and(b)real-time systems.a.Batch programmingb.Virtual memoryc.Time sharingAnswer:For real-time systems,the operating system needs to support virtual memory and timesharing in a fair manner.For handheld systems,the operating system needs to provide
8、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 multiprocessing.What are threeadvantages and one disadvantage of multiprocessor systems?Answer:Symmetric multiprocessing treats a
9、ll processors as equals,and I/O can be processed on anyCPU.Asymmetric multiprocessing has one master CPU and the remainder CPUs are slaves.Themaster distributes tasks among the slaves,and I/O is usually done by the master only.Multiprocessors can save money by not duplicating power supplies,housings
10、,and peripherals.Theycan execute programs more quickly and can have increased reliability.They are also more complex inboth hardware and software than uniprocessor systems.1.6 How do clustered systems differ from multiprocessor systems?What is required for two machinesbelonging to a cluster to coope
11、rate to provide a highly available service?Answer:Clustered systems are typically constructed by combining multiple computers into a singlesystem to perform a computational task distributed across the cluster.Multiprocessor systems on theother hand could be a single physical entity comprising of mul
12、tiple CPUs.A clustered system is lesstightly coupled than a multiprocessor system.Clustered systems communicate using messages,whileprocessors in a multiprocessor system could communicate using shared memory.In order for twomachines to provide a highly available service,the state on the two machines
13、 shouldbe replicated and should be consistently updated.When one of the machines fail,the other could thentake-over the functionality of the failed machine.1.7 Distinguish between the client-server and peer-to-peer models of distributed systems.Answer:The client-server model firmly distinguishes the
14、 roles of the client and server.Under thismodel,the client requests services that are provided by the server.The peer-to-peer model doesn 稚have such strict roles.In fact,all nodes in the system are considered peers and thus may act as eitherclients or serversor both.A node may request a service from
15、 another peer,or the node may in factprovide such a service to other peers in the system.For example,let 痴 consider a system of nodes that share cooking recipes.Under the client-servermodel,all recipes are stored with the server.If a client wishes to access a recipe,it must request therecipe from th
16、e specified server.Using the peer-to-peer model,a peer node could ask other peer nodesfor the specified recipe.The node(or perhaps nodes)with the requested recipe could provide it to therequesting node.Notice how each peer may act as both a client(i.e.it may request recipes)and as aserver(it may pro
17、vide recipes.)1.8 Consider a computing cluster consisting of twonodes running adatabase.Describe two ways inwhich the cluster software can manage access to the data on the disk.Discuss the benefits anddisadvantages of each.Answer:Consider the following two alternatives:asymmetric clustering and para
18、llel clustering.Withasymmetric 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 providingredundancy.However,it does not utilize the potential processing power of both h
19、osts.With parallelclustering,the database application can run in parallel on both hosts.The difficulty implementingparallel 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 computers?Descri
20、be some usagescenarios 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 thereforehave a minimal operating system to manage its resources.Apersonal computer on the other hand hasto be capable of providing a
21、ll of the required functionality in a standalonemanner without relying on acentralized manner.Scenarios where administrative costs are high and where sharing leads to moreefficient use of resources are precisely those settings where network computers are preferred.1.10 What is the purpose of interru
22、pts?What are the differences between a trap and an interrupt?Cantraps 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 handleris summoned to deal with the cause of the interrupt;control is th
23、en returned to the interrupted contextand instruction.A trap is a software-generated interrupt.An interrupt can be used to signal thecompletion of an I/O to obviate the need for device polling.Atrap can be used to call operatingsystem routines or to catch arithmetic errors.1.11 Direct memory access
24、is used for high-speed I/O d e v i c e si no r d e rt oav o i di n c r e a s i n gt h eC P U 2 se x e c u t i o nl o a d.a.H o wd o e st h eC P Ui n t e r f a c ew i t ht h ed e vi c et oc o o r d i n a t et h et r a n s f e r?b.H o wd o e st h eC P Uk n o ww h e nt h em e m o r yo p e r a t i o n s
25、a r ec o m p l e t e?c.T h eC P Ui sa l l o w e dt oe x e c u t eo t h e rp r og r a m sw h i l ethe DMA controller is transferring data.Does this process interfere withthe execution of the user programs?If so,describe what forms of interference are caused.Answer:The CPU can initiate a DMA operation
26、 by writing values into special registers that can beindependently accessed by the device.The device initiates the corresponding operation once it receivesa command from the CPU.When the device is finished with its operation,it interrupts the CPU toindicate the completion of the operation.Both the d
27、evice and the CPU can be accessing memory simultaneously.The memory controllerprovides access to the memory bus in a fair manner to these two entities.A CPU might therefore beunable to issue memory operations at peak speeds since it has to compete with the device in order toobtain access to the memo
28、ry bus.1.12 Some computer systems do not provide a privileged mode of operation in hardware.Is it possibleto construct a secure operating system for these computer systems?Give arguments both that it is andthat it is not possible.Answer:An operating system for a machine of this type would need to re
29、main in control(or monitormode)at all times.This could be accomplished by two methods:a.Software interpretation of all user programs(like some BASIC,Java,and LISP systems,forexample).The software interpreter would provide,in software,what the hardware does not provide.b.Require meant that all progra
30、ms be written in high-level languages so that all object code iscompiler-produced.The compiler would generate(either in-line or by function calls)the protectionchecks that the hardware is missing.1.13 Give two reasons why caches are useful.What problems do they solve?What problems do theycause?If a
31、cache can be made as large as the device for which it is caching(for instance,a cache aslarge as a disk),why not make it that large and eliminate the device?Answer:Caches are useful when two or more components need to exchange data,and the componentsperform transfers at differing speeds.Caches solve
32、 the transfer problem by providing a buffer ofintermediate speed between the components.If the fast device finds the data it needs in the cache,itneed not wait for the slower device.The data in the cache must be kept consistent with the data in thecomponents.If a omponent has a data value change,and
33、 the datum is also in the cache,the cache mustalso be updated.This is especially a problem on multiprocessor systemswhere more than one processmay be accessing a datum.Acomponent may be eliminated by an equal-sized cache,but only if:(a)thecache and the component have equivalent state-saving capacity
34、(that is,if the component retains itsdata when electricity is removed,the cache must retain data as well),and(b)the cache is affordable,because faster storage tends to be more expensive.1.14 Discuss,with examples,how the problem of maintaining coherence of cached data manifestsitself in the followin
35、g processing environments:a.Single-processor systemsb.Multiprocessor systemsc.Distributed systemsAnswer:In single-processor systems,the memory needs to be updated when a processor issuesupdates to cached values.These updates can be performed immediately or in a lazy manner.Inamultiprocessor system,d
36、ifferent processors might be caching the same memory location in its localcaches.When updates are made,the other cached locations need to be invalidated or updated.Indistributed systems,consistency of cached memory values is not an issue.However,consistencyproblems might arise when a client caches f
37、ile data.1.15 Describe a mechanism for enforcing memory protection in order to prevent a program frommodifying the memory associated with other programs.Answer:The processor could keep track of what locations are associated with each process and limitaccess to locations that are outside of a program
38、 痴extent.Information regarding the extent of aprogram 痴memory could be maintained by using base and limits registers and by performing acheck for every memory access.1.16 What network configuration would best suit the following environments?a.A dormitory floorb.Auniversity campusc.A stated.AnationAn
39、swer:a.A dormitory floor-ALAN.b.Auniversity campus-ALAN,possible a WAN for very large campuses.c.A state-AWAN.d.Anation-AWAN.1.17 Define the essential properties of the following types of operating systems:a.Batchb.Interactivec.Time sharingd.Real timee.Networkf.Parallelg.Distributedh.Clusteredi.Hand
40、heldAnswer:a.Batch.Jobs with similar needs are batched together and run through the computer as a group by anoperator or automatic job sequencer.Performance is increased by attempting to keep CPU and I/Odevices busy at all times through buffering,off-line operation,spooling,andmultiprogramming.Batch
41、is good for executing large jobs that need little interaction;it can be submitted and picked up later.b.Interactive.This system is composed of many short transactions where the results of the nexttransaction may be unpredictable.Response time needs to be short(seconds)since the user submitsand waits
42、 for the result.c.Time sharing.This systems uses CPU scheduling and multiprogramming to provide economicalinteractive use of a system.The CPU switches rapidly from one user to another.Instead of having ajob defined by spooled card images,each program reads its next control card from the terminal,and
43、output is normally printed immediately to the screen.d.Real time.Often used in a dedicated application,this system reads information from sensors andmust respond within a fixed amount of time to ensure correct performance.e.Network.Provides operating system features across a network such as file sha
44、ring.f.SMP.Used in systems where there are multiple CPU 痴each running the same copy of theoperating system.Communication takes place across the system bus.g.Distributed.This system distributes computation among several physical processors.The processorsdo not share memory or a clock.Instead,each pro
45、cessor has its own local memory.They communicatewith each other through various communication lines,such as a high-speed bus or local area network.h.Clustered.A clustered system combines multiple computers into a single system to performcomputational task distributed across the cluster.i.Handheld.As
46、mall computer system that performs simple tasks such as calendars,email,and webbrowsing.Handheld systems differ from traditional desktop systemswith smallermemory and displayscreens and slower processors.1.18 What are the tradeoffs inherent in handheld computers?Answer:Handheld computers are much sm
47、aller than traditional desktop PC 痴.This results in smallermemory,smaller screens,and slower processing capabilities than a standard desktop PC.Because ofthese limitations,most handhelds currently can perform only basic tasks such as calendars,email,andsimple word processing.However,due to their sma
48、ll size,they are quite portable and,when they areequipped with wireless access,can provide remote access to electronic mail and the world wide web.Chapter 22.1 The services and functions provided by an operating system can be divided into two maincategories.Briefly describe the two categories and di
49、scuss how they differ.Answer:One class of services provided by an operating system is to enforce protection betweendifferent processes running concurrently in the system.Processes are allowed to access onlythosememory locations that are associated with their address spaces.Also,processes are not all
50、owedto corrupt files associated with other users.A process is also not allowed to access devices directlywithout operating system ntervention.The second class of services provided by an operating system is to provide new functionality that isnot supported directly by the underlying hardware.Virtual