《操作系统》课程教学资源(PPT课件讲稿)内存管理 Memory Management

Chapter 7 Memory management 有效的存储器管理在多道程序系统中是 至关重要的。如果仅仅有一些进程在存 储器中,那么大多数时候所有进程都在 等待I/O,处理器也处于空闲状态。因此, 存储器必须有效地分配,以便尽可能多 的进程可以装入存储器中,因为程序必 须装入主存才能执行
Chapter 7 Memory Management • 有效的存储器管理在多道程序系统中是 至关重要的。如果仅仅有一些进程在存 储器中,那么大多数时候所有进程都在 等待I/O,处理器也处于空闲状态。因此, 存储器必须有效地分配,以便尽可能多 的进程可以装入存储器中, 因为程序必 须装入主存才能执行

7.1 Memory Management Requirements 存储器管理需求) Relocation(重定位) Memory Protection存储保护) Memory Sharing存储共享) Logical Organization(逻辑组织) Physical Organization(物理组织)
7.1 Memory Management Requirements (存储器管理需求 ) • Relocation(重定位) • Memory Protection(存储保护) • Memory Sharing(存储共享) • Logical Organization(逻辑组织) • Physical Organization(物理组织)

Relocation(重定位) 在多道程序系统中,可用的主存空间通常 被许多进程共享,因此存在以下情况: (1). Programmer does not know in advance where the program will be resident in memory when it is executed。(程序员不可 能事先知道:在程序执行时,哪个程序会 驻留在主存中。)
Relocation(重定位 ) •在多道程序系统中,可用的主存空间通常 被许多进程共享, 因此存在以下情况: (1). Programmer does not know in advance where the program will be resident in memory when it is executed。(程序员不可 能事先知道:在程序执行时,哪个程序会 驻留在主存中。)

(2 ) While the program is executing, it may be swapped to disk and returned to main memory at a different location( relocated)(程序执行期间, 进程可能被换出主存到磁盘,当需要又被换入主 存,可以把该进程重定位到存储器的不同区域 B3). The processor hardware and operating system software must be able to translate the memory references found in the code of the program into actual physical memory address 处理器硬件和操作系统软件必须能够把程序代码 中的访间地址转换成实际的物理存储器地址) ★如图7.1,该图描述了一个进程的寻址要求
(2). While the program is executing, it may be swapped to disk and returned to main memory at a different location (relocated)(程序执行期间, 进程可能被换出主存到磁盘,当需要又被换入主 存,可以把该进程重定位到存储器的不同区域.) (3).The processor hardware and operating system software must be able to translate the memory references found in the code of the program into actual physical memory address. (处理器硬件和操作系统软件必须能够把程序代码 中的访问地址转换成实际的物理存储器地址.) ★如图7.1,该图描述了一个进程的寻址要求

Process control information Process Control Ble Entry point to prog Branch Program instruction Increasing address values Reference to data Data Current top一 of stack Stack Figure 7.1 Addressing Requirements for a Process

怎样实现寻址? orica reference to a memory location independent of the current assignment of data to memory(逻辑地址是指与 当前数据在存储器中的分配情况无关的对存储器单元的 访问) 2. Relative -address expressed as a location relative to some known point(相对地址被解释成相对于某些已知点的存储单元) 3. Physical -the absolute address or actual location in main memory(物理地址或绝对地址是主存中的实际单元。)
• 怎样实现寻址? 1. Logical –reference to a memory location independent of the current assignment of data to memory(逻辑地址是指与 当前数据在存储器中的分配情况无关的对存储器单元的 访问.) 2. Relative –address expressed as a location relative to some known point(相对地址被解释成相对于某些已知点的存储单元) 3. Physical –the absolute address or actual location in main memory(物理地址或绝对地址是主存中的实际单元。)

物理 地址 0 逻辑 地址 相对地址 m 目标程序空间 内存空间
0 X 目标程序空间 内存空间 0 m 逻辑 地址 物理 地址 相 对 地 址

操作系统需要知道进程控制信息和执行 栈,以及为这个进程开始执行程序的入 口点的位置。由于操作系统管理存储器 并负责把该进程取进主存,因而可以很 容易地得到这些地址 处理器必须处理程序内部的存储器访问。 即将要执行的指令的地址,数据字节的 地址等。因此,处理器硬件和操作系统 软件必须能够把程序代码中的地址转换 成实际的物理存储器地址,才能保证程 序的正确执行
• 操作系统需要知道进程控制信息和执行 栈,以及为这个进程开始执行程序的入 口点的位置。由于操作系统管理存储器 并负责把该进程取进主存,因而可以很 容易地得到这些地址。 • 处理器必须处理程序内部的存储器访问。 即将要执行的指令的地址,数据字节的 地址等。因此,处理器硬件和操作系统 软件必须能够把程序代码中的地址转换 成实际的物理存储器地址,才能保证程 序的正确执行

1000 1000 LOAD 1.2500 11000LOAD1,2500 2500 365 12500 365 5000 1500C 作业地址空间 内存空间 图4-2作业装入内存时的情况

