

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


UNIVERSITY of WISCONSIN-MADISON
Computer Sciences Department
CS 537
A. Arpaci-Dusseau
Intro to Operating Systems
Spring 2000
-
How do processes share main memory?
-
What are the advantages and disadvantages of static relocation?
-
What are the advantages and disadvantages of dynamic relocation?
-
How does the memory management interact with hardware?
Silberschatz/Galvin: Chapter 8
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
Early batch monitorsPersonal computers
-
Only one process can run at a time
-
Process can destroy OS
0 2^N
OS User Process
Highest memory holds OSProcess starts at memory address 0, up to the OS
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
-
Several processes to coexist in main memory
-
Processes not aware that memory is shared
-
Run regardless of number and/or locations of processes
-
Cannot corrupt OS or other processes
-
Privacy: Cannot read data of other processes
-
Purpose of sharing is to increase efficiency
-
Do not waste CPU or memory resources
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
-
Processes can run anywhere in memory (can’t predict in advance)
-
Modify addresses statically (similar to linker) when
load
process
-
Allows multiple processes to run
-
Requires no hardware support
2^N 0
OS
Process 2Process 1
Process 3
Highest memory holds OSProcesses allocated starting at 0, up to the OS
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
-
Fragmentation: May not be able to allocate new process
What kind?
-
Processes may not be able to increase address space
-
Can’t move process after it has been placed?
2^N 0
OS
Process 2Process 1 Process 3
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
-
Program addresses are called
logical or virtual
addresses
-
Hardware addresses are called
physical or real
addresses.
CPU
MMU
Memory
Logical Addresses
Physical Addresses
Memory Management Unit
OS controls MMU
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
N 0
Memory
Address Space 1 Address Space 2Address Space 3
Logical view
Physical view
0 0 0
1 process, multiple threads
stackheapcode
A.Arpaci-Dusseau
CS 537:Operating Systems
Lecture13.fm.
-
Privileged (protected, kernel) mode
: When OS runs
When trap into OS (system calls, interrupts, errors)Allows certain instructions to be executedAllows OS to access all of physical memory
-
User mode:
When user processes run
Performs translation of logical address to physical address
-
Base register:
Start location for address space
-
Bounds register:
Last valid address the process may generate
Appears to have private memory of size equal to bounds register