08_memory management

08_memory management - Chapter 8: Memory Management...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 8: Memory Management Strategies
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8.2 Modified by Bo Li ©2009 Operating System Concepts Chapter 8: Memory Management Strategies Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging – Example with MULTICS
Background image of page 2
8.3 Modified by Bo Li ©2009 Operating System Concepts Background Program must be brought into memory and placed within a process for it to be run Input queue – collection of processes on the disk that are waiting to be brought into memory to run the program Long-term scheduler’s job User programs go through several steps before being run
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8.4 Modified by Bo Li ©2009 Operating System Concepts Multistep Processing of a User Program Address binding of instructions and data to memory addresses can happen at three different stages Compile time: If memory location known a priori, absolute code can be generated; must recompile code if starting location changes (e.g., “gcc”). MS-DOS uses this Load time: Must generate relocatable code if memory location is not known at compile time (e.g, Unix “ld” does link) 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), e.g., dynamic libs. Most general purpose OSs use this method
Background image of page 4
8.5 Modified by Bo Li ©2009 Operating System Concepts Logical vs. Physical Address Space The concept of a logical address space 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, i.e., the address starts from zero. Physical address – address seen by the memory management unit Memory Management Unit or MMU : mechanism that maps virtual address to physical address In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory The user program deals with logical addresses; it never sees the real physical addresses
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8.6 Modified by Bo Li ©2009 Operating System Concepts Dynamic Loading and Linking Dynamic Loading Routine is not loaded until it is called Better memory-space utilization; unused routine is never loaded Useful when large amounts of code are needed to handle infrequently occurring cases; this can handle very large processes No special support from the operating system is required Dynamic Linking Linking postponed until execution time, similar to dynamic loading OS needs to check if routine is in processes’ memory address; if not, the program loads the routine into memory Small piece of code, stub , is used to locate the appropriate memory- resident library routine. Stub replaces itself with the address of the routine, and executes the routine Dynamic linking is particularly useful for libraries Without this, each program must include a copy of library in the executable
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

08_memory management - Chapter 8: Memory Management...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online