ebook img

Instructor's Manual to Accompany: Operating System Concepts PDF

156 Pages·2001·0.89 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Instructor's Manual to Accompany: Operating System Concepts

INSTRUCTOR’S MANUAL TO ACCOMPANY OPERATING- SYSTEM CONCEPTS SEVENTHEDITION ABRAHAMSILBERSCHATZ YaleUniversity PETERBAERGALVIN CorporateTechnologies GREGGAGNE WestminsterCollege Preface This volume is an instructor’s manual for the Seventh Edition of Operating- SystemConcepts,byAbrahamSilberschatz,PeterBaerGalvin,andGregGagne. Itconsistsofanswerstotheexercisesintheparenttext. Although we have tried to produce an instructor’s 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, programmingprojects,alternativeordersofpresentationofthematerial,addi- tionalreferences,andsoon).Weinviteyoutohelpusinimprovingthismanual. Ifyouhavebettersolutionstotheexercisesorotheritemswhichwouldbeof usewithOperating-SystemConcepts,weinviteyoutosendthemtousforcon- siderationinlatereditionsofthismanual.Allcontributionswill,ofcourse,be properlycreditedtotheircontributor. [email protected]. PhysicalmailmaybesenttoAviSilberschatz,DepartmentnofComputerSci- ence,YaleUniversity51ProspectStreet,NewHaven,CT06520,USA. A.S. P.B.G G.G. iii Contents Chapter1 Introduction................................................. 1 Chapter2 Operating-SystemStructures................................ 9 Chapter3 Processes................................................... 15 Chapter4 Threads..................................................... 23 Chapter5 CPUScheduling............................................ 27 Chapter6 ProcessSynchronization.................................... 33 Chapter7 Deadlocks.................................................. 47 Chapter8 MemoryManagement...................................... 55 Chapter9 VirtualMemory ............................................ 61 Chapter10 File-SystemsInterface...................................... 71 Chapter11 File-SystemsImplementation.............................. 75 Chapter12 MassStorageStructure..................................... 91 Chapter13 I/OSystems................................................ 93 Chapter14 Protection.................................................. 99 Chapter15 Security................................................... 105 Chapter16 NetworkStructures....................................... 111 Chapter17 DistributedCommunication.............................. 117 Chapter18 Distributed-FileSystems ................................. 121 Chapter19 MultimediaSystems...................................... 127 Chapter20 EmbeddedSystems....................................... 131 Chapter21 TheLinuxSystem......................................... 137 Chapter22 WindowsXP.............................................. 145 Chapter23 InfluentialOperatingSystems............................ 149 v 1 CHAPTER Introduction Chapter1introducesthegeneraltopicofoperatingsystemsandahandful of importantconcepts(multiprogramming,timesharing,distributedsystem,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,weareledtothepresentbythepathswetookinthepast,andwecan betterunderstandboththepresentandthefuturebyunderstandingthepast. Additionalworkthatmightbeconsideredislearningabouttheparticular systemsthatthestudentswillhaveaccesstoatyourinstitution.Thisisstilljust ageneraloverview,asspecificinterfacesareconsideredinChapter3. Exercises 1.1 In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various securityproblems. a. Whataretwosuchproblems? b. Canweensurethesamedegreeofsecurityinatime-sharedma- chineasinadedicatedmachine?Explainyouranswer. 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. 1 2 Chapter1 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 carefullyinthefollowingsettings: a. Mainframeorminicomputersystems b. Workstationsconnectedtoservers c. Handheldcomputers Answer: a. Mainframes:memoryandCPUresources,storage,networkband- width. b. Workstations:memoryandCPUresouces c. Handheldcomputers:powerconsumption,memoryresources. 1.3 Under what circumstances would a user be better off using a time- sharingsystemratherthanaPCorsingle-userworkstation? Answer: When there are few other users, the task is large, and the hardwareisfast,time-sharingmakessense.Thefullpowerofthesystem canbebroughttobearontheuser’sproblem.Theproblemcanbesolved faster than on a personal computer. Another case occurs when lots of otherusersneedresourcesatthesametime. A personal computer is best when the job is small enough to be exe- cutedreasonablyonitandwhenperformanceissufficienttoexecutethe programtotheuser’ssatisfaction. 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-timesystems. a. Batchprogramming b. Virtualmemory c. Timesharing Answer: Forreal-timesystems,theoperatingsystemneedstosupport virtualmemoryandtimesharinginafairmanner.Forhandheldsystems, the operating system needs to provide virtual memory, but does not need to provide time-sharing. Batch programming is not necessary in bothsettings. 1.5 Describethedifferencesbetweensymmetricandasymmetricmultipro- cessing.What arethree advantagesand one disadvantageofmultipro- cessorsystems? Answer: Symmetricmultiprocessingtreatsallprocessorsasequals,and I/OcanbeprocessedonanyCPU.Asymmetricmultiprocessinghasone master CPU and the remainder CPUs are slaves. The master 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, and peripherals. They can execute programs more quickly and can have increased reliability.They are also more complex in both hardwareandsoftwarethanuniprocessorsystems. Exercises 3 1.6 Howdoclusteredsystemsdifferfrommultiprocessorsystems?Whatis requiredfortwomachinesbelongingtoaclustertocooperatetoprovide ahighlyavailableservice? Answer: Clustered systems are typically constructed by combining multiple computers into a single system to perform a computational taskdistributedacrossthecluster.Multiprocessorsystemsontheother hand couldbeasinglephysicalentitycomprisingofmultipleCPUs.A clustered system is less tightly coupled than a multiprocessor system. Clusteredsystemscommunicate using messages,while processorsina multiprocessorsystemcouldcommunicateusingsharedmemory. Inorderfortwomachinestoprovideahighlyavailableservice,thestate on the two machines should be replicated and should be consistently updated.Whenoneofthemachinesfail,theothercouldthentake-over thefunctionalityofthefailedmachine. 1.7 Distinguish between the client–server and peer-to-peer models of dis- tributedsystems. Answer: The client-server model firmly distinguishes the roles of the clientandserver.Underthismodel,theclientrequestsservicesthatare providedbytheserver.Thepeer-to-peermodeldoesn’thavesuchstrict roles.Infact,allnodesinthesystemareconsideredpeersandthusmay 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 otherpeersinthesystem. Forexample,let’sconsiderasystemofnodesthatsharecookingrecipes. 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) withtherequestedrecipecouldprovideittotherequestingnode.Notice howeachpeermay actas bothaclient(i.e.itmayrequestrecipes)and asaserver(itmayproviderecipes.) 1.8 Consideracomputingclusterconsistingoftwonodesrunningadatabase. Describe two ways in which the cluster software can manage access to thedataonthedisk.Discussthebenefitsanddisadvantagesofeach. Answer: Considerthefollowingtwoalternatives:asymmetriccluster- ingandparallelclustering.Withasymmetricclustering,onehostruns the database application with the other host simply monitoring it. If the server fails, the monitoring host becomes the active server. This is appropriateforprovidingredundancy.However,itdoesnotutilizethe 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 lockingmechanismforfilesontheshareddisk. 1.9 How are network computers different from traditional personal com- puters? Describe some usage scenarios in which it is advantageous to usenetworkcomputers. Answer: A network computer relies on a centralized computer for most of its services. It can therefore have a minimal operating system 4 Chapter1 Introduction to manage its resources. A personal computer on the other hand has to be capable of providing all of the required functionality in a stand- alonemannerwithoutrelyingonacentralizedmanner.Scenarioswhere administrativecostsarehighandwheresharingleadstomoreefficient use of resources are precisely those settings where network computers arepreferred. 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?Ifso,forwhatpurpose? Answer: Aninterruptisahardware-generatedchange-of-flow within the system. An interrupt handler is summoned to deal with the cause oftheinterrupt;controlisthenreturnedtotheinterruptedcontextand instruction. A trap is a software-generated interrupt. An interrupt can beusedtosignalthecompletionofanI/Otoobviatetheneedfordevice polling.Atrapcanbeusedtocalloperatingsystemroutinesortocatch arithmeticerrors. 1.11 Direct memory access is used for high-speed I/O devices in order to avoidincreasingtheCPUs´ executionload. a. How does the CPU interface with the device to coordinate the transfer? b. HowdoestheCPUknowwhenthememoryoperationsarecom- plete? c. The CPU is allowed to execute other programs while the DMA controller is transferring data. Does this process interfere with theexecutionoftheuserprograms?Ifso,describewhatformsof interferencearecaused. Answer: The CPU can initiate a DMA operation by writing values intospecialregistersthatcanbeindependentlyaccessedbythedevice. Thedeviceinitiatesthecorrespondingoperationonceitreceivesacom- mand from the CPU. When the device is finished with its operation, it interruptstheCPUtoindicatethecompletionoftheoperation. BoththedeviceandtheCPUcanbeaccessingmemorysimultaneously. The memory controller provides access to the memory bus in a fair mannertothesetwoentities.ACPUmightthereforebeunabletoissue memory operations at peak speeds since it has to compete with the deviceinordertoobtainaccesstothememorybus. 1.12 Somecomputersystemsdonotprovideaprivilegedmodeofoperation in hardware. Is it possible to construct a secure operating system for thesecomputersystems?Giveargumentsboththatitisandthatitisnot possible. Answer: Anoperatingsystemforamachineofthistypewouldneedto remainin control (or monitor mode)at all times. This could be accom- plishedbytwomethods: a. Software interpretation of all user programs (like some BASIC, Java, and LISP systems, for example). The software interpreter wouldprovide,insoftware,whatthehardwaredoesnotprovide.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.