IPU OS Unit 1
IPU OS Unit 1
ETCS 304
UNIT 1
If processes don’t fit in memory, swapping moves them in and out to run
First-fit and best-fit better than worst-fit in terms of speed and storage
utilization
4
1
3 2
4
Segment table – maps two-dimensional physical addresses; each table entry has:
base – contains the starting physical address where the segments reside in
memory
limit – specifies the length of the segment
Hierarchical Paging
Hashed Page Tables
Inverted Page Tables
Department of CSE, Operating Systems BVCOE NEW DELHI
Hierarchical Page Tables
where p1ofisCSE,
Department an index into
Operating the outer
Systems BVCOEpage table, and p2 is the
NEW DELHI
displacement within the page of the inner page table
Address-Translation Scheme
With swapping, pager guesses which pages will be used before swapping out
again
Instead, pager brings in only those pages into memory
How to determine that set of pages?
Need new MMU functionality to implement demand paging
If pages needed are already memory resident
No difference from non demand-paging
If page needed and not memory resident
Need to detect and load the page into memory from storage
Without changing program behavior
Without programmer needing to change code
3. Bring the desired page into the (newly) free frame; update the page
and frame tables
4. Continue the process by restarting the instruction that caused the trap
Note now potentially 2 page transfers for page fault – increasing EAT
15 page faults
Replace page that will not be used for longest period of time
9 is optimal for the example
How do you know this?
Can’t read the future
Used for measuring how well your algorithm performs
Answer: (c)