2019329621175-张子行homework-11 Version 0 |
|
👤 Author: by 1148873699qqcom 2021-12-28 07:01:40 |
The missing page exception is inseparable from the page swapping mechanism and is a prerequisite for it to work. The missing page exception occurs when an application accesses a virtual page that has been allocated but not mapped to physical memory.
By using the page-swapping mechanism, the operating system can temporarily put data that cannot fit in physical memory on disk and then put it back into physical memory when it is needed, thus providing applications with memory space that exceeds the capacity of physical memory.
(1) The hardware traps to kernel, saving program counter on stack
(2) Assembly code routine started to save general registers and other volatile info
(3) System discovers page fault has occurred, tries to discover which virtual page needed
(4) Once virtual address caused fault is known, system checks to see if address valid and the protection consistent with access
(5) If frame selected dirty, page is scheduled for transfer to disk, context switch takes place, suspending faulting process
(6) As soon as frame clean, operating system looks up disk address where needed page is, schedules disk operation to bring it in
(7) When disk interrupt indicates page has arrived, tables updated to reflect position, and frame marked as being in normal state
(8) Faulting instruction backed up to state it had when it began and program counter reset
(9) Faulting is scheduled, operating system returns to routine that called it
(10) Routine reloads registers and other state information, returns to user space to continue execution