加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 深入理解Linux内核第3版

深入理解Linux内核第3版.pdf

深入理解Linux内核第3版

aaron
2010-10-08 0人阅读 举报 0 0 暂无简介

简介:本文档为《深入理解Linux内核第3版pdf》,可适用于IT/计算机领域

UnderstandingtheLinuxKernel,rdEditionByDanielPBovet,MarcoCesatiPublisher:O'ReillyPubDate:NovemberISBN:Pages:TableofContents|IndexInordertothoroughlyunderstandwhatmakesLinuxtickandwhyitworkssowellonawidevarietyofsystems,youneedtodelvedeepintotheheartofthekernelThekernelhandlesallinteractionsbetweentheCPUandtheexternalworld,anddetermineswhichprogramswillshareprocessortime,inwhatorderItmanageslimitedmemorysowellthathundredsofprocessescansharethesystemefficiently,andexpertlyorganizesdatatransferssothattheCPUisn'tkeptwaitinganylongerthannecessaryfortherelativelyslowdisksThethirdeditionofUnderstandingtheLinuxKerneltakesyouonaguidedtourofthemostsignificantdatastructures,algorithms,andprogrammingtricksusedinthekernelProbingbeyondsuperficialfeatures,theauthorsoffervaluableinsightstopeoplewhowanttoknowhowthingsreallyworkinsidetheirmachineImportantIntelspecificfeaturesarediscussedRelevantsegmentsofcodearedissectedlinebylineButthebookcoversmorethanjustthefunctioningofthecodeitexplainsthetheoreticalunderpinningsofwhyLinuxdoesthingsthewayitdoesThiseditionofthebookcoversVersion,whichhasseensignificantchangestonearlyeverykernelsubsystem,particularlyintheareasofmemorymanagementandblockdevicesThebookfocusesonthefollowingtopics:Memorymanagement,includingfilebuffering,processswapping,andDirectmemoryAccess(DMA)TheVirtualFilesystemlayerandtheSecondandThirdExtendedFilesystemsProcesscreationandschedulingSignals,interrupts,andtheessentialinterfacestodevicedriversTimingSynchronizationwithinthekernelInterprocessCommunication(IPC)ProgramexecutionUnderstandingtheLinuxKernelwillacquaintyouwithalltheinnerworkingsofLinux,butit'smorethanjustanacademicexerciseYou'lllearnwhatconditionsbringoutLinux'sbestperformance,andyou'llseehowitmeetsthechallengeofprovidinggoodsystemresponseduringprocessscheduling,fileaccess,andmemorymanagementinawidevarietyofenvironmentsThisbookwillhelpyoumakethemostofyourLinuxsystemUnderstandingtheLinuxKernel,rdEditionByDanielPBovet,MarcoCesatiPublisher:O'ReillyPubDate:NovemberISBN:Pages:TableofContents|IndexInordertothoroughlyunderstandwhatmakesLinuxtickandwhyitworkssowellonawidevarietyofsystems,youneedtodelvedeepintotheheartofthekernelThekernelhandlesallinteractionsbetweentheCPUandtheexternalworld,anddetermineswhichprogramswillshareprocessortime,inwhatorderItmanageslimitedmemorysowellthathundredsofprocessescansharethesystemefficiently,andexpertlyorganizesdatatransferssothattheCPUisn'tkeptwaitinganylongerthannecessaryfortherelativelyslowdisksThethirdeditionofUnderstandingtheLinuxKerneltakesyouonaguidedtourofthemostsignificantdatastructures,algorithms,andprogrammingtricksusedinthekernelProbingbeyondsuperficialfeatures,theauthorsoffervaluableinsightstopeoplewhowanttoknowhowthingsreallyworkinsidetheirmachineImportantIntelspecificfeaturesarediscussedRelevantsegmentsofcodearedissectedlinebylineButthebookcoversmorethanjustthefunctioningofthecodeitexplainsthetheoreticalunderpinningsofwhyLinuxdoesthingsthewayitdoesThiseditionofthebookcoversVersion,whichhasseensignificantchangestonearlyeverykernelsubsystem,particularlyintheareasofmemorymanagementandblockdevicesThebookfocusesonthefollowingtopics:Memorymanagement,includingfilebuffering,processswapping,andDirectmemoryAccess(DMA)TheVirtualFilesystemlayerandtheSecondandThirdExtendedFilesystemsProcesscreationandschedulingSignals,interrupts,andtheessentialinterfacestodevicedriversTimingSynchronizationwithinthekernelInterprocessCommunication(IPC)ProgramexecutionUnderstandingtheLinuxKernelwillacquaintyouwithalltheinnerworkingsofLinux,butit'smorethanjustanacademicexerciseYou'lllearnwhatconditionsbringoutLinux'sbestperformance,andyou'llseehowitmeetsthechallengeofprovidinggoodsystemresponseduringprocessscheduling,fileaccess,andmemorymanagementinawidevarietyofenvironmentsThisbookwillhelpyoumakethemostofyourLinuxsystemUnderstandingtheLinuxKernel,rdEditionByDanielPBovet,MarcoCesatiPublisher:O'ReillyPubDate:NovemberISBN:Pages:TableofContents|IndexCopyrightPrefaceTheAudienceforThisBookOrganizationoftheMaterialLevelofDescriptionOverviewoftheBookBackgroundInformationConventionsinThisBookHowtoContactUsSafari®EnabledAcknowledgmentsChapterIntroductionSectionLinuxVersusOtherUnixLikeKernelsSectionHardwareDependencySectionLinuxVersionsSectionBasicOperatingSystemConceptsSectionAnOverviewoftheUnixFilesystemSectionAnOverviewofUnixKernelsChapterMemoryAddressingSectionMemoryAddressesSectionSegmentationinHardwareSectionSegmentationinLinuxSectionPaginginHardwareSectionPaginginLinuxChapterProcessesSectionProcesses,LightweightProcesses,andThreadsSectionProcessDescriptorSectionProcessSwitchSectionCreatingProcessesSectionDestroyingProcessesChapterInterruptsandExceptionsSectionTheRoleofInterruptSignalsSectionInterruptsandExceptionsSectionNestedExecutionofExceptionandInterruptHandlersSectionInitializingtheInterruptDescriptorTableSectionExceptionHandlingSectionInterruptHandlingSectionSoftirqsandTaskletsSectionWorkQueuesSectionReturningfromInterruptsandExceptionsChapterKernelSynchronizationSectionHowtheKernelServicesRequestsSectionSynchronizationPrimitivesSectionSynchronizingAccessestoKernelDataStructuresSectionExamplesofRaceConditionPreventionChapterTimingMeasurementsSectionClockandTimerCircuitsSectionTheLinuxTimekeepingArchitectureSectionUpdatingtheTimeandDateSectionUpdatingSystemStatisticsSectionSoftwareTimersandDelayFunctionsSectionSystemCallsRelatedtoTimingMeasurementsChapterProcessSchedulingSectionSchedulingPolicySectionTheSchedulingAlgorithmSectionDataStructuresUsedbytheSchedulerSectionFunctionsUsedbytheSchedulerSectionRunqueueBalancinginMultiprocessorSystemsSectionSystemCallsRelatedtoSchedulingChapterMemoryManagementSectionPageFrameManagementSectionMemoryAreaManagementSectionNoncontiguousMemoryAreaManagementChapterProcessAddressSpaceSectionTheProcess'sAddressSpaceSectionTheMemoryDescriptorSectionMemoryRegionsSectionPageFaultExceptionHandlerSectionCreatingandDeletingaProcessAddressSpaceSectionManagingtheHeapChapterSystemCallsSectionPOSIXAPIsandSystemCallsSectionSystemCallHandlerandServiceRoutinesSectionEnteringandExitingaSystemCallSectionParameterPassingSectionKernelWrapperRoutinesChapterSignalsSectionTheRoleofSignalsSectionGeneratingaSignalSectionDeliveringaSignalSectionSystemCallsRelatedtoSignalHandlingChapterTheVirtualFilesystemSectionTheRoleoftheVirtualFilesystem(VFS)SectionVFSDataStructuresSectionFilesystemTypesSectionFilesystemHandlingSectionPathnameLookupSectionImplementationsofVFSSystemCallsSectionFileLockingChapterIOArchitectureandDeviceDriversSectionIOArchitectureSectionTheDeviceDriverModelSectionDeviceFilesSectionDeviceDriversSectionCharacterDeviceDriversChapterBlockDeviceDriversSectionBlockDevicesHandlingSectionTheGenericBlockLayerSectionTheIOSchedulerSectionBlockDeviceDriversSectionOpeningaBlockDeviceFileChapterThePageCacheSectionThePageCacheSectionStoringBlocksinthePageCacheSectionWritingDirtyPagestoDiskSectionThesync(),fsync(),andfdatasync()SystemCallsChapterAccessingFilesSectionReadingandWritingaFileSectionMemoryMappingSectionDirectIOTransfersSectionAsynchronousIOChapterPageFrameReclaimingSectionThePageFrameReclaimingAlgorithmSectionReverseMappingSectionImplementingthePFRASectionSwappingChapterTheExtandExtFilesystemsSectionGeneralCharacteristicsofExtSectionExtDiskDataStructuresSectionExtMemoryDataStructuresSectionCreatingtheExtFilesystemSectionExtMethodsSectionManagingExtDiskSpaceSectionTheExtFilesystemChapterProcessCommunicationSectionPipesSectionFIFOsSectionSystemVIPCSectionPOSIXMessageQueuesChapterProgramExZecutionSectionExecutableFilesSectionExecutableFormatsSectionExecutionDomainsSectionTheexecFunctionsAppendixASystemStartupSectionAPrehistoricAge:theBIOSSectionAAncientAge:theBootLoaderSectionAMiddleAges:thesetup()FunctionSectionARenaissance:thestartup()FunctionsSectionAModernAge:thestartkernel()FunctionAppendixBModulesSectionBToBe(aModule)orNottoBeSectionBModuleImplementationSectionBLinkingandUnlinkingModulesSectionBLinkingModulesonDemandBibliographyBooksonUnixKernelsBooksontheLinuxKernelBooksonPCArchitectureandTechnicalManualsonIntelMicroprocessorsOtherOnlineDocumentationSourcesResearchPapersRelatedtoLinuxDevelopmentAbouttheAuthorsColophonIndexUnderstandingtheLinuxKernel,ThirdEditionbyDanielPBovetandMarcoCesatiCopyright©O'ReillyMedia,IncAllrightsreservedPrintedintheUnitedStatesofAmericaPublishedbyO'ReillyMedia,Inc,GravensteinHighwayNorth,Sebastopol,CAO'Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluseOnlineeditionsarealsoavailableformosttitles(safarioreillycom)Formoreinformation,contactourcorporateinstitutionalsalesdepartment:()orcorporateoreillycomEditor:AndyOramProductionEditor:DarrenKellyProductionServices:AmyParkerCoverDesigner:EdieFreedmanInteriorDesigner:DavidFutatoPrintingHistory:November:FirstEditionDecember:SecondEditionNovember:ThirdEditionNutshellHandbook,theNutshellHandbooklogo,andtheO'ReillylogoareregisteredtrademarksofO'ReillyMedia,IncTheLinuxseriesdesignations,UnderstandingtheLinuxKernel,ThirdEdition,theimageofamanwithabubble,andrelatedtradedressaretrademarksofO'ReillyMedia,IncManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthisbook,andO'ReillyMedia,Incwasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcapsWhileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedhereinISBN:MPrefaceInthespringsemesterof,wetaughtacourseonoperatingsystemsbasedonLinuxTheideawastoencouragestudentstoreadthesourcecodeToachievethis,weassignedtermprojectsconsistingofmakingchangestothekernelandperformingtestsonthemodifiedversionWealsowrotecoursenotesforourstudentsaboutafewcriticalfeaturesofLinuxsuchastaskswitchingandtaskschedulingOutofthisworkandwithalotofsupportfromourO'ReillyeditorAndyOramcamethefirsteditionofUnderstandingtheLinuxKernelattheendof,whichcoveredLinuxwithafewanticipationsonLinuxThesuccessencounteredbythisbookencouragedustocontinuealongthislineAttheendof,wecameoutwithasecondeditioncoveringLinuxYouarenowlookingatthethirdedition,whichcoversLinuxAsinourpreviousexperiences,wereadthousandsoflinesofcode,tryingtomakesenseofthemAfterallthiswork,wecansaythatitwasworththeeffortWelearnedalotofthingsyoudon'tfindinbooks,andwehopewehavesucceededinconveyingsomeofthisinformationinthefollowingpagesTheAudienceforThisBookAllpeoplecuriousabouthowLinuxworksandwhyitissoefficientwillfindanswershereAfterreadingthebook,youwillfindyourwaythroughthemanythousandsoflinesofcode,distinguishingbetweencrucialdatastructuresandsecondaryonesinshort,becomingatrueLinuxhackerOurworkmightbeconsideredaguidedtouroftheLinuxkernel:mostofthesignificantdatastructuresandmanyalgorithmsandprogrammingtricksusedinthekernelarediscussedInmanycases,therelevantfragmentsofcodearediscussedlinebylineOfcourse,youshouldhavetheLinuxsourcecodeonhandandshouldbewillingtoexpendsomeeffortdecipheringsomeofthefunctionsthatarenot,forsakeofbrevity,fullydescribedOnanotherlevel,thebookprovidesvaluableinsighttopeoplewhowanttoknowmoreaboutthecriticaldesignissuesinamodernoperatingsystemItisnotspecificallyaddressedtosystemadministratorsorprogrammersitismostlyforpeoplewhowanttounderstandhowthingsreallyworkinsidethemachine!Aswithanygoodguide,wetrytogobeyondsuperficialfeaturesWeofferabackground,suchasthehistoryofmajorfeaturesandthereasonswhytheywereusedOrganizationoftheMaterialWhenwebegantowritethisbook,wewerefacedwithacriticaldecision:shouldwerefertoaspecifichardwareplatformorskipthehardwaredependentdetailsandconcentrateonthepurehardwareindependentpartsofthekernelOthersbooksonLinuxkernelinternalshavechosenthelatterapproachwedecidedtoadopttheformeroneforthefollowingreasons:Efficientkernelstakeadvantageofmostavailablehardwarefeatures,suchasaddressingtechniques,caches,processorexceptions,specialinstructions,processorcontrolregisters,andsoonIfwewanttoconvinceyouthatthekernelindeeddoesquiteagoodjobinperformingaspecifictask,wemustfirsttellwhatkindofsupportcomesfromthehardwareEvenifalargeportionofaUnixkernelsourcecodeisprocessorindependentandcodedinClanguage,asmallandcriticalpartiscodedinassemblylanguageAthoroughknowledgeofthekernel,therefore,requiresthestudyofafewassemblylanguagefragmentsthatinteractwiththehardwareWhencoveringhardwarefeatures,ourstrategyisquitesimple:onlysketchthefeaturesthataretotallyhardwaredrivenwhiledetailingthosethatneedsomesoftwaresupportInfact,weareinterestedinkerneldesignratherthanincomputerarchitectureOurnextstepinchoosingourpathconsistedofselectingthecomputersystemtodescribeAlthoughLinuxisnowrunningonseveralkindsofpersonalcomputersandworkstations,wedecidedtoconcentrateontheverypopularandcheapIBMcompatiblepersonalcomputersandthusonthexmicroprocessorsandonsomesupportchipsincludedinthesepersonalcomputersThetermxmicroprocessorwillbeusedintheforthcomingchapterstodenotetheIntel,,Pentium,PentiumPro,PentiumII,PentiumIII,andPentiummicroprocessorsorcompatiblemodelsInafewcases,explicitreferenceswillbemadetospecificmodelsOnemorechoicewehadtomakewastheordertofollowinstudyingLinuxcomponentsWetriedabottomupapproach:startwithtopicsthatarehardwaredependentandendwiththosethataretotallyhardwareindependentInfact,we'llmakemanyreferencestothexmicroprocessorsinthefirstpartofthebook,whiletherestofitisrelativelyhardwareindependentSignificantexceptionsaremadeinChapterandChapterInpractice,followingabottomupapproachisnotassimpleasitlooks,becausetheareasofmemorymanagement,processmanagement,andfilesystemsareintertwinedafewforwardreferencesthatis,referencestotopicsyettobeexplainedareunavoidableEachchapterstartswithatheoreticaloverviewofthetopicscoveredThematerialisthenpresentedaccordingtothebottomupapproachWestartwiththedatastructuresneededtosupportthefunctionalitiesdescribedinthechapterThenweusuallymovefromthelowestleveloffunctionstohigherlevels,oftenendingbyshowinghowsystemcallsissuedbyuserapplicationsaresupportedLevelofDescriptionLinuxsourcecodeforallsupportedarchitecturesiscontainedinmorethan,Candassemblylanguagefilesstoredinaboutsubdirectoriesitconsistsofroughlymillionlinesofcode,whichoccupyovermegabytesofdiskspaceOfcourse,thisbookcancoveronlyaverysmallportionofthatcodeJusttofigureouthowbigtheLinuxsourceis,considerthatthewholesourcecodeofthebookyouarereadingoccupieslessthanmegabytesTherefore,wewouldneedmorethanbookslikethistolistallcode,withoutevencommentingonit!SowehadtomakesomechoicesaboutthepartstodescribeThisisaroughassessmentofourdecisions:WedescribeprocessandmemorymanagementfairlythoroughlyWecovertheVirtualFilesystemandtheExtandExtfilesystems,althoughmanyfunctionsarejustmentionedwithoutdetailingthecodewedonotdiscussotherfilesystemssupportedbyLinuxWedescribedevicedrivers,whichaccountforroughlyofthekernel,asfarasthekernelinterfaceisconcerned,butdonotattemptanalysisofeachspecificdriverThebookdescribestheofficialversionoftheLinuxkernel,whichcanbedownloadedfromthewebsitehttp:wwwkernelorgBeawarethatmostdistributionsofGNULinuxmodifytheofficialkerneltoimplementnewfeaturesortoimproveitsefficiencyInafewcases,thesource

用户评价(19)

点击加载更多内容
关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/49

深入理解Linux内核第3版

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利