v9stanford.edu-Virtual_Memory

v9stanford.edu-Virtual_Memory - Virtual Memory http:/w w w

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

View Full Document Right Arrow Icon
http://w w w .stanford.edu/~ouster/cgi-bin/cs140-w inter12/lecture.php?topic=vm January 11, 2012 Virtual Memory Virtual Memory Lecture Notes for CS 140 Winter 2012 John Ousterhout Readings for this topic from Operating System Concepts : Sections 8.1-8.7. How can one memory be shared among several concurrent processes? Simple uniprogramming (no sharing): Highest memory holds OS. Process is allocated memory starting at 0, up to the OS area. When loading a process, just bring it in at 0. Examples: early batch monitors where only one job ran at a time. It could corrupt the OS, which would be rebooted by an operator. Some early personal computers were similar. Goals for sharing memory: Multiprogramming: allow multiple processes to be memory-resident at once. Transparency: no process should need to be aware of the fact that memory is shared. Each must run regardless of the number and/or locations of processes. Isolation: processes mustn't be able to corrupt each other. Efficiency (both of CPU and memory) shouldn't be degraded badly by sharing. Load-time relocation: Highest memory holds OS. First process loaded at 0; others fill empty spaces. When a process is loaded, relocate it so that it can run in its allocated memory area, similar to linking: Linker outputs relocation records in executable files OS modifies addresses when it loads process. What are the problems with this approach? Dynamic Memory Relocation Instead of relocating a program statically when it is loaded, add hardware ( memory management unit ) that changes addresses dynamically during every memory reference . Each address generated by a process (called a virtual address ) is translated in hardware to a physical address. This happens during every memory reference. Results in two views of memory, called address spaces : Virtual address space is what the program sees Physical address space is the actual allocation of memory
Background image of page 1

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

View Full DocumentRight Arrow Icon
Base and Bounds Relocation Two hardware registers: Base: physical address corresponding to virtual address 0. Bounds: virtual addresses >= this are invalid.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2012 for the course CS 140 taught by Professor Rosenblum during the Winter '08 term at Stanford.

Page1 / 4

v9stanford.edu-Virtual_Memory - Virtual Memory http:/w w w

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

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