Swapping: Unix OS by Deepak Mangal
Swapping: Unix OS by Deepak Mangal
Unix OS
By Deepak Mangal
Memory Management
polices
CPU can not execute a process that exists
entirely in secondary memory, at least a part
of program must be in primary memory.
The memory mgmt. system will decide which
program reside in main memory.
It monitor the amount of memory available
in main memory and periodically write
processes in secondary memory device
called swap device.
At a later time, kernel read data from swap
device back to main memory.
Intially
Address :1
Units:10000
100 units allocated
Address :101
Units:9900
50 units allocated
Address:151
Units:9850
Kernel steps
It is not necessary that the kernel
write the entire virtual address space
of a process to a swap device.
When the kernel swaps the process
back, it knows virtual address map of
the process, so it can reassign the
process to the correct virtual
address.