Maria Hybinette, UGA
CSCI [4|6]730 Operating Systems
Main Memory
Maria Hybinette, UGA
Memory Questions?
! What is main memory? ! How does multiple processes share memory
space?
» Key is how do they refer to memory addresses?
! What is static and dynamic allocation? ! What is segmentation?
Maria Hybinette, UGA
Review: Motivation for Multiprogramming
! Disadvantages: » Only one process runs at a time » Process can destroy OS
User Process OS
Physical Memory
2n-1
Stack Code Heap
Address Space Uniprocessing: One process runs at a time
Low Address (0x00000000) High Address (0x7fffffff)
Maria Hybinette, UGA
Multiprogramming Goals
! Sharing
» Several processes coexist in main memory » Cooperating processes can share portions of address space
! Transparency
» Processes are not aware that memory is shared » Works regardless of number and/or location of processes
! Protection
» Cannot corrupt OS or other processes » Privacy: Cannot read data of other processes
! Efficiency
» Do not waste CPU or memory resources » Keep fragmentation low (later)
Maria Hybinette, UGA
Memory Addresses
! Address space
» What we go so far:
– Physical addresses
Maria Hybinette, UGA
Static Relocation (after loading)
! Goal: Allow transparent sharing -
Each address space may be placed anywhere in memory
» OS finds free space for new process » Modify addresses statically (similar to linker) when loading the process » Fixed addresses.
! Advantages:
» Allows multiple processes to run » Requires no hardware support
Initial P0 Process P3 Process P2 Process P1 System Memory