相对地址·重定位寄存器 10000 2500 10000 l0100 LOAD1,2500 LOAD1,2500 2500 12500 365 365 5000 15000 作业J 处理机一侧存储器一侧 主存 图4-9动态重定位示意图
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《电子商务概论》课程教学资源(PPT课件讲稿)第一章 电子商务基础知识(主讲:贾朝辉).pptx
- 南京大学:《编译原理》课程教学资源(PPT课件讲稿)第九章 机器无关的优化(赵建华).ppt
- 《计算科学基础研究》课程教学资源(PPT课件讲稿)类的定义.ppt
- 上海交通大学:《程序设计》课程教学资源(PPT课件讲稿)第9章 模块化开发.ppt
- 利用EXCEL进行数据分析与图表处理(PPT讲稿).pptx
- 北京师范大学:《多媒体技术基础》课程教学资源(PPT课件讲稿)第二章 数字图像(曾兰芳).ppt
- 上海交通大学:《通信网络》课程PPT教学课件(Communication Networks)Introduction(主讲:叶通).pptx
- 上海交通大学:《程序设计》课程教学资源(PPT课件讲稿)第4章 循环控制.ppt
- 《单片机原理及应用》课程教学资源(PPT课件讲稿)第6章 AT89S52单片机的串行口.ppt
- 中国科学技术大学:《并行计算 Parallel Computing》课程教学资源(PPT课件讲稿)并行编译简介.ppt
- 南京大学:《面向对象技术 OOT》课程教学资源(PPT课件讲稿)抽象数据类型 Abstract Data Types.ppt
- 《数据结构》课程教学资源:课程教学资源(PPT课件讲稿)第九章 查找表.ppt
- 东南大学:《数据结构》课程教学资源(PPT课件讲稿)动态规划.pptx
- 上海交通大学:Mining Massive Datasets(PPT讲稿).ppt
- 电子工业出版社:《计算机网络》课程教学资源(第五版,PPT课件讲稿)第一章 概述(谢希仁).ppt
- 北京航空航天大学:《数据挖掘——概念和技术(Data Mining - Concepts and Techniques)》课程教学资源(PPT课件讲稿)Chapter 03 Data Preprocessing.ppt
- 《数字图象处理》课程教学资源(PPT课件讲稿)第七章 邻域运算.ppt
- 上海交通大学:《编译器构造》课程教学资源(PPT讲稿,马融)Compiler.pptx
- 《软件工程 Software Engineering》教学资源:课程教学大纲.pdf
- 沈阳理工大学:《单片机C语言应用程序设计》课程PPT教学课件(单片机C语言编程)04 C51编程设计(廉哲).pptx
- 沈阳理工大学:《大学计算机基础》课程教学资源(PPT课件讲稿)第3章 编辑排版软件(Microsoft Word 2000).pps
- 《C语言程序设计》课程电子教案(PPT课件讲稿)第4章 算法控制结构.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第二章 线性表.ppt
- 上海交通大学:《数字图像处理 Digital Image Processing》课程教学资源(PPT课件讲稿,第三版)Chapter 12 Object Recognition.pptx
- 《The C++ Programming Language》课程教学资源(PPT课件讲稿)Lecture 01 From C to C++.ppt
- 《数据库系统概论 An Introduction to Database System》课程教学资源(PPT课件讲稿)第一讲 绪论.ppt
- 《计算机网络安全技术》课程教学资源(PPT课件讲稿)第五章 防火墙技术.ppt
- 《软件测试 Software Testing》教学资源(PPT讲稿)Part 2 Testing Fundamentals.ppt
- 《C语言程序设计》课程电子教案(PPT课件讲稿)第2章 数据类型及基本运算量.ppt
- Flexsim 初级培训讲义(PPT讲稿)Flexsim Basic Training.ppt
- 清华大家:字符串匹配算法(PPT讲稿)String Matching Algorithm(Overview & Analysis).ppt
- 四川大学:《Linux操作系统》课程教学资源(PPT课件讲稿)第3章 Shell及其编程(主计:潘薇).ppt
- 面向对象程序设计语言(PPT课件讲稿).ppt
- 《面向对象程序设计》课程教学资源(课件讲稿)C++语言的面向对象特征、Java语言的面向对象特征、Python语言的面向对象特征、R语言的面向对象特征.ppt
- 安徽理工大学:《Linux开发基础 Development Foundation on Linux OS》课程教学资源(PPT课件讲稿)GNU C/C++ programming、CGI programming in GNU C/C++ language(方贤进).ppt
- 《Photoshop基础教程与上机指导》课程教学资源(PPT讲稿)第8章 简单编辑图像.ppt
- 中国科学技术大学:《计算机组成原理》课程教学资源(PPT课件讲稿)第五章 虚拟存储器(主讲:李曦).ppt
- 中国科学技术大学:《计算机视觉》课程教学资源(PPT课件讲稿)第七章 基于运动视觉的场景复原.ppt
- 计算机应用基础课程:《信息技术应用基础》教学资源(PPT课件讲稿)第一章 中文WIN98操作系统.ppt
- 山东大学:《微机原理及单片机接口技术》课程教学资源(PPT课件讲稿)第十一章 复位、时钟和省电方式控制.ppt