Lecture 8 Virtual memory HW

Lecture 8 Virtual memory HW - Want processes to co-exist...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Want processes to co-exist Consider multiprogramming on physical memory- What happens if pintos needs to expand?- If emacs needs more memory than is on the machine??- If pintos has an error and writes to address 0x7100?- When does gcc have to know it will run at 0x4000?- What if emacs isnt using its memory? 1/36 Issues in sharing physical memory Protection- A bug in one process can corrupt memory in another- Must somehow prevent process A from trashing B s memory- Also prevent A from even observing B s memory (ssh-agent) Transparency- A process shouldnt require particular memory locations- Processes often require large amounts of contiguous memory (for stack, large data structures, etc.) Resource exhaustion- Programmers typically assume machine has enough memory- Sum of sizes of all processes often greater than physical memory 2/36 Virtual memory goals Give each program its own virtual address space- At run time, relocate each load and store to its actual memory- So app doesnt care what physical memory its using Also enforce protection- Prevent one app from messing with anothers memory And allow programs to see more memory than exists- Somehow relocate some memory accesses to disk 3/36 Virtual memory advantages Can re-locate program while running- Run partially in memory, partially on disk Most of a processs memory will be idle (80/20 rule).- Write idle parts to disk until needed- Let other processes use memory for idle part- Like CPU virtualization: when process not using CPU, switch. When not using a page switch it to another process. Challenge: VM = extra layer, could be slow 4/36 Idea 1: load-time linking Link as usual, but keep the list of references Fix up process when actually executed- Determine where process will reside in memory- Adjust all references within program (using addition) Problems? 5/36 Idea 1: load-time linking Link as usual, but keep the list of references Fix up process when actually executed- Determine where process will reside in memory- Adjust all references within program (using addition) Problems?- How to enforce protection- How to move once in memory (Consider: data pointers)- What if no contiguous free region fits program? 5/36 Idea 2: base + bounds register Two special privileged registers: base and bound On each load/store:- Physical address = virtual address + base- Check 0 virtual address < bound , else trap to kernel How to move process in memory?- Change base register What happens on context switch?- OS must re-load base and bound register 6/36 Idea 2: base + bounds register Two special privileged registers: base and bound On each load/store:- Physical address = virtual address + base- Check 0 virtual address < bound , else trap to kernel How to move process in memory?...
View Full Document

This note was uploaded on 03/13/2010 for the course CS 02523 taught by Professor Davidmieres during the Winter '10 term at A.T. Still University.

Page1 / 40

Lecture 8 Virtual memory HW - Want processes to co-exist...

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

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