OS ppt Unit 3.1
OS ppt Unit 3.1
Memory
Management
Background
• Memory consists of a large array of bytes, each with its own
address. The CPU fetches instructions from memory.
• After the instruction has been executed on the operands,
results may be stored back in memory.
Basic Hardware for Memory Management
• Main memory and the registers built into the processor itself
are the only general-purpose storage that the CPU can access
directly.
• Each process has a separate memory space.
• Memory space protects the processes from each other
• Protection by using two registers, a base and a limit registers
• The base register holds the smallest legal physical memory
address; the limit register specifies the size of the range.
• For example, if the base register holds 300040 and the limit
register is 120900, then the program can access all addresses
from 300040 to 420939 .
• Protection of memory space is accomplished by having the
CPU hardware
• Any attempt by a program executing in user mode to access
operating-system memory or other users’ memory results in a
trap to the operating system, which treats the attempt as a
fatal error
Address Binding
• Compile Time
• Load Time
• Execution Time or Dynamic
Compile time