1 / 13
文档名称:

太湖流域河道管理范围内建设项目工.pptx

格式:pptx   大小:96KB   页数:13页
下载后只包含 1 个 PPTX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

太湖流域河道管理范围内建设项目工.pptx

上传人:wz_198613 2018/9/10 文件大小:96 KB

下载得到文件列表

太湖流域河道管理范围内建设项目工.pptx

相关文档

文档介绍

文档介绍:‘kmap()’Recallthatour‘’device-driverusedthekernel’s‘kmap()’essingapageofphysicalmemory,nomatterwhichmemory-zoneitbelongedtoInordertounderstandour‘’devicedriver’s‘read()’method,weneedtostudyhowtheLinuxkernel’s‘kmap()’worksDirect‘linear’mappinguser-space(3GB)kernel-space(1GB)virtualaddresses896MB896MBHIGHMEMORYkernel-space(1GB)‘kmap()’hidespagedifferencesForphysicalpagesinthelowestmemoryzones(.,bottom896MB),adirectmapexistsintokernel-space,sokmap()istrivialforthesepages:theyarevisibletothekernelatpredictablelocations Butforphysicalpagesin‘highmemory’,they’renotalways‘mapped’--andevenifmapped,theaddressesaren’tpredictablePentium‘pageframes’Thesystem’sphysicalmemoryismadeupoffixed-sizeblocks(called‘pageframes’)FortheIntelx86architecture,thesizeofeachpageframeis4096bytes(=0x1000)Youcantellwhichpageabyteliesinfromitsphysicaladdress:byteat0x00012345liesinpage-number0x12(atoffset0x345)Thekernel’s‘num_physpages’variableisequaltothetotalnumberofpageframesTheLinuxkernelusesadata-structuretokeeptrackofeachphysicalpageframeThisdata-structureiscalleda‘structpage’Thesizeofeach‘structpage’is32-bytesThese‘structpage’objectsformanarray,named‘mem_map[]’,whosenumberofentriesisthe‘num_physpages’valueThe‘structpage’objectThe‘structpage’(8longwords)The‘structpage’definitionisinthe<linux/>headeralongwiththedeclarationforthe‘mem_map[]’arrayThe‘mem_map[]’arraymem_map[0]mem_map[1]mem_map[2]mem_map[3]mem_map[4]mem_map[5]...‘flags’fieldThisfieldconsistsofindividualbitswhichindicatethepageframe’scurrentstatusExamples: PG_locked bit0 PG_uptodate bit3 PG_dirty bit4 PG_active bit6 PG_highmem bit8 PG_reserved bit11Other‘structpage’fields…‘_count’isthepageframesusagecount‘_mapcount’ishowmanypte’scontainit‘private’isusedinmanagingswap-space‘index’givestheframe’soffsetinammap‘’pointstonextelementinlink-list‘’pointstoprevelementinlink-l