Where can buy (ebook pdf) operating system concepts, 10th edition ebook with cheap price

Page 1


Visit to download the full and correct content document: https://ebookmass.com/product/ebook-pdf-operating-system-concepts-10th-edition/

More products digital (pdf, epub, mobi) instant download maybe you interests ...

Operating System Forensics 1st Edition Messier

https://ebookmass.com/product/operating-system-forensics-1stedition-messier/

Database System Concepts 6th Edition, (Ebook PDF)

https://ebookmass.com/product/database-system-concepts-6thedition-ebook-pdf/

Operating System Design: The Xinu Approach, Second Edition u2013 Ebook PDF Version 2nd

https://ebookmass.com/product/operating-system-design-the-xinuapproach-second-edition-ebook-pdf-version-2nd/

Intermediate Algebra: Concepts and Applications 10th Edition, (Ebook PDF)

https://ebookmass.com/product/intermediate-algebra-concepts-andapplications-10th-edition-ebook-pdf/

The Design of the UNIX

System Maurice J. Bach

https://ebookmass.com/product/the-design-of-the-unix-operatingsystem-maurice-j-bach/

Database System Concepts 7th Edition Avi Silberschatz

https://ebookmass.com/product/database-system-concepts-7thedition-avi-silberschatz/

Database System Concepts 7th Edition Abraham Silberschatz

https://ebookmass.com/product/database-system-concepts-7thedition-abraham-silberschatz/

Porth’s Pathophysiology: Concepts of Altered Health States 10th Edition, (Ebook PDF)

https://ebookmass.com/product/porths-pathophysiology-concepts-ofaltered-health-states-10th-edition-ebook-pdf/ Biology. Concepts & Applications 10th Edition Cecie Starr

https://ebookmass.com/product/biology-concepts-applications-10thedition-cecie-starr/

Preface

Operatingsystemsareanessentialpartofanycomputersystem.Similarly,a courseonoperatingsystemsisanessentialpartofanycomputerscienceeducation.Thisfieldisundergoingrapidchange,ascomputersarenowprevalent invirtuallyeveryarenaofday-to-daylife—fromembeddeddevicesinautomobilesthroughthemostsophisticatedplanningtoolsforgovernmentsand multinationalfirms.Yetthefundamentalconceptsremainfairlyclear,anditis onthesethatwebasethisbook.

Wewrotethisbookasatextforanintroductorycourseinoperatingsystemsatthejuniororseniorundergraduateleveloratthefirst-yeargraduate level.Wehopethatpractitionerswillalsofindituseful.Itprovidesaclear descriptionofthe concepts thatunderlieoperatingsystems.Asprerequisites, weassumethatthereaderisfamiliarwithbasicdatastructures,computer organization,andahigh-levellanguage,suchasCorJava.Thehardwaretopics requiredforanunderstandingofoperatingsystemsarecoveredinChapter1. Inthatchapter,wealsoincludeanoverviewofthefundamentaldatastructures thatareprevalentinmostoperatingsystems.Forcodeexamples,weusepredominantlyC,aswellasasignificantamountofJava,butthereadercanstill understandthealgorithmswithoutathoroughknowledgeoftheselanguages. Conceptsarepresentedusingintuitivedescriptions.Importanttheoretical resultsarecovered,butformalproofsarelargelyomitted.Thebibliographical notesattheendofeachchaptercontainpointerstoresearchpapersinwhich resultswerefirstpresentedandproved,aswellasreferencestorecentmaterial forfurtherreading.Inplaceofproofs,figuresandexamplesareusedtosuggest whyweshouldexpecttheresultinquestiontobetrue.

Thefundamentalconceptsandalgorithmscoveredinthebookareoften basedonthoseusedinbothopen-sourceandcommercialoperatingsystems. Ouraimistopresenttheseconceptsandalgorithmsinageneralsettingthat isnottiedtooneparticularoperatingsystem.However,wepresentalarge numberofexamplesthatpertaintothemostpopularandthemostinnovative operatingsystems,includingLinux,MicrosoftWindows,ApplemacOS (the originalname, OSX,waschangedin2016tomatchthenamingschemeofother Appleproducts),andSolaris.WealsoincludeexamplesofbothAndroidand iOS,currentlythetwodominantmobileoperatingsystems.

Theorganizationofthetextreflectsourmanyyearsofteachingcourses onoperatingsystems.Considerationwasalsogiventothefeedbackprovided vii

bythereviewersofthetext,alongwiththemanycommentsandsuggestions wereceivedfromreadersofourpreviouseditionsandfromourcurrentand formerstudents.ThisTenthEditionalsoreflectsmostofthecurriculumguidelinesintheoperating-systemsareain ComputerScienceCurricula2013,themost recentcurriculumguidelinesforundergraduatedegreeprogramsincomputer sciencepublishedbythe IEEE ComputingSocietyandtheAssociationforComputingMachinery(ACM).

What’sNewinThisEdition

FortheTenthEdition,wefocusedonrevisionsandenhancementsaimedat loweringcoststothestudents,betterengagingtheminthelearningprocess, andprovidingincreasedsupportforinstructors.

Accordingtothepublishingindustry’smosttrustedmarketresearchfirm, Outsell,2015representedaturningpointintextusage:forthefirsttime, studentpreferencefordigitallearningmaterialswashigherthanforprint,and theincreaseinpreferencefordigitalhasbeenacceleratingsince.

Whileprintremainsimportantformanystudentsasapedagogicaltool,the TenthEditionisbeingdeliveredinformsthatemphasizesupportforlearning fromdigitalmaterials.Allformsweareprovidingdramaticallyreducethecost tostudentscomparedtotheNinthEdition.Theseformsare:

• Stand-alonee-textnowwithsignificanenhancements.Thee-textformat fortheTenthEditionaddsexerciseswithsolutionsattheendsofmain sections,hide/revealdefinitionsforkeyterms,andanumberofanimated figures.Italsoincludesadditional “PracticeExercises” withsolutionsfor eachchapter,extraexercises,programmingproblemsandprojects, “FurtherReading” sections,acompleteglossary,andfourappendicesforlegacy operatingsystems.

• E-textwithprintcompanionbundle.Foranominaladditionalcost,the e-textalsoisavailablewithanabridgedprintcompanionthatincludes aloose-leafcopyofthemainchaptertext,end-of-chapter “PracticeExercises” (solutionsavailableonline),and “FurtherReading” sections.Instructorsmayalsoorderboundprintcompanionsforthebundledpackageby contactingtheirWileyaccountrepresentative.

Althoughwehighlyencourageallinstructorsandstudentstotakeadvantage ofthecost,content,andlearningadvantagesofthee-textedition,itispossible forinstructorstoworkwiththeirWileyAccountManagertocreateacustom printedition.

