《现代操作系统 Modern Operating Systems》课程教学资源(PPT课件讲稿,Third Edition)Chapter 3 内存管理 Memory Management

MODERN OPERATING SYSTEMS Third edition ANDREW S TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c)2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Memory management Memory(RAM)is an important and rare resource a Programs expand to fill the memory available to them Programmer's view a Memory should be private, infinitely large, infinitely fast, nonvolatile Reality a Best of people's mind: memory hierarchy a Register, cache, memory, disk, tape Memory manager a Efficiently manage memory a Keep track the free memory, allocate memory to programs
Memory Management ◼ Memory (RAM) is an important and rare resource ❑ Programs expand to fill the memory available to them ◼ Programmer’s view ❑ Memory should be private, infinitely large, infinitely fast, nonvolatile… ◼ Reality ❑ Best of people’s mind: memory hierarchy ❑ Register, cache, memory, disk, tape ◼ Memory manager ❑ Efficiently manage memory ❑ Keep track the free memory, allocate memory to programs…

Memory management The memory management in this chapter ranges from very simple to highly sophisticated
Memory management ◼ The memory management in this chapter ranges from very simple to highly sophisticated…

No Memory abstraction Early mainframe, early minicomputers, early personal computers had no memory abstraction 口 MOV REG|STER1.1000 a Here 1000 means move the content of physical memory address 1000 to register Impossible to have two programs in memory
No Memory Abstraction ◼ Early mainframe, early minicomputers, early personal computers had no memory abstraction… ❑ MOV REGISTER1, 1000 ❑ Here 1000 means move the content of physical memory address1000 to register ◼ Impossible to have two programs in memory

No Memory abstraction OXFFF Operatin Device system in drivers in rOm ROM User program program User program Operating Operating system in system in RAM RAM 0 0 0 (b) Figure 3-1. Three simple ways of organizing memory with an operating system and one user process Tanenbaum, Modern Operating Systems 3 e, (c)2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Figure 3-1. Three simple ways of organizing memory with an operating system and one user process. No Memory Abstraction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Multiple problems without abstraction |BM360 a Memory divided into 2-KB blocks and each one with a 4-bit protection key a PSW also has a 4-bit protection key a Hardware will trap any attempt tries to access memory with a protection code different from PSW key
Multiple problems without abstraction ◼ IBM 360 ❑ Memory divided into 2-KB blocks and each one with a 4-bit protection key ❑ PSW also has a 4-bit protection key ❑ Hardware will trap any attempt tries to access memory with a protection code different from PSW key

Multiple Programs Without Memory Abstraction Drawback CMP 16412 16408 16400 16396 16388 JMP2816384 16380 16380 16380 MOV MOV 20 20 12 MP240 JMP 280 JMP240 Figure 3-2. Illustration of the relocation problem Tanenbaum, Modern Operating Systems 3 e, (c)2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Figure 3-2. Illustration of the relocation problem. Multiple Programs Without Memory Abstraction: Drawback Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639

Drawback of no abstraction Problem is that both programs reference absolute pnysical memory People hope that they can have a private space, that is addresses local to it BM360 a Modify the second program on the fly as it loaded it into memory a static re|ocatⅰon When a program is loaded into 16384, then the constant is added to every address Slow down loading needs extra information No abstraction memory still used in embedded and smart systems
Drawback of no abstraction ◼ Problem is that both programs reference absolute physical memory ◼ People hope that they can have a private space, that is, addresses local to it ◼ IBM 360 ❑ Modify the second program on the fly as it loaded it into memory ❑ Static relocation ◼ When a program is loaded into 16384, then the constant is added to every address ◼ Slow down loading, needs extra information ◼ No abstraction memory still used in embedded and smart systems

Abstraction: address space a Not to expose physical address to programmers o Crash OS 口 Hard to parallelize Two problems to solve a Protection a Relocation Address space aa set of memory processes can use to address memory a Each process has its own address space, independent of each other How?
Abstraction: address space ◼ Not to expose physical address to programmers ❑ Crash OS ❑ Hard to parallelize ◼ Two problems to solve: ❑ Protection ❑ Relocation ◼ Address space: ❑ A set of memory processes can use to address memory ❑ Each process has its own address space, independent of each other ❑ How?

