CCH09_Memory Management(操作系统).ppt
上传人:qw****27 上传时间:2024-09-12 格式:PPT 页数:77 大小:3.9MB 金币:15 举报 版权申诉
预览加载中,请您耐心等待几秒...

CCH09_Memory Management(操作系统).ppt

CCH09_MemoryManagement(操作系统).ppt

预览

免费试读已结束,剩余 67 页请下载文档后查看

15 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Module9:MemoryManagement存储层次结构BackgroundBackgroundLogicalvs.PhysicalAddressSpaceBindingofInstructionsandDatatoMemory地址重定位Memory-ManagementUnit(MMU)Memory-ManagementUnit(MMU)OverlaysOverlaysDynamicLoadingDynamicLinkingSwappingSwappingSchematicViewofSwappingContiguousAllocationContiguousAllocationContiguousAllocation固定分区(FixedPartitioning)分配固定分区(大小相同)固定分区(FixedPartitioning)分配固定分区分配ContiguousAllocation(Cont.)空闲分区的管理ContiguousAllocation(Cont.)DynamicStorage-AllocationProblem首次适应算法(FirstFit)最佳适应算法(BestFit)ContiguousAllocation(Cont.)FragmentationFragmentationPagingAddressTranslationSchemeAddressTranslationArchitecture地址结构PagingExamplePagingExampleImplementationofPageTableImplementationofPageTableAssociativeRegisterEffectiveAccessTimeEffectiveAccessTime页式地址变换举例MemoryProtectionMemoryProtectionTwo-LevelPage-TableSchemeTwo-LevelPage-TableSchemeTwo-LevelPagingExampleAddress-TranslationSchemeMultilevelPagingandPerformanceInvertedPageTableInvertedPageTableArchitectureSharedPagesSharedPagesExampleSegmentationLogicalViewofSegmentationSegmentationHardwareSegmentationArchitectureSegmentationArchitecture(Cont.)SegmentationArchitecture(Cont.)SegmentationwithPaging–Intel386ComparingMemory-ManagementStrategies(1)存储分配和回收:是存储管理的主要内容。讨论其算法和相应的数据结构。。(2)地址变换:可执行文件生成中的链接技术、程序加载时的重定位技术,进程运行时硬件和软件的地址变换技术和机构。(3)存储共享和保护:代码和数据共享,对地址空间的访问权限(读、写、执行)。(4)存储器扩充:它涉及存储器的逻辑组织和物理组织;8.3Example:TheIntelPentiumLogicaltoPhysicalAddressTranslationinPentium每个进程最多有16K个段,每个段最长达4GB,页大小为4KB。逻辑地址为(selector,offset),其中selector为16位,包括13位的段号、1位指出是GDT还是LDT中的段,2位作为保护位。进程的逻辑地址空间分为两部分:第一部分:8K个私有段,其信息放在LDT中;第二部分:8K个共享段,其信息放在GDT中;GDT:GlobalDescriptorTable,共享段表。LDT:LocalDescriptorTable,私有段表物理地址为32位,采用两级分页,每一级为10位,页内偏移为12位物理地址的形成:段寄存器指向相应的段表得到该段的基址,基址与offset相加形成一个线性地址.该线性地址被分为两个10位的页号和一个12位的偏移量,两个10位的页号经两级页表可以得到该页的起始地址,该起始地址与偏移量相拼接,得到物理地址.为了提高物理内存的使用效率,其页表可以交换到磁盘上.IntelPentiumSegmentationPentiumPagingArchitectureExample:LinearAddressinLinuxThree-levelPaginginLinux