中科大操作系统原理与实现课件8_memory3.pdf
《中科大操作系统原理与实现课件8_memory3.pdf》由会员分享,可在线阅读,更多相关《中科大操作系统原理与实现课件8_memory3.pdf(32页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、.操作系统原理与设计第8章 Main Memory3陈香兰中国科学技术大学计算机学院2009年11月17日.提纲Segmentation(分段)Basic MethodHardwareSegmentation with pagingExample:The Intel Pentium小结和作业.Discrete Memory AllocationIpaging(分页)Iinternal fragmentation one pageIsegmentation(分段)IlogicalIcombined paging segmentation(段页式).OutlineSegmentation(分段)B
2、asic MethodHardwareSegmentation with pagingExample:The Intel Pentium小结和作业.SegmentationISegmentation:supporting user view of memoryIA program is a collection of segments.A segment is a logical unit such as:main program,procedure,function,method,object,local variables,global variables,common block,sta
3、ck,symbol table,arraysUsers View of a Program.Logical address spaceIA collection of segmentsIeach segment I2-D address spaceIA logical address consists of a two tupleI,orIICompiler automatically constructs segments reflecting theinput program.IPascal compilerIFORTRAN compilerIC compiler,such as gcc,
4、.Logical View of Segmentation.OutlineSegmentation(分段)Basic MethodHardwareSegmentation with pagingExample:The Intel Pentium小结和作业.Segmentation Architecture IISegment table maps 2-D LA 1-D PA;each table entry has:Ibase contains the starting physical address where thesegments reside in memoryIlimit spec
5、ifies the length of the segmentISegment-table base register(STBR)points to thesegment tables location in memoryISegment-table length register(STLR)indicates number ofsegments used by a program;segment number s is legal if s STLR.Segmentation Architecture II.Segmentation Architecture IIIIProtectionIW
6、ith each entry in segment table associate:Ivalidation bit=0 illegal segmentIread/write/execute privilegesIProtection bits associated with segments;code sharing occursat segment levelISince segments vary in length,memory allocation is a dynamicstorage-allocation problemIFirst-fit,Best-fit,.IExternel
7、fragmentation,compaction,.Example of SegmentationI4300+53=4353I3200+852=4052IWhat about?.分页和分段的主要区别I角度和目的不同I分页:面向系统,物理上离散,减少外部和内部碎片,提高内存利用率I页是信息的物理单位I分段:面向用户,逻辑上离散,满足用户的需求I段是信息的逻辑单位,意义相对完整I大小不同I分页:大小固定,由硬件决定I分段:不固定,划分由程序决定,在编译时确定I地址空间的维数不同I分页:1维I分段:2维,段名(号)段内偏移.分段的好处IRelocation,可重定位,方便编程IDynamic,by
8、segment tableISharingIshared segmentsIsame segment numberIProtectionIUse segment table entryIProtection bitIRead-only,execute-only,read/writeIValidation bit,0illegal segmentIProtection&sharing at segment levelI动态增长I动态链接.sharing.OutlineSegmentation(分段)Basic MethodHardwareSegmentation with pagingExamp
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 中科大 操作系统 原理 实现 课件 _memory3
限制150内