D ynamic relocation Equip CPU with two special register: base and limit a Program be loaded into a consecutive space a No relocation during loading a When process is run and reference an address CPU automatically adds the base to that address as well as check whether it exceeds the limit register
Dynamic relocation ◼ Equip CPU with two special register: base and limit ❑ Program be loaded into a consecutive space ❑ No relocation during loading ❑ When process is run and reference an address, CPU automatically adds the base to that address; as well as check whether it exceeds the limit register
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《网络编程实用教程》课程教学资源(PPT课件讲稿)第2章 套接字网络编程基础.ppt
- 《软件工程》课程教学资源(PPT课件)Lecture 6 设计概念和原则 Design Concepts and Principles.ppt
- 西安交通大学:《微机原理与接口技术》课程教学资源(PPT课件讲稿)第6章 数字量输入输出接口(主讲:桂小林).ppt
- 香港中文大学:《Probability and Statistics for Engineers》课程教学资源(PPT课件讲稿)Chapter 09 Classical Staistical Inference.pptx
- 上海交通大学:《挖掘海量数据集 Mining Massive Datasets》课程教学资源(PPT讲稿)Lecture 07 链接分析 Link Analysis.ppt
- 《计算机仿真技术》课程电子教案(PPT教学课件)第一章 绪论.ppt
- 《计算机网络》课程教学资源(PPT课件讲稿)第6章 IP路由.ppt
- 《计算机原理及应用》课程教学资源(PPT课件讲稿)第8章 单片机的存储器的扩展.ppt
- 《算法设计》课程教学资源(PPT课件讲稿)Lecture 6 Graph Traversal.ppt
- 香港浸会大学:《Data Communications and Networking》课程教学资源(PPT讲稿)Chapter 3 Data Transmission.ppt
- 南京大学:Decidability、Complexity(P、NP、NPC)、Reduce(P NP NPC).pptx
- 《计算机文化基础》课程教学资源(PPT课件讲稿)第四章 电子表格系统Excel 2003.ppt
- 西安电子科技大学:《信息系统安全》课程教学资源(PPT课件讲稿)第三章 信息安全保障体系、第四章 物理安全.ppt
- 《计算机网络》课程电子教案(PPT课件讲稿)第2章 数据通信与广域网技术.ppt
- 《计算机网络与互联网 Computer Networks and Internets》课程电子教案(PPT课件讲稿)Part IV 局域网 Local Area Networks(LANs).ppt
- 《人工智能导论》课程教学资源(PPT课件讲稿)群智能(Swarm Intelligence).ppt
- 山东大学:《微机原理及单片机接口技术》课程教学资源(PPT课件讲稿)第六章 中断 §6.1 中断的概念 §6.2 单片机的中断系统及其管理.ppt
- 3D computer vision techniques v.4b2 1.ppt
- 上海交通大学:《计算机控制技术》课程教学资源(PPT课件)第一章 计算机控制系统概述 Computer Control Technology.ppt
- 电子工业出版社:《计算机网络》课程教学资源(第五版,PPT课件讲稿)第一章 概述.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第四章 串.ppt
- 东北大学:《计算机图形学》课程教学资源(PPT课件讲稿,主讲:闻时光).ppt
- 上海交通大学:超立方体 Hypercube(PPT讲稿)Low-Diameter Architectures.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第五章 多维数组与广义表.ppt
- 西南交通大学:《网络性能评估与测试 Network Performance Evaluation and Testing》(PPT课件讲稿)第2讲 网络测试技术基础(主讲:张新有).ppt
- 《Photoshop CS教程》教学资源(PPT课件)第7章 编辑文字.ppt
- 《编译原理》课程教学资源(PPT课件讲稿)语法制导的翻译(Syntax-Directed Translation).pptx
- 电子科技大学:《密码理论》课程教学资源(PPT课件讲稿)第2章 流密码.ppt
- 搜索引擎技术(PPT讲稿)Web Spam.ppt
- 四川大学:《计算机操作系统 Operating System Principles》课程教学资源(PPT课件讲稿)第1章 导论(主讲:段磊).ppt
- 赣南师范大学:《计算机网络原理》课程教学资源(PPT课件讲稿)第七章 网络层.ppt
- 《人工智能》课程电子教案(PPT课件讲稿)第9章 机器学习与知识发现.ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第7章 图像分割.ppt
- 《编译原理》课程教学资源(PPT课件讲稿)第五章 语法制导的翻译 5.1 语法制导的定义 5.2 S属性定义的自下而上计算.ppt
- 四川大学:《操作系统 Operating System》课程教学资源(PPT课件讲稿)Chapter 5 互斥与同步(Mutual Exclusion and Synchronization)5.3 Semaphores.ppt
- 淮阴工学院:《数据库原理》课程教学资源(PPT课件讲稿)第2章 数据库系统结构.ppt
- 苏州大学:文档评分与向量空间模型(PPT讲稿).ppt
- 清华大学:Computational Models for Social Network Analysis(PPT讲稿)mining big social networks(Part III:Group and Structure).pptx
- 中国科学技术大学:《网络信息安全 NETWORK SECURITY》课程教学资源(PPT课件讲稿)第一章 计算机网络安全概述2/2(主讲:肖明军).ppt
- 《计算机硬件基础》课程教学资源(PPT课件讲稿)第六章 汇编语言及其程序设计.ppt