《操作系统第7版课后练习答案(英文).pdf》由会员分享,可在线阅读,更多相关《操作系统第7版课后练习答案(英文).pdf(112页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、solutionsto the exercisesChapter 11.1 In a multiprogramming and time-sharing environment,several users share thesystem 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 machine as in a dedic
2、atedmachine?Explain your answer.Answer:a.Stealing or copying one,s 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 bebroken by a human,and the more complex the scheme,the m
3、ore difficult it is to feelconfident of its correct implementation.1.2 The issue of resource utilization shows up in different forms in different typesof operating systems.List what resources must be managedcarefully in the following settings:a.Mainframe or minicomputer systems b.Workstations connec
4、ted to servers c.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 systemrather than a PC o
5、r single-user workstation?Answer:W hen there are few other users,the task is large,and the hardware is fast,time-sharingmakes sense.The full power of the system can be brought to bear on theuser s problem.The problemcan be solved faster than on a personal computer.Anothercase occurs when lots of oth
6、er users need resources at the same time.A personal computer is best when the job is small enough to be executed reasonablyon it and when performance is sufficient to execute the program to the user ssatisfaction.1.4 Which of the functionalities listed below need to be supported by the operatingsyst
7、em for the following two settings:(a)handheld devices and(b)real-time systems,a.Batch programming b.Virtual memory c.Time sharingAnswer:For real-time systems,the operating system needs to support virtual memoryand time sharing in a fair manner.For handheld systems,the operating system needsto provid
8、e virtual memory,but does not need to provide time-sharing.Batchprogramming is not necessary in both settings.1.5 Describe the differences between symmetric and asymmetric multiprocessing.Whatare three advantages and one disadvantage of multiprocessor systems?Answer:Symmetric multiprocessing treats
9、all processors as equals,and I/O can beprocessed on any CPU.Asymmetric multiprocessing has one master CPU and the remainderCPUs are slaves.The master distributes tasks among the slaves,and I/O is usuallydone by the master only.Multiprocessors can save money by not duplicating power supplies,housings
10、,andperipherals.They can execute programs more quickly and can have increasedreliability.They are also more complex in both hardware and software thanuniprocessor systems.1.6 How do clustered systems differ from multiprocessor systems?What is requiredfor two machines belonging to a cluster to cooper
11、ate to provide a highly availableservice?Answer:Clustered systems are typically constructed by combining multiple computersinto a single system to perform a computational task distributed across the cluster.Multiprocessor systems on the other hand could be a single physical entity comprisingof multi
12、ple CPUs.A clustered system is less tightly coupled than a multiprocessorsystem.Clustered systems communicate using messages,while processors in amultiprocessor system could communicate using shared memory.In order for twomachines to provide a highly available service,the state on thetwo machines sh
13、ould be replicated and should be consistently updated.W hen one ofthe machines fail,the other could then take-over the functionality of the failedmachine.1.7 Distinguish between the client-server and peer-to-peer models of distributedsystems.Answer:The client-server model firmly distinguishes the ro
14、les of the client andserver.Under this model,the client requests services that are provided by theserver.The peer-to-peer model doesn,t have such strict roles.In fact,all nodesin the system are considered peers and thus may act as either clients or serversor both.A node may request a service from an
15、other peer,or the node may in factprovide such a service to other peers in the system.For example,let s consider a system of nodes that share cooking recipes.Under theclient-server model,all recipes are stored with the server.If a client wishes toaccess a recipe,it must request the recipe from the s
16、pecified server.Using thepeer-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 therequesting node.Notice how each peer may act as both a client(i.e.it may requestrecipes)and as a server(it may provid
17、e recipes.)1.8 Consider a computing cluster consisting of twonodes running adatabase.Describetwo 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 clustering and parall
18、elclustering.With asymmetric clustering,one host runs the database application withthe other host simply monitoring it.If the server fails,the monitoring host becomesthe active server.This is appropriate for providing redundancy.However,it doesnot utilize the potential processing power of both hosts
19、.With parallel clustering,the database application can run in parallel on both hosts.The difficultyimplementing parallel clusters is providing some form of distributed lockingmechanism for files on the shared disk.1.9 H ow are network computers different from traditional personal computers?Describe
20、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 to manage its resources.A personalcomputer on the other hand has to be capable of providing a
21、ll of the requiredfunctionality in a standalonemanner without relying on a centralized manner.Scenarios where administrative costs are high and where sharing leads to moreefficient use of resources are precisely those settings where network computers arepreferred.1.10 What is the purpose of interrup
22、ts?What are the differences between a trap andan interrupt?Can traps be generated intentionally by a user program?If so,forwhat purpose?Answer:An interrupt is a hardware-generated change-of-flow within the system.Aninterrupt handler is summoned to deal with the cause of the interrupt;control isthen
23、returned to the interrupted context and instruction.A trap is asoftware-generated interrupt.An interrupt can be used to signal the completion ofan I/O to obviate the need for device polling.A trap can be used to call operatingsystem routines or to catch arithmetic errors.1.11 Direct memory access is
24、 used for high-speed I/O devices in order to avoidincreasing the CPU s 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 complete?c.The CPU is allowed to execute other programs while the D M A controller istr
25、ansferring data.Does this process interfere with the execution of the userprograms?If so,describe what forms of interference are caused.Answer:The CPU can initiate a D M A operation by writing values into special registersthat can be independently accessed by the device.The device initiates thecorre
26、sponding operation once it receives a command from the CPU.W hen the deviceis finished with its operation,it interrupts the CPU to indicate the completionof the operation.Both the device and the CPU can be accessing memory simultaneously.The memorycontroller provides access to the memory bus in a fa
27、ir manner to these two entities.A CPU might therefore be unable to issue memory operations at peak speeds since ithas 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 construc
28、t a secure operating system for these computer systems?Give arguments both that it is and that it is not possible.Answer:A n operating system for a machine of this type would need to remain in control(or monitor mode)at all times.This could be accomplished by two methods:a.Software interpretation of
29、 all user programs(like some BASIC,Java,and LISPsystems,for example).The software interpreter would provide,in software,whatthe hardware does not provide.b.Require meant that all programs be written in high-level languages so that allobject code is compiler-produced.The compiler would generate(eithe
30、r in-line orby function calls)the protection checks that the hardware is missing.1.13 Give two reasons why caches are useful.What problems do they solve?Whatproblems do they cause?If a cache can be made as large as the device for which itis caching(for instance,a cache as large as a disk),why not ma
31、ke it that largeand eliminate the device?Answer:Caches are useful when two or more components need to exchange data,andthe components perform transfers at differing speeds.Caches solve the transferproblem by providing a buffer of intermediate speed between the components.If thefast device finds the
32、data it needs in the cache,it need not wait for the slowerdevice.The data in the cache must be kept consistent with the data in the components.If a omponent has a data value change,and the datum is also in the cache,the cachemust also be updated.This is especially a problem on multiprocessor systems
33、wheremore than one process may be accessing a datum.Acomponent may be eliminated by anequal-sized cache,but only if:(a)the cache and the component have equivalentstate-saving capacity(that is,if the component retains its data when electricityis removed,the cache must retain data as well),and(b)the c
34、ache is affordable,because faster storage tends to be more expensive.1.14 Dis cu s s,w it h ex am p les,ho w t he p r o blem o f m ain t ain in g co her en ce o f cached dat am an if es t s it s elf in t he f o llo w in g p r o ces s in g en v ir o n m en t s:a.Sin g le-p r o ces s o r s y s t em sb
35、.Mu lt ip r o ces s o r s y s t em sc.Dis t r ibu t ed s y s t em sA n s w er:In s in g le-p r o ces s o r s y s t em s,t he m em o r y n eeds t o be u p dat ed w hen a p r o ces s o ris s u es u p dat es t o cached v alu es.Thes e u p dat es can be p er f o r m ed im m ediat ely o r ina laz y m an
36、n er.In am u lt ip r o ces s o r s y s t em,dif f er en t p r o ces s o r s m ig ht be cachin g t hes am e m em o r y lo cat io n in it s lo cal caches.When u p dat es ar e m ade,t he o t her cachedlo cat io n s n eed t o be in v alidat ed o r u p dat ed.In dis t r ibu t ed s y s t em s,co n s is t
37、en cyo f cached m em o r y v alu es is n o t an is s u e.Ho w ev er,co n s is t en cy p r o blem s m ig ht ar is ew hen a clien t caches f ile dat a.1.15 Des cr ibe a m echan is m f o r en f o r cin g m em o r y p r o t ect io n in o r der t o p r ev en t ap r o g r am f r o m m o dif y in g t he m
38、em o r y as s o ciat ed w it h o t her p r o g r am s.A n s w er:The p r o ces s o r co u ld k eep t r ack o f w hat lo cat io n s ar e as s o ciat ed w it h eachp r o ces s an d lim it acces s t o lo cat io n s t hat ar e o u t s ide o f a p r o g r amz s ex t en t.In f o r m at io n r eg ar din g
39、t he ex t en t o f a p r o g r amz s m em o r y co u ld be m ain t ain ed by u s in gbas e an d lim it s r eg is t er s an d by p er f o r m in g a check f o r ev er y m em o r y acces s.1.16 What n et w o r k co n f ig u r at io n w o u ld bes t s u it t he f o llo w in g en v ir o n m en t s?a.A d
40、o r m it o r y f lo o rb.A u n iv er s it y cam p u sc.A s t at ed.A n at io nA n s w er:a.A do r m it o r y f lo o r -A LA N.b.A u n iv er s it y cam p u s -A LA N,p o s s ible a WA N f o r v er y lar g e cam p u s es,c.A s t at e-A WA N.d.A n at io n -A WA N.1.17 Def in e t he es s en t ial p r o
41、p er t ies o f t he f o llo w in g t y p es o f o p er at in g s y s t em s:a.Bat chb.In t er act iv ec.Tim e s har in gd.Real t im ee.Net w o r kf.Par allelg.Dis t r ibu t edh.Clu s t er edi.Han dheldAnswer:a.Batch.Jobs with similar needs are batched together and run through the computeras a group
42、by an operator or automatic job sequencer.Performance is increased byattempting to keep CPU and I/O devices busy at all times through buffering,off-lineoperation,spooling,andmultiprogramming.Batch is good for executing large jobsthat need little interaction;it can be submitted and picked up later.b.
43、Interactive.This system is composed of many short transactions where the resultsof the next transaction may be unpredictable.Response time needs to be short(seconds)since the user submits and waits for the result.c.Time sharing.This systems uses CPU scheduling and multi programming to provideeconomi
44、cal interactive use of a system.The CPU switches rapidly from one user toanother.Instead of having a job defined by spooled card images,each program readsits next control card from the terminal,and output is normally printed immediatelyto the screen.d.Real time.Often used in a dedicated application,
45、this system reads informationfrom sensors and must respond within a fixed amount of time to ensure correctperformance.e.Network.Provides operating system features across a network such as file sharing.f.SM P.Used in systems where there are multiple CPU,s each running the same copyof the operating sy
46、stem.Communication takes place across the system bus.g.Distributed.This system distributes computation among several physicalprocessors.The processors do not share memory or a clock.Instead,each processorhas its own local memory.They communicate with each other through variouscommunication lines,suc
47、h as a high-speed bus or local area network.h.Clustered.A clustered system combines multiple computers into a single systemto perform computational task distributed across the cluster.i.Handheld.A small computer system that performs simple tasks such as calendars,email,and web browsing.Handheld syst
48、ems differ from traditional desktopsystemswith smallermemory and display screens and slower processors.1.18 What are the tradeoffs inherent in handheld computers?Answer:Handheld computers are much smaller than traditional desktop PCs.Thisresults in smaller memory,smaller screens,and slower processin
49、g capabilities thana standard desktop PC.Because of these limitations,most handhelds currently canperform only basic tasks such as calendars,email,and simple word processing.However,due to their smal 1 size,they are quite portable and,when they are equippedwith wireless access,can provide remote acc
50、ess to electronic mail and the worldwide web.Chapter 22.1 The services and functions provided by an operating system can be divided intotwo main categories.Briefly describe the two categories and discuss how they differ.Answer:One class of services provided by an operating system is to enforceprotec