存储器管理教学文案

上传人:yulij****0329 文档编号:139313519 上传时间:2020-07-21 格式:PPT 页数:173 大小:2.04MB
返回 下载 相关 举报
存储器管理教学文案_第1页
第1页 / 共173页
存储器管理教学文案_第2页
第2页 / 共173页
存储器管理教学文案_第3页
第3页 / 共173页
存储器管理教学文案_第4页
第4页 / 共173页
存储器管理教学文案_第5页
第5页 / 共173页
点击查看更多>>
资源描述

《存储器管理教学文案》由会员分享,可在线阅读,更多相关《存储器管理教学文案(173页珍藏版)》请在金锄头文库上搜索。

1、第四章存储器管理,教学目的及要求,掌握存储器管理的功能 掌握动态分区管理原理 掌握对换技术的概念 熟练掌握先进先出页面置换算法和最近最久未使用页面置换算法。 掌握请求页式管理、段式、段页式地址变换及其越界保护,重点和难点,分页存储管理的基本方法、地址变换机构和页表机制; 分段存储管理的基本原理, 分页与分段的主要区别; 先进先出页面置换算法和最近最久未使用页面置换算法,主要外语词汇,Virtual memory Logical Address Physical Address fixed partition variable partition (dynamic partition) Swap

2、ping FIFO Least recently used,存储层次结构,快速缓存: Data Cache TLB(Translation Lookaside Buffer)转换后援缓冲器 内存:DRAM, SDRAM,DDR2,DDR3等; 外存:软盘、硬盘、光盘、磁带等;,存储器容量计算方法,存储容量:是该存储设备上可以存储数据的最大数量,通常使用千字节(kb kilobyte)、兆字节(MB megabyte)、吉字节(GB, gigabyte)、太字节(TB ,terabyte))等来衡量。下面括号中的数字为2的指数(即多少次方) 1KB=2(10)B=1024B; 1MB=2(20)

3、B=1024KB; 1GB=2(30)B=1024MB。 1TB=2(40)B =1024GB,计算机数制,二进制(Binary system) 八进制(Octal system) 十进制(Decimal system) 十六进制(Hexadecimal system) 十六进制转二进制: (ACEF)H=1010 1100 1110 1111B,补充:内存工作原理,1、存储单元:若干个二进制位(4,8,16位等) 2、单元地址:所有的存储单元按顺序排列,每个单元都有一个编号。地址编号也用二进制数绝对地址/物理地址,补充:内存工作原理,3、寻址:通过地址编号寻找在存储器中的数据单元。存储器地址

4、的范围多少决定了二进制数的位数. 例:如果存储器有1024个(1KB)单元,地址编码为01023,对应的二进制数是00000000001111111111,需要用10位二进制来表示,也就是需要10根地址线,或者说,10位地址码可寻址1KB的存储空间。 4、存储容量:存储器中所有存储单元的总和,存储容量的单位是KB、MB与GB。,0000H 0001H 0002H FFFFH,存储单元 (字节),例 CPU 从内存读取地址为44H中的数据54,R,44H,54,例 CPU 将数据35放入内存地址为 48H中,W,48H,35,第四章存储器管理,4.1 存储器管理的功能,4.2 连续分配方式,4.

5、3 基本分页存储管理方式,4.5 虚拟存储器的基本概念,4.4 基本分段存储管理方式,4.7 页面置换算法,4.8 请求分段存储管理方式,4.6 请求分页存储管理方式,存储器管理的目的,Program must be brought into memory and placed within a process for it to be run. 存储器管理实质:对内存空间的用户区进行管理。 内存分为系统区和用户区两部分:系统区仅提供给OS使用,通常位于内存的低址部分;用户区供用户使用。 存储器管理目的:尽可能地方便用户使用存储器和提高内存空间的利用率。,存储器管理的功能,地址转换 虚拟存储器

