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