CSE 120 Lecture Notes - Lecture 11: Page Fault, Segmentation Fault, University Of Manchester
85 views4 pages
Implications of Logical Memory
-not ALL pieces need to BE in memory!
-some could be allocated on the disk, and NEVER referenced
-Illusion: there is much MORE memory than we “really” have
-Virtual vs. Logical
-VM is the illusion of large memory
-keep ONLY portion of logical memory in physical
-rest is kept on disk
-Unit of memory is “segment or page”
-each unit of VM corresponds to a page table
-PT tells us where to find pages in PM OR in the disk!
Page Table Entry
|Valid | Ref | Mod | Frame # | Prot: rwx |
Valid: is entry valid? (page in PM?)
----------Rest assumes Valid bit is set! ---------------
Reference: has this page been referenced yet?
Modified: has this page been modified (dirty)?
Frame: what frame is this page in?
Prot: what are the allowable ops?
Note: length is dependent on the Logical Memory, frame # is dependent on Physical Memory
Address Translation & Page Faults
-Get entry: index into PT w/ page #
-possible that Valid bit is OFF (i.e. not in PM!) → page fault - trap into kernel
-Kernel finds a page on disk (kept in kernel data structure)
-process that got “held up” can NOW run
-will try to execute the same instruction again
-NO page fault this time!
-has now been referenced (set to 1)
-will also be modified! (set to 1)
-what if PM is full of pages! → kick a page out!
Faults under Segmentation/Paging
VA: <segment s, page p, offset i>
-use s to index into ST (gets a PT)
-possible that PT is out on the disk! → segment fault
-Check bound (is p < bound) ?
-if not → segmentation violation
-then, use p to index into PT (to get frame f)