Toexploretheseoptionsfurtherortodiscussotheroptions,contactyour Wileyaccountmanager(http://www.wiley.com/go/whosmyrep)orvisitthe productinformationpageforthistextonwiley.com

BookMaterial

Thebookconsistsof21chaptersand4appendices.Eachchapterandappendix containsthetext,aswellasthefollowingenhancements:

• Asetofpracticeexercises,includingsolutions

• Asetofregularexercises

• Asetofprogrammingproblems

• Asetofprogrammingprojects

• AFurtherReadingsection

• Pop-updefinitionsofimportant(blue)terms

• Aglossaryofimportantterms

• Animationsthatdescribespecifickeyconcepts

Ahardcopyofthetextisavailableinbookstoresandonline.Thatversionhas thesametextchaptersastheelectronicversion.Itdoesnot,however,include theappendices,theregularexercises,thesolutionstothepracticeexercises, theprogrammingproblems,theprogrammingprojects,andsomeoftheother enhancementsfoundinthisePubelectronicbook.

ContentofThisBook

Thetextisorganizedintenmajorparts:

• Overview.Chapters1and2explainwhatoperatingsystemsare,what theydo,andhowtheyaredesignedandconstructed.Thesechaptersdiscusswhatthecommonfeaturesofanoperatingsystemareandwhatan operatingsystemdoesfortheuser.Weincludecoverageofbothtraditional PC andserveroperatingsystemsandoperatingsystemsformobile devices.Thepresentationismotivationalandexplanatoryinnature.We haveavoidedadiscussionofhowthingsaredoneinternallyinthesechapters.Therefore,theyaresuitableforindividualreadersorforstudentsin lower-levelclasseswhowanttolearnwhatanoperatingsystemiswithout gettingintothedetailsoftheinternalalgorithms.

• Processmanagement.Chapters3through5describetheprocessconcept andconcurrencyastheheartofmodernoperatingsystems.A process is theunitofworkinasystem.Suchasystemconsistsofacollectionof concurrently executingprocesses,someexecutingoperating-systemcode andothersexecutingusercode.Thesechapterscovermethodsforprocess schedulingandinterprocesscommunication.Alsoincludedisadetailed discussionofthreads,aswellasanexaminationofissuesrelatedtomulticoresystemsandparallelprogramming.

• Processsynchronization.Chapters6through8covermethodsforprocess synchronizationanddeadlockhandling.Becausewehaveincreasedthe coverageofprocesssynchronization,wehavedividedtheformerChapter 5(ProcessSynchronization)intotwoseparatechapters:Chapter6,SynchronizationTools,andChapter7,SynchronizationExamples.

• Memorymanagement.Chapters9and10dealwiththemanagementof mainmemoryduringtheexecutionofaprocess.Toimproveboththe

utilizationofthe CPU andthespeedofitsresponsetoitsusers,thecomputermustkeepseveralprocessesinmemory.Therearemanydifferent memory-managementschemes,reflectingvariousapproachestomemory management,andtheeffectivenessofaparticularalgorithmdependson thesituation.

• Storagemanagement.Chapters11and12describehowmassstorageand I/O arehandledinamoderncomputersystem.The I/O devicesthatattach toacomputervarywidely,andtheoperatingsystemneedstoprovidea widerangeoffunctionalitytoapplicationstoallowthemtocontrolall aspectsofthesedevices.Wediscusssystem I/O indepth,including I/O systemdesign,interfaces,andinternalsystemstructuresandfunctions. Inmanyways, I/O devicesaretheslowestmajorcomponentsofthecomputer.Becausetheyrepresentaperformancebottleneck,wealsoexamine performanceissuesassociatedwith I/O devices.

• Filesystems.Chapters13through15discusshowfilesystemsarehandled inamoderncomputersystem.Filesystemsprovidethemechanismforonlinestorageofandaccesstobothdataandprograms.Wedescribetheclassicinternalalgorithmsandstructuresofstoragemanagementandprovide afirmpracticalunderstandingofthealgorithmsused—theirproperties, advantages,anddisadvantages.

• Securityandprotection.Chapters16and17discussthemechanismsnecessaryforthesecurityandprotectionofcomputersystems.Theprocesses inanoperatingsystemmustbeprotectedfromoneanother’sactivities. Toprovidesuchprotection,wemustensurethatonlyprocessesthathave gainedproperauthorizationfromtheoperatingsystemcanoperateon thefiles,memory, CPU,andotherresourcesofthesystem.Protectionis amechanismforcontrollingtheaccessofprograms,processes,orusers tocomputer-systemresources.Thismechanismmustprovideameans ofspecifyingthecontrolstobeimposed,aswellasameansofenforcement.Securityprotectstheintegrityoftheinformationstoredinthesystem (bothdataandcode),aswellasthephysicalresourcesofthesystem,from unauthorizedaccess,maliciousdestructionoralteration,andaccidental introductionofinconsistency.

• Advancedtopics.Chapters18and19discussvirtualmachinesand networks/distributedsystems.Chapter18providesanoverviewof virtualmachinesandtheirrelationshiptocontemporaryoperating systems.Includedisageneraldescriptionofthehardwareandsoftware techniquesthatmakevirtualizationpossible.Chapter19providesan overviewofcomputernetworksanddistributedsystems,withafocuson theInternetand TCP/IP.

• Casestudies.Chapter20and21presentdetailedcasestudiesoftworeal operatingsystems—LinuxandWindows10.

• Appendices.AppendixAdiscussesseveraloldinfluentialoperatingsystemsthatarenolongerinuse.AppendicesBthroughDcoveringreat detaislthreeolderoperatingsystems—Windows7, BSD,andMach.

ProgrammingEnvironments

ThetextprovidesseveralexampleprogramswritteninCandJava.These programsareintendedtoruninthefollowingprogrammingenvironments:

• POSIX. POSIX (whichstandsfor PortableOperatingSystemInterface)representsasetofstandardsimplementedprimarilyfor UNIX-basedoperatingsystems.AlthoughWindowssystemscanalsoruncertain POSIX programs,ourcoverageof POSIX focusesonLinuxand UNIX systems. POSIXcompliantsystemsmustimplementthe POSIX corestandard(POSIX.1); LinuxandmacOS areexamplesof POSIX-compliantsystems. POSIX also definesseveralextensionstothestandards,includingreal-timeextensions (POSIX.1b)andanextensionforathreadslibrary(POSIX.1c,betterknown asPthreads).WeprovideseveralprogrammingexampleswritteninC illustratingthe POSIX base API,aswellasPthreadsandtheextensionsfor real-timeprogramming.TheseexampleprogramsweretestedonLinux4.4 andmacOS 10.11systemsusingthe gcc compiler.

• Java.Javaisawidelyusedprogramminglanguagewitharich API and built-inlanguagesupportforconcurrentandparallelprogramming.Java programsrunonanyoperatingsystemsupportingaJavavirtualmachine (or JVM).Weillustratevariousoperating-systemandnetworkingconcepts withJavaprogramstestedusingVersion1.8oftheJavaDevelopmentKit (JDK).

• Windowssystems.TheprimaryprogrammingenvironmentforWindows systemsistheWindows API,whichprovidesacomprehensivesetoffunctionsformanagingprocesses,threads,memory,andperipheraldevices. WesupplyamodestnumberofCprogramsillustratingtheuseofthis API ProgramsweretestedonasystemrunningWindows10.

Wehavechosenthesethreeprogrammingenvironmentsbecausewe believethattheybestrepresentthetwomostpopularoperating-system models—Linux/UNIX andWindows—alongwiththewidelyusedJava environment.MostprogrammingexamplesarewritteninC,andweexpect readerstobecomfortablewiththislanguage.Readersfamiliarwithboththe CandJavalanguagesshouldeasilyunderstandmostprogramsprovidedin thistext.

Insomeinstances—suchasthreadcreation—weillustrateaspecificconceptusingallthreeprogrammingenvironments,allowingthereadertocontrastthethreedifferentlibrariesastheyaddressthesametask.Inothersituations,wemayusejustoneofthe APIstodemonstrateaconcept.Forexample, weillustratesharedmemoryusingjustthe POSIXAPI;socketprogrammingin TCP/IP ishighlightedusingtheJava API

LinuxVirtualMachine

TohelpstudentsgainabetterunderstandingoftheLinuxsystem,weprovideaLinuxvirtualmachinerunningtheUbuntudistributionwiththistext. Thevirtualmachine,whichisavailablefordownloadfromthetextwebsite

(http://www.os-book.com),alsoprovidesdevelopmentenvironmentsincludingthe gcc andJavacompilers.Mostoftheprogrammingassignmentsinthe bookcanbecompletedusingthisvirtual machine,withtheexceptionofassignmentsthatrequiretheWindows API.Thevirtualmachinecanbeinstalledand runonanyhostoperatingsystemthatcanruntheVirtualBoxvirtualization software,whichcurrentlyincludesWindows10Linux,andmacOS

TheTenthEdition

AswewrotethisTenthEditionof OperatingSystemConcepts, wewereguidedby thesustainedgrowthinfourfundamentalareasthataffectoperatingsystems:

1. Mobileoperatingsystems

2. Multicoresystems

3. Virtualization

4. Nonvolatilememorysecondarystorage

Toemphasizethesetopics,wehaveintegratedrelevantcoveragethroughout thisnewedition.Forexample,wehavegreatlyincreasedourcoverageofthe AndroidandiOS mobileoperatingsystems,aswellasourcoverageofthe ARMv8architecturethatdominatesmobiledevices.Wehavealsoincreased ourcoverageofmulticoresystems,includingincreasedcoverageof APIsthat providesupportforconcurrencyandparallelism.Nonvolatilememorydevices like SSDsarenowtreatedastheequalsofhard-diskdrivesinthechaptersthat discuss I/O,massstorage,andfilesystems.

SeveralofourreadershaveexpressedsupportforanincreaseinJava coverage,andwehaveprovidedadditionalJavaexamplesthroughoutthis edition.

Additionally,wehaverewrittenmaterialinalmosteverychapterbybringingoldermaterialuptodateandremovingmaterialthatisnolongerinterestingorrelevant.Wehavereorderedmanychaptersandhave,insomeinstances, movedsectionsfromonechaptertoanother.Wehavealsogreatlyrevised theartwork,creatingseveralnewfiguresaswellasmodifyingmanyexisting figures.

MajorChanges

TheTenthEditionupdateencompassesmuchmorematerialthanprevious updates,intermsofbothcontentandnewsupportingmaterial.Next,we provideabriefoutlineofthemajorcontentchangesineachchapter:

• Chapter1:Introduction includesupdatedcoverageofmulticoresystems, aswellasnewcoverageof NUMA systemsandHadoopclusters.Old materialhasbeenupdated,andnewmotivationhasbeenaddedforthe studyofoperatingsystems.

• Chapter2:Operating-SystemStructures providesasignificantlyrevised discussionofthedesignandimplementationofoperatingsystems.We haveupdatedourtreatmentofAndroidandiOS andhaverevisedour

coverageofthesystembootprocesswithafocuson GRUB forLinux systems.NewcoverageoftheWindowssubsystemforLinuxisincluded aswell.Wehaveaddednewsectionsonlinkersandloaders,andwenow discusswhyapplicationsareoftenoperating-systemspecific.Finally,we haveaddedadiscussionofthe BCC debuggingtoolset.

• Chapter3:Processes simplifiesthediscussionofschedulingsothatit nowincludesonly CPU schedulingissues.Newcoveragedescribesthe memorylayoutofaCprogram,theAndroidprocesshierarchy,Mach messagepassing,andAndroid RPCs.Wehavealsoreplacedcoverageof thetraditional UNIX/Linux init processwithcoverageof systemd.

• Chapter4:ThreadsandConcurrency (previouslyThreads)increasesthe coverageofsupportforconcurrentandparallelprogrammingatthe API andlibrarylevel.WehaverevisedthesectiononJavathreadssothatit nowincludesfuturesandhaveupdatedthecoverageofApple’sGrand CentralDispatchsothatitnowincludesSwift.Newsectionsdiscussforkjoinparallelismusingthefork-joinframeworkinJava,aswellasIntel threadbuildingblocks.

• Chapter5: CPU Scheduling (previouslyChapter6)revisesthecoverageof multilevelqueueandmulticoreprocessingscheduling.Wehaveintegrated coverageof NUMA-awareschedulingissuesthroughout,includinghow thisschedulingaffectsloadbalancing.WealsodiscussrelatedmodificationstotheLinux CFS scheduler.Newcoveragecombinesdiscussionsof round-robinandpriorityscheduling,heterogeneousmultiprocessing,and Windows10scheduling.

• Chapter6:SynchronizationTools (previouslypartofChapter5,Process Synchronization)focusesonvarioustoolsforsynchronizingprocesses. Significantnewcoveragediscussesarchitecturalissuessuchasinstruction reorderinganddelayedwritestobuffers.Thechapteralsointroduceslockfreealgorithmsusingcompare-and-swap(CAS)instructions.Nospecific APIsarepresented;rather,thechapterprovidesanintroductiontorace conditionsandgeneraltoolsthatcanbeusedtopreventdataraces.Details includenewcoverageofmemorymodels,memorybarriers,andliveness issues.

• Chapter7:SynchronizationExamples (previouslypartofChapter5, ProcessSynchronization)introducesclassicalsynchronizationproblems anddiscussesspecific API supportfordesigningsolutionsthatsolve theseproblems.Thechapterincludesnewcoverageof POSIX namedand unnamedsemaphores,aswellasconditionvariables.Anewsectionon Javasynchronizationisincludedaswell.

• Chapter8:Deadlocks (previouslyChapter7)providesminorupdates, includinganewsectiononlivelockandadiscussionofdeadlockasan exampleofalivenesshazard.Thechapterincludesnewcoverageofthe Linux lockdep andthe BCC deadlock detector tools,aswellascoverage ofJavadeadlockdetectionusingthreaddumps.

• Chapter9:MainMemory (previouslyChapter8)includesseveralrevisionsthatbringthechapteruptodatewithrespecttomemorymanage-

mentonmoderncomputersystems.Wehaveaddednewcoverageofthe ARMv864-bitarchitecture,updatedthecoverageofdynamiclinklibraries, andchangedswappingcoveragesothatitnowfocusesonswappingpages ratherthanprocesses.Wehavealsoeliminatedcoverageofsegmentation.

• Chapter10:VirtualMemory (previouslyChapter9)containsseveralrevisions,includingupdatedcoverageofmemoryallocationon NUMA systems andglobalallocationusingafree-framelist.Newcoverageincludescompressedmemory,major/minorpagefaults,andmemorymanagementin LinuxandWindows10.

• Chapter11:Mass-StorageStructure (previouslyChapter10)addscoverageofnonvolatilememorydevices,suchasflashandsolid-statedisks. Hard-driveschedulingissimplified toshowonlycurrentlyusedalgorithms.Alsoincludedareanewsectiononcloudstorage,updatedRAID coverage,andanewdiscussionofobjectstorage.

• Chapter12,I/O (previouslyChapter13)updatesthecoverageof technologiesandperformancenumbers,expandsthecoverageof synchronous/asynchronousandblocking/nonblocking I/O,andaddsa sectiononvectored I/O.Italsoexpandscoverageofpowermanagement formobileoperatingsystems.

• Chapter13:File-SystemInterface (previouslyChapter11)hasbeen updatedwithinformationaboutcurrenttechnologies.Inparticular,the coverageofdirectorystructureshasbeenimproved,andthecoverageof protectionhasbeenupdated.Thememory-mappedfilessectionhasbeen expanded,andaWindows API examplehasbeenaddedtothediscussion ofsharedmemory.TheorderingoftopicsisrefactoredinChapter13and 14.

• Chapter14:File-SystemImplementation (previouslyChapter12)has beenupdatedwithcoverageofcurrenttechnologies.Thechapternow includesdiscussionsof TRIM andtheAppleFileSystem.Inaddition,the discussionofperformancehasbeenupdated,andthecoverageofjournalinghasbeenexpanded.

• Chapter15:FileSystemInternals isnewandcontainsupdatedinformationfrompreviousChapters11and12.

• Chapter16:Security (previouslyChapter15)nowprecedestheprotectionchapter.Itincludesrevisedandupdatedtermsforcurrentsecurity threatsandsolutions,includingransomwareandremoteaccesstools.The principleofleastprivilegeisemphasized.Coverageofcode-injectionvulnerabilitiesandattackshasbeenrevisedandnowincludescodesamples. Discussionofencryptiontechnologieshasbeenupdatedtofocusonthe technologiescurrentlyused.Coverageofauthentication(bypasswords andothermethods)hasbeenupdatedandexpandedwithhelpfulhints. Additionsincludeadiscussionofaddress-spacelayoutrandomizationand anewsummaryofsecuritydefenses.TheWindows7examplehasbeen updatedtoWindows10.

• Chapter17:Protection (previouslyChapter14)containsmajorchanges. Thediscussionofprotectionringsandlayershasbeenupdatedandnow

Preface xv

referstotheBell–LaPadulamodelandexploresthe ARM modelofTrustZonesandSecureMonitorCalls.Coverageoftheneed-to-knowprinciple hasbeenexpanded,ashascoverageofmandatoryaccesscontrol.SubsectionsonLinuxcapabilities,Darwinentitlements,securityintegrityprotection,system-callfiltering,sandboxing,andcodesigninghavebeenadded. Coverageofrun-time-basedenforcementinJavahasalsobeenadded, includingthestackinspectiontechnique.

• Chapter18:VirtualMachines (previouslyChapter16)includesadded detailsabouthardwareassistancetechnologies.Alsoexpandedisthe topicofapplicationcontainment,nowincludingcontainers,zones,docker, andKubernetes.Anewsectiondiscussesongoingvirtualizationresearch, includingunikernels,libraryoperatingsystems,partitioninghypervisors, andseparationhypervisors.

• Chapter19,NetworksandDistributedSystems (previouslyChapter17) hasbeensubstantiallyupdatedandnowcombinescoverageofcomputer networksanddistributedsystems.Thematerialhasbeenrevisedtobring ituptodatewithrespecttocontemporarycomputernetworksanddistributedsystems.The TCP/IP modelreceivesaddedemphasis,andadiscussionofcloudstoragehasbeenadded.Thesectiononnetworktopologieshasbeenremoved.Coverageofnameresolutionhasbeenexpanded andaJavaexampleadded.Thechapteralsoincludesnewcoverageofdistributedfilesystems,includingMapReduceontopofGooglefilesystem, Hadoop, GPFS,andLustre.

• Chapter20:TheLinuxSystem (previouslyChapter18)hasbeenupdated tocovertheLinux4.i kernel.

• Chapter21:TheWindows10System isanewchapterthatcoversthe internalsofWindows10.

• AppendixA:InfluentiaOperatingSystems hasbeenupdatedtoinclude materialfromchaptersthatarenolongercoveredinthetext.

SupportingWebsite

Whenyouvisitthewebsitesupportingthistextat http://www.os-book.com, youcandownloadthefollowingresources:

• Linuxvirtualmachine

• CandJavasourcecode

• Thecompletesetoffiguresandillustrations

• FreeBSD,Mach,andWindows7casestudies

• Errata

• Bibliography

NotestoInstructors

Onthewebsiteforthistext,weprovideseveralsamplesyllabithatsuggestvariousapproachesforusingthetextinbothintroductoryandadvancedcourses.

Asageneralrule,weencourageinstructorstoprogresssequentiallythrough thechapters,asthisstrategyprovidesthemostthoroughstudyofoperatingsystems.However,byusingthesamplesyllabi,aninstructorcanselecta differentorderingofchapters(orsubsectionsofchapters).

Inthisedition,wehaveaddedmanynewwrittenexercisesandprogrammingproblemsandprojects.Mostofthenewprogrammingassignments involveprocesses,threads,processscheduling,processsynchronization,and memorymanagement.SomeinvolveaddingkernelmodulestotheLinuxsystem,whichrequiresusingeithertheLinuxvirtualmachinethataccompanies thistextoranothersuitableLinuxdistribution.

Solutionstowrittenexercisesandprogrammingassignmentsareavailabletoinstructorswhohaveadoptedthistextfortheiroperating-system class.Toobtaintheserestrictedsupplements,contactyourlocalJohnWiley& Sonssalesrepresentative.YoucanfindyourWileyrepresentativebygoingto http://www.wiley.com/college andclicking “Who’smyrep?”

NotestoStudents

Weencourageyoutotakeadvantageofthepracticeexercisesthatappearatthe endofeachchapter.Wealsoencourageyoutoreadthroughthestudyguide, whichwaspreparedbyoneofourstudents.Finally,forstudentswhoareunfamiliarwith UNIX andLinuxsystems,werecommendthatyoudownloadand installtheLinuxvirtualmachinethatweincludeonthesupportingwebsite. Notonlywillthisprovideyouwithanewcomputingexperience,buttheopensourcenatureofLinuxwillallowyoutoeasilyexaminetheinnerdetailsofthis popularoperatingsystem.Wewishyoutheverybestofluckinyourstudyof operatingsystems!

ContactingUs

Wehaveendeavoredtoeliminatetypos,bugs,andthelikefromthetext.But, asinnewreleasesofsoftware,bugsalmostsurelyremain.Anup-to-dateerrata listisaccessiblefromthebook’swebsite.Wewouldbegratefulifyouwould notifyusofanyerrorsoromissionsinthebookthatarenotonthecurrentlist oferrata.

Wewouldbegladtoreceivesuggestionsonimprovementstothebook. Wealsowelcomeanycontributionstothebookwebsitethatcouldbeofuse tootherreaders,suchasprogrammingexercises,projectsuggestions,on-line labsandtutorials,andteachingtips.E-mailshouldbeaddressedto os-bookauthors@cs.yale.edu.

Acknowledgments

ManypeoplehavehelpeduswiththisTenthEdition,aswellaswiththe previousnineeditionsfromwhichitisderived.

TenthEdition

• RickFarrowprovidedexpertadviceasatechnicaleditor.

• JonathanLevinhelpedoutwithcoverageofmobilesystems,protection, andsecurity.

• AlexIonescuupdatedthepreviousWindows7chaptertoprovideChapter 21:Windows10.

• SarahDiesburgrevisedChapter19:NetworksandDistributedSystems.

• BrendanGreggprovidedguidanceonthe BCC toolset.

• RichardStallman(RMS)suppliedfeedbackonthedescriptionoffreeand open-sourcesoftware.

• RobertLoveprovidedupdatestoChapter20:TheLinuxSystem.

• MichaelShapirohelpedwithstorageand I/O technologydetails.

• RichardWestprovidedinsightonareasofvirtualizationresearch.

• ClayBreshearshelpedwithcoverageofIntelthread-buildingblocks.

• GerryHowsergavefeedbackonmotivatingthestudyofoperatingsystems andalsotriedoutnewmaterialinhisclass.

• JudiPaigehelpedwithgeneratingfiguresandpresentationofslides.

• JayGagneandAudraRissmeyerpreparednewartworkforthisedition.

• OwenGalvinprovidedtechnicaleditingforChapter11andChapter12.

• MarkWogahnhasmadesurethatthesoftwaretoproducethisbook(LATEX andfonts)worksproperly.

• RanjanKumarMeherrewrotesomeofthe LATEX softwareusedintheproductionofthisnewtext.

PreviousEditions

• Firstthreeeditions.Thisbookisderivedfromthepreviouseditions,the firstthreeofwhichwerecoauthoredbyJamesPeterson.

• Generalcontributions.Otherswhohelpeduswithpreviouseditions includeHamidArabnia,RidaBazzi,RandyBentson,DavidBlack,Joseph Boykin,JeffBrumfield,GaelBuckley,RoyCampbell,P.C.Capon,John Carpenter,GilCarrick,ThomasCasavant,BartChilds,AjoyKumarDatta, JoeDeck,SudarshanK.Dhall,ThomasDoeppner,CalebDrake,M.Rasit Eskicio ˘ glu,HansFlack,RobertFowler,G.ScottGraham,RichardGuy, MaxHailperin,RebeccaHartman,WayneHathaway,ChristopherHaynes, DonHeller,BruceHillyer,MarkHolliday,DeanHougen,MichaelHuang, AhmedKamel,MortyKewstel,RichardKieburtz,CarolKroll,Morty Kwestel,ThomasLeBlanc,JohnLeggett,JerroldLeichter,TedLeung,Gary Lippman,CarolynMiller,MichaelMolloy,EuripidesMontagne,Yoichi Muraoka,JimM.Ng,Banu ¨ Ozden,EdPosnak,BorisPutanec,Charles

Qualline,JohnQuarterman,MikeReiter,GustavoRodriguez-Rivera, CarolynJ.C.Schauble,ThomasP.Skinner,YannisSmaragdakis,Jesse St.Laurent,JohnStankovic,AdamStauffer,StevenStepanek,John Sterling,HalStern,LouisStevens,PeteThomas,DavidUmbaugh,Steve Vinoski,TommyWagner,LarryL.Wear,JohnWerth,JamesM.Westall,J. S.Weston,andYangXiang

• SpecifiContributions

◦ RobertLoveupdatedbothChapter20andtheLinuxcoveragethroughoutthetext,aswellasansweringmanyofourAndroid-relatedquestions.

◦ AppendixBwaswrittenbyDaveProbertandwasderivedfromChapter22oftheEighthEditionof OperatingSystemConcepts.

◦ JonathanKatzcontributedtoChapter16.RichardWestprovidedinput intoChapter18.SalahuddinKhanupdatedSection16.7toprovidenew coverageofWindows7security.

◦ PartsofChapter19werederivedfromapaperbyLevyandSilberschatz [1990].

◦ Chapter20wasderivedfromanunpublishedmanuscriptbyStephen Tweedie.

◦ CliffMartinhelpedwithupdatingthe UNIX appendixtocover FreeBSD.

◦ Someoftheexercisesandaccompanyingsolutionsweresuppliedby ArvindKrishnamurthy.

◦ AndrewDeNicolapreparedthestudentstudyguidethatisavailableon ourwebsite.SomeoftheslideswerepreparedbyMarilynTurnamian.

◦ MikeShapiro,BryanCantrill,andJimMauroansweredseveralSolarisrelatedquestions,andBryanCantrillfromSunMicrosystemshelped withthe ZFS coverage.JoshDeesandRobReynoldscontributedcoverageofMicrosoft’s NET.

◦ OwenGalvinhelpedcopy-editChapter18edition.

BookProduction

TheExecutiveEditorwasDonFowley.TheSeniorProductionEditorwasKen Santor.TheFreelanceDevelopmentalEditorwasChrisNelson.TheAssistant DevelopmentalEditorwasRyannDannelly.ThecoverdesignerwasTomNery. ThecopyeditorwasBeverlyPeavler.ThefreelanceproofreaderwasKatrina Avery.ThefreelanceindexerwasWordCo,Inc.TheAptaraLaTexteamconsistedofNeerajSaxenaandLavkush.

PersonalNotes

AviwouldliketoacknowledgeValerieforherlove,patience,andsupport duringtherevisionofthisbook.

Preface xix

PeterwouldliketothankhiswifeCarlaandhischildren,Gwen,Owen, andMaddie.

Gregwouldliketoacknowledgethecontinuedsupportofhisfamily:his wifePatandsonsThomasandJay.

AbrahamSilberschatz,NewHaven,CT PeterBaerGalvin,Boston,MA GregGagne,SaltLakeCity,UT

Contents

PARTONE OVERVIEW

Chapter1Introduction

1.1WhatOperatingSystemsDo4

1.2Computer-SystemOrganization7

1.3Computer-SystemArchitecture15

1.4Operating-SystemOperations21

1.5ResourceManagement27

1.6SecurityandProtection33

1.7Virtualization34

1.8DistributedSystems35

1.9KernelDataStructures36

1.10ComputingEnvironments40

1.11FreeandOpen-SourceOperating Systems46 PracticeExercises53 FurtherReading54

Chapter2Operating-SystemStructures

2.1Operating-SystemServices55

2.2UserandOperating-System Interface58

2.3SystemCalls62

2.4SystemServices74

2.5LinkersandLoaders75

2.6WhyApplicationsAre Operating-SystemSpecific77

2.7Operating-SystemDesignand Implementation79

2.8Operating-SystemStructure81

2.9BuildingandBootinganOperating System92

2.10Operating-SystemDebugging95

2.11Summary100 PracticeExercises101 FurtherReading101

PARTTWO PROCESSMANAGEMENT

Chapter3Processes

3.1ProcessConcept106

3.2ProcessScheduling110

3.3OperationsonProcesses116

3.4InterprocessCommunication123

3.5IPCinShared-MemorySystems125

3.6IPCinMessage-PassingSystems127

3.7ExamplesofIPCSystems132

3.8CommunicationinClient–ServerSystems145

3.9Summary153 PracticeExercises154 FurtherReading156

Contents

Chapter4Threads&Concurrency

4.1Overview160

4.2MulticoreProgramming162

4.3MultithreadingModels166

4.4ThreadLibraries168

4.5ImplicitThreading176

Chapter5CPUScheduling

5.1BasicConcepts200

5.2SchedulingCriteria204

5.3SchedulingAlgorithms205

5.4ThreadScheduling217

5.5Multi-ProcessorScheduling220

5.6Real-TimeCPUScheduling227

4.6ThreadingIssues188

4.7Operating-SystemExamples194

4.8Summary196 PracticeExercises197 FurtherReading198

5.7Operating-SystemExamples234

5.8AlgorithmEvaluation244

5.9Summary250 PracticeExercises251 FurtherReading254

PARTTHREE PROCESSSYNCHRONIZATION

Chapter6SynchronizationTools

6.1Background257

6.2TheCritical-SectionProblem260

6.3Peterson’sSolution262

6.4HardwareSupportfor Synchronization265

6.5MutexLocks270

6.6Semaphores272

6.7Monitors276

6.8Liveness283

6.9Evaluation284

6.10Summary286 PracticeExercises287 FurtherReading288

Chapter7SynchronizationExamples

7.1ClassicProblemsof Synchronization289

7.2Synchronization withintheKernel295

7.3POSIXSynchronization299

7.4SynchronizationinJava303

Chapter8Deadlocks

8.1SystemModel318

8.2DeadlockinMultithreaded Applications319

8.3DeadlockCharacterization321

8.4MethodsforHandlingDeadlocks326

8.5DeadlockPrevention327

7.5AlternativeApproaches311

7.6Summary314 PracticeExercises314 FurtherReading315

8.6DeadlockAvoidance330

8.7DeadlockDetection337

8.8RecoveryfromDeadlock341

8.9Summary343 PracticeExercises344 FurtherReading346

PARTFOUR MEMORYMANAGEMENT

Chapter9MainMemory

9.1Background349

9.2ContiguousMemoryAllocation356

9.3Paging360

9.4StructureofthePageTable371

9.5Swapping376

Chapter10VirtualMemory

10.1Background389

10.2DemandPaging392

10.3Copy-on-Write399

10.4PageReplacement401

10.5AllocationofFrames413

10.6Thrashing419

10.7MemoryCompression425

9.6Example:Intel32-and64-bit Architectures379

9.7Example:ARMv8Architecture383

9.8Summary384 PracticeExercises385 FurtherReading387

10.8AllocatingKernelMemory426

10.9OtherConsiderations430

10.10Operating-SystemExamples436

10.11Summary440 PracticeExercises441 FurtherReading444

PARTFIVE STORAGEMANAGEMENT

Chapter11Mass-StorageStructure

11.1OverviewofMass-Storage Structure449

11.2HDDScheduling457

11.3NVMScheduling461

11.4ErrorDetectionandCorrection462

11.5StorageDeviceManagement463

Chapter12I/OSystems

12.1Overview489

12.2I/OHardware490

12.3ApplicationI/OInterface500

12.4KernelI/OSubsystem508

12.5TransformingI/ORequeststo HardwareOperations516

11.6Swap-SpaceManagement467

11.7StorageAttachment469

11.8RAIDStructure473

11.9Summary485 PracticeExercises486 FurtherReading487

12.6STREAMS519

12.7Performance521

12.8Summary524 PracticeExercises525 FurtherReading526

PARTSIX FILESYSTEM

Chapter13File-SystemInterface

13.1FileConcept529

13.2AccessMethods539

13.3DirectoryStructure541

13.4Protection550

13.5Memory-MappedFiles555

13.6Summary560 PracticeExercises560 FurtherReading561

Chapter14File-SystemImplementation

14.1File-SystemStructure564

14.2File-SystemOperations566

14.3DirectoryImplementation568

14.4AllocationMethods570

14.5Free-SpaceManagement578

14.6EfficiencyandPerformance582

14.7Recovery586

14.8Example:TheWAFLFileSystem589

14.9Summary593 PracticeExercises594 FurtherReading594

Chapter15File-SystemInternals

15.1FileSystems597

15.2File-SystemMounting598

15.3PartitionsandMounting601

15.4FileSharing602

15.5VirtualFileSystems603

15.6RemoteFileSystems605

15.7ConsistencySemantics608

15.8NFS610

15.9Summary615 PracticeExercises616 FurtherReading617

PARTSEVEN SECURITYANDPROTECTION

Chapter16Security

16.1TheSecurityProblem621

16.2ProgramThreats625

16.3SystemandNetworkThreats634

16.4CryptographyasaSecurityTool637

16.5UserAuthentication648

Chapter17Protection

17.1GoalsofProtection667

17.2PrinciplesofProtection668

17.3ProtectionRings669

17.4DomainofProtection671

17.5AccessMatrix675

17.6ImplementationoftheAccess Matrix679

17.7RevocationofAccessRights682

17.8Role-BasedAccessControl683

16.6ImplementingSecurityDefenses653

16.7AnExample:Windows10662

16.8Summary664 FurtherReading665

17.9MandatoryAccessControl (MAC)684

17.10Capability-BasedSystems685

17.11OtherProtectionImprovement Methods687

17.12Language-BasedProtection690

17.13Summary696 FurtherReading697

PARTEIGHT ADVANCEDTOPICS

Chapter18VirtualMachines

18.1Overview701

18.2History703

18.3BenefitsandFeatures704

18.4BuildingBlocks707

18.5TypesofVMsandTheir Implementations713

18.6VirtualizationandOperating-System Components719

18.7Examples726

18.8VirtualizationResearch728

18.9Summary729 FurtherReading730

Chapter19NetworksandDistributedSystems

19.1AdvantagesofDistributed Systems733

19.2NetworkStructure735

19.3CommunicationStructure738

19.4NetworkandDistributedOperating Systems749

19.5DesignIssuesinDistributed Systems753

19.6DistributedFileSystems757

19.7DFSNamingandTransparency761

19.8RemoteFileAccess764

19.9FinalThoughtsonDistributedFile Systems767

19.10Summary768 PracticeExercises769 FurtherReading770

PARTNINE CASESTUDIES

Chapter20TheLinuxSystem

20.1LinuxHistory775

20.2DesignPrinciples780

20.3KernelModules783

20.4ProcessManagement786

20.5Scheduling790

20.6MemoryManagement795

20.7FileSystems803

Chapter21Windows10

21.1History821

21.2DesignPrinciples826

21.3SystemComponents838

21.4TerminalServicesandFastUser Switching874

20.8InputandOutput810

20.9InterprocessCommunication812

20.10NetworkStructure813

20.11Security816

20.12Summary818 PracticeExercises819 FurtherReading819

21.5FileSystem875

21.6Networking880

21.7ProgrammerInterface884

21.8Summary895 PracticeExercises896 FurtherReading897

PARTTEN APPENDICES

ChapterAInfluentiaOperatingSystems

A.1FeatureMigration1

A.2EarlySystems2

A.3Atlas9

A.4XDS-94010

A.5THE11

A.6RC400011

A.7CTSS12

A.8MULTICS13

A.9IBMOS/36013

ChapterBWindows7

B.1History1

B.2DesignPrinciples3

B.3SystemComponents10

B.4TerminalServicesandFastUser Switching34

B.5FileSystem35

ChapterCBSDUNIX

C.1UNIXHistory1

C.2DesignPrinciples6

C.3ProgrammerInterface8

C.4UserInterface15

C.5ProcessManagement18

C.6MemoryManagement22

ChapterDTheMachSystem

D.1HistoryoftheMachSystem1

D.2DesignPrinciples3

D.3SystemComponents4

D.4ProcessManagement7

D.5InterprocessCommunication13

Credits 963

Index 965

A.10TOPS-2015

A.11CP/MandMS/DOS15

A.12MacintoshOperatingSystemand Windows16

A.13Mach16

A.14Capability-basedSystems—Hydraand CAP18

A.15OtherSystems20 FurtherReading21

B.6Networking41

B.7ProgrammerInterface46

B.8Summary55 PracticeExercises55 FurtherReading56

C.7FileSystem25

C.8I/OSystem33

C.9InterprocessCommunication36

C.10Summary41 FurtherReading42

D.6MemoryManagement18

D.7ProgrammerInterface23

D.8Summary24 FurtherReading25

PartOne Overview

An operatingsystem actsasanintermediarybetweentheuserofacomputerandthecomputerhardware.Thepurposeofanoperatingsystem istoprovideanenvironmentinwhichausercanexecuteprogramsina convenient and efficient manner.

Anoperatingsystemissoftwarethatmanagesthecomputerhardware.Thehardwaremustprovideappropriatemechanismstoensurethe correctoperationofthecomputer systemandtopreventprogramsfrom interferingwiththeproperoperationofthesystem.

Internally,operatingsystemsvarygreatlyintheirmakeup,sincethey areorganizedalongmanydifferentlines.Thedesignofanewoperating systemisamajortask,anditisimportantthatthegoalsofthesystembe welldefinedbeforethedesignbegins.

Becauseanoperatingsystemislargeandcomplex,itmustbecreatedpiecebypiece.Eachofthesepiecesshouldbeawell-delineated portionofthesystem,withcarefully definedinputs,outputs,andfunctions.

1 CHAPTER

Introduction

An operatingsystem issoftwarethatmanagesacomputer’shardware.It alsoprovidesabasisforapplicationprogramsandactsasanintermediary betweenthecomputeruserandthecomputerhardware.Anamazingaspect ofoperatingsystemsishowtheyvaryinaccomplishingthesetasksinawide varietyofcomputingenvironments.Operatingsystemsareeverywhere,from carsandhomeappliancesthatinclude “InternetofThings” devices,tosmart phones,personalcomputers,enterprisecomputers,andcloudcomputingenvironments.

Inordertoexploretheroleofanoperatingsysteminamoderncomputing environment,itisimportantfirsttounderstandtheorganizationandarchitectureofcomputerhardware.Thisincludesthe CPU,memory,and I/O devices, aswellasstorage.Afundamentalresponsibilityofanoperatingsystemisto allocatetheseresourcestoprograms.

Becauseanoperatingsystemislargeandcomplex,itmustbecreated piecebypiece.Eachofthesepiecesshouldbeawell-delineatedportionofthe system,withcarefullydefinedinputs,outputs,andfunctions.Inthischapter, weprovideageneraloverviewofthemajorcomponentsofacontemporary computersystemaswellasthefunctionsprovidedbytheoperatingsystem. Additionally,wecoverseveraltopicstohelpsetthestagefortheremainderof thetext:datastructuresusedinoperatingsystems,computingenvironments, andopen-sourceandfreeoperatingsystems.

CHAPTEROBJECTIVES

• Describethegeneralorganizationofacomputersystemandtheroleof interrupts.

• Describethecomponentsinamodernmultiprocessorcomputersystem.

• Illustratethetransitionfromusermodetokernelmode.

• Discusshowoperatingsystemsareusedinvariouscomputingenvironments.

• Provideexamplesoffreeandopen-sourceoperatingsystems.

1.1 WhatOperatingSystemsDo

Webeginourdiscussionbylookingattheoperatingsystem’sroleinthe overallcomputersystem.Acomputersystemcanbedividedroughlyintofour components:the hardware, the operatingsystem, the applicationprograms, anda user (Figure1.1).

The hardware —thecentralprocessingunit(CPU),thememory,andthe input/output(I/O)devices—providesthebasiccomputingresourcesforthe system.The applicationprograms —suchaswordprocessors,spreadsheets, compilers,andwebbrowsers—definethewaysinwhichtheseresourcesare usedtosolveusers’computingproblems.Theoperatingsystemcontrolsthe hardwareandcoordinatesitsuseamongthevariousapplicationprogramsfor thevarioususers.

Wecanalsoviewacomputersystemasconsistingofhardware,software, anddata.Theoperatingsystemprovidesthemeansforproperuseofthese resourcesintheoperationofthecomputersystem.Anoperatingsystemis similartoagovernment.Likeagovernment,itperformsnousefulfunction byitself.Itsimplyprovidesan environment withinwhichotherprogramscan dousefulwork.

Tounderstandmorefullytheoperatingsystem’srole,wenextexplore operatingsystemsfromtwoviewpoints:thatoftheuserandthatofthesystem.

1.1.1UserView

Theuser’sviewofthecomputervariesaccordingtotheinterfacebeingused. Manycomputeruserssitwithalaptoporinfrontofa PC consistingofa monitor,keyboard,andmouse.Suchasystemisdesignedforoneuserto monopolizeitsresources.Thegoalistomaximizethework(orplay)thatthe userisperforming.Inthiscase,theoperatingsystemisdesignedmostlyfor easeofuse,withsomeattentionpaidtoperformanceandsecurityandnone paidto resourceutilization —howvarioushardwareandsoftwareresources areshared.

Figure1.1 Abstractviewofthecomponentsofacomputersystem.

Increasingly,manyusersinteractwithmobiledevicessuchassmartphones andtablets—devicesthatarereplacingdesktopandlaptopcomputersystems forsomeusers.Thesedevicesaretypicallyconnectedtonetworksthrough cellularorotherwirelesstechnologies.Theuserinterfaceformobilecomputers generallyfeaturesa touchscreen,wheretheuserinteractswiththesystemby pressingandswipingfingersacrossthescreenratherthanusingaphysical keyboardandmouse.Manymobiledevicesalsoallowuserstointeractthrough a voicerecognition interface,suchasApple’s Siri. Somecomputershavelittleornouserview.Forexample, embeddedcomputers inhomedevicesandautomobilesmayhavenumerickeypadsandmay turnindicatorlightsonorofftoshowstatus,buttheyandtheiroperatingsystemsandapplicationsaredesignedprimarilytorunwithoutuserintervention.

1.1.2SystemView

Fromthecomputer’spointofview,theoperatingsystemistheprogrammost intimatelyinvolvedwiththehardware.Inthiscontext,wecanviewanoperatingsystemasa resourceallocator.Acomputersystemhasmanyresources thatmayberequiredtosolveaproblem: CPU time,memoryspace,storage space, I/O devices,andsoon.Theoperatingsystemactsasthemanagerofthese resources.Facingnumerousandpossiblyconflictingrequestsforresources,the operatingsystemmustdecidehowtoallocatethemtospecificprogramsand userssothatitcanoperatethecomputersystemefficientlyandfairly.

Aslightlydifferentviewofanoperatingsystememphasizestheneedto controlthevarious I/O devicesanduserprograms.Anoperatingsystemisa controlprogram.A controlprogram managestheexecutionofuserprograms topreventerrorsandimproperuseofthecomputer.Itisespeciallyconcerned withtheoperationandcontrolof I/O devices.

1.1.3DefiningOperatingSystems

Bynow,youcanprobablyseethattheterm operatingsystem coversmany rolesandfunctions.Thatisthecase,atleastinpart,becauseofthemyriad designsandusesofcomputers.Computersarepresentwithintoasters,cars, ships,spacecraft,homes,andbusinesses.Theyarethebasisforgamemachines, cable TV tuners,andindustrialcontrolsystems.

Toexplainthisdiversity,wecanturntothehistoryofcomputers.Although computershavearelativelyshorthistory,theyhaveevolvedrapidly.Computingstartedasanexperimenttodeterminewhatcouldbedoneandquickly movedtofixed-purposesystemsformilitaryuses,suchascodebreakingand trajectoryplotting,andgovernmentaluses,suchascensuscalculation.Those earlycomputersevolvedintogeneral-purpose,multifunctionmainframes,and that’swhenoperatingsystemswereborn.Inthe1960s, Moore’sLaw predicted thatthenumberoftransistorsonanintegratedcircuitwoulddoubleevery18 months,andthatpredictionhasheldtrue.Computersgainedinfunctionality andshrankinsize,leadingtoavastnumberofusesandavastnumberand varietyofoperatingsystems.(SeeAppendixAformoredetailsonthehistory ofoperatingsystems.)

How,then,canwedefinewhatanoperatingsystemis?Ingeneral,wehave nocompletelyadequatedefinitionofan operatingsystem.Operatingsystems

existbecausetheyofferareasonablewaytosolvetheproblemofcreating ausablecomputingsystem.Thefundamentalgoalofcomputersystemsis toexecuteprogramsandtomakesolvinguserproblemseasier.Computer hardwareisconstructedtowardthisgoal.Sincebarehardwarealoneisnot particularlyeasytouse,applicationprogramsaredeveloped.Theseprograms requirecertaincommonoperations,suchasthosecontrollingthe I/O devices. Thecommonfunctionsofcontrollingandallocatingresourcesarethenbrought togetherintoonepieceofsoftware:theoperatingsystem.

Inaddition,wehavenouniversallyaccepteddefinitionofwhatispartof theoperatingsystem.Asimpleviewpointisthatitincludeseverythingavendorshipswhenyouorder “theoperatingsystem.” Thefeaturesincluded,however,varygreatlyacrosssystems.Somesystemstakeuplessthanamegabyte ofspaceandlackevenafull-screeneditor,whereasothersrequiregigabytes ofspaceandarebasedentirelyongraphicalwindowingsystems.Amorecommondefinition,andtheonethatweusuallyfollow,isthattheoperatingsystem istheoneprogramrunningatalltimesonthecomputer—usuallycalledthe kernel.Alongwiththekernel,therearetwoothertypesofprograms: system programs,whichareassociatedwiththeoperatingsystembutarenotnecessarilypartofthekernel,andapplicationprograms,whichincludeallprograms notassociatedwiththeoperationofthesystem.

Thematterofwhatconstitutesanoperatingsystembecameincreasingly importantaspersonalcomputersbecamemorewidespreadandoperatingsystemsgrewincreasinglysophisticated.In1998,theUnitedStatesDepartmentof JusticefiledsuitagainstMicrosoft,inessenceclaimingthatMicrosoftincluded toomuchfunctionalityinitsoperatingsystemsandthuspreventedapplication vendorsfromcompeting.(Forexample,awebbrowserwasanintegralpartof Microsoft’soperatingsystems.)Asaresult,Microsoftwasfoundguiltyofusing itsoperating-systemmonopolytolimitcompetition.

Today,however,ifwelookatoperatingsystemsformobiledevices,we seethatonceagainthenumberoffeaturesconstitutingtheoperatingsystem isincreasing.Mobileoperatingsystemsoftenincludenotonlyacorekernel butalso middleware —asetofsoftwareframeworksthatprovideadditional servicestoapplicationdevelopers.Forexample,eachofthetwomostprominentmobileoperatingsystems—Apple’siOS andGoogle’sAndroid—features

WHYSTUDYOPERATINGSYSTEMS?

Althoughtherearemanypractitionersofcomputerscience,onlyasmallpercentageofthemwillbeinvolvedinthecreationormodificationofanoperatingsystem.Why,then,studyoperatingsystemsandhowtheywork?Simply because,asalmostallcoderunsontopofanoperatingsystem,knowledge ofhowoperatingsystemsworkiscrucialtoproper,efficient,effective,and secureprogramming.Understandingthefundamentalsofoperatingsystems, howtheydrivecomputerhardware,andwhattheyprovidetoapplicationsis notonlyessentialtothosewhoprogramthembutalsohighlyusefultothose whowriteprogramsonthemandusethem.

7 acorekernelalongwithmiddlewarethatsupportsdatabases,multimedia,and graphics(tonameonlyafew).

Insummary,forourpurposes,theoperatingsystemincludesthealwaysrunningkernel,middlewareframeworksthateaseapplicationdevelopment andprovidefeatures,andsystemprogramsthataidinmanagingthesystem whileitisrunning.Mostofthistextisconcernedwiththekernelofgeneralpurposeoperatingsystems,butothercomponentsarediscussedasneededto fullyexplainoperatingsystemdesignandoperation.

1.2 Computer-SystemOrganization

Amoderngeneral-purposecomputersystemconsistsofoneormore CPUsand anumberofdevicecontrollersconnectedthroughacommon bus thatprovides accessbetweencomponentsandsharedmemory(Figure1.2).Eachdevice controllerisinchargeofaspecifictypeofdevice(forexample,adiskdrive, audiodevice,orgraphicsdisplay).Dependingonthecontroller,morethanone devicemaybeattached.Forinstance,onesystem USB portcanconnecttoa USB hub,towhichseveraldevicescanconnect.Adevicecontrollermaintains somelocalbufferstorageandasetofspecial-purposeregisters.Thedevice controllerisresponsibleformovingthedatabetweentheperipheraldevices thatitcontrolsanditslocalbufferstorage.

Typically,operatingsystemshavea devicedriver foreachdevicecontroller.Thisdevicedriverunderstandsthedevicecontrollerandprovidesthe restoftheoperatingsystemwithauniforminterfacetothedevice.The CPU and thedevicecontrollerscanexecuteinparallel,competingformemorycycles.To ensureorderlyaccesstothesharedmemory,amemorycontrollersynchronizes accesstothememory.

Inthefollowingsubsections,wedescribesomebasicsofhowsuchasystem operates,focusingonthreekeyaspectsofthesystem.Westartwithinterrupts, whichalertthe CPU toeventsthatrequireattention.Wethendiscussstorage structureand I/O structure.

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.