6、(内存空间的扩充) 内外存数据传输的控制 内存的分配与回收 内存信息的共享与保护,4.1 存储管理的功能,4.1.1 地址转换 4.1.2 虚拟存储器(内存空间的扩充) 4.1.3 内外存数据传输的控制 4.1.4 内存的分配与回收 4.1.5 内存信息的共享与保护 4.1.6 存储器管理方式,4.1.1地址转换,Addresses may be represented in different ways during these steps. Addresses in the source program are generally symbolic (such as count). A c

7、ompiler will typically bind these symbolic addresses to relocatable addresses (such as 14 bytes from the beginning of this module). The linkage editor or loader will in turn bind these relocatable addresses to absolute addresses (such as 74014). Each binding is a mapping from one address space to an

8、other.,Binding of Instructions and Data to Memory,Address binding of instructions and data to memory addresses canhappen at three different stages. Compile time: If memory location known a priori, absolute code can be generated; must recompile code if starting location changes. Load time: Must gener

9、ate relocatable code if memory location is not known at compile time. Execution time: Binding delayed until run time if the process can be moved during its execution from one memory segment to another. Need hardware support for address maps (e.g., base and limit registers).,Multistep Processing of a

10、 User Program,程序的链接和装入过程,程序的链接和装入过程:将一个用户源程序转变为一个可在内存中执行的程序,需要经过: 编译:由编译程序将用户源代码编译成若干个目标模块。 链接:由链接程序将编译后形成的目标模块以及它们所需要的库函数链接在一起,形成一个完整的装入模块。 装入:由装入程序将装入模块装入内存。,用户程序的链接和装入过程,地址转换(地址重定位或地址映射),内存空间是内存地址的集合,是一维线性空间。 地址转换:建立相对地址(逻辑地址)与内存绝对地址(物理地址)的关系。,逻辑地址空间和物理地址空间Logical vs. Physical Address Space,An ad

11、dress generated by the CPU is commonly referred to as a logical address, whereas an address seen by the memory unit-that is, the one loaded into the memory-address register of the memory-is commonly referred to as a physical address. The compile-time and load-time address-binding methods generate id

12、entical logical and physical addresses. However, the execution-time address-binding scheme results in differing logical and physica1 addresses. In this case, we usually refer to the logical address as a virtual address.,We use logical address and virtual address interchangeably in this text. Logical

13、-address space: The set of all logical addresses generated by a program; physical-address space: the set of all physical addresses corresponding to these logical addresses. Thus, in the execution-time address-binding scheme, the logical- and physical-address spaces differ.,Logical vs. Physical Addre

14、ss Space,The concept of a logical address space that is bound to a separate physical address space is central to proper memory management. Logical address generated by the CPU; also referred to as virtual address. Physical address address seen by the memory unit.,Logical vs. Physical Address,实现地址重定位

15、或地址映射的方法,static linking:system language libraries are treated like any other object module and are combined by the loader into the binary program image. dynamic linking:Linking postponed until execution time. This feature is usually used with system libraries, such as language subroutine libraries.

16、Without this facility all programs on a system need to have a copy of their language library (or at least the routines referenced by the program) included in the executable image. This requirement wastes both disk space and main memory.,实现地址重定位或地址映射的方法,静态地址重定位(可重定位装入方式):由装入内存时一次完成地址变换,以后不再改变。 动态地址重定位(动态运行时装入方式):程序执行过程中,在CPU访问内存之前,将要访问的程序或数据相对地址转换成内存绝对地址。需要硬件(重定位寄存器)支持。,4.1.2 虚拟存储器,虚拟存储器: 把辅助存储器作为对主存储器的扩充, 向用户提供一个比实际主存大得多的地址空间。 虚拟存储的基本原理 程序装入时,只需将当前需要执行的部分页或段读入到内存,就可让程序开始执行。 内存中只存放经常被访问的程

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 中学教育 > 教学课件 > 高中课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号