ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) > student directories > 2017329621011-蔡腾皓 >
homework-7 Version 0
👤 Author: by 781863542qqcom 2019-11-13 08:14:44
A page fault occurs when a program attempts to access data or code that is in its address space, but is not currently located in the system RAM.

As soon as the page fault occurs, the computer hardware traps to the kernel and program counter (PC) is saved on the stack. Current instruction state information is saved in CPU registers.Operating system finds that a page fault has occurred and tries to find out which virtual page is needed and system checks to see if address is valid and checks if there is no protection access problem.If the virtual address is valid, the system checks to see if a page frame is free. If no frames are free, the page replacement algorithm is run to remove a page.after a page is swapped out, operating system looks up disk address where needed page is, schedules disk operation to bring it in.When disk interrupt indicates page has arrived, page tables are updated to reflect its position, and frame marked as being in normal state.Faulting instruction is backed up to state it had when it began and PC is reset. Faulting is scheduled, operating system returns to routine that called it.Assembly Routine reloads register and other state information, returns to user space to continue execution.

Please login to reply. Login

Reversion History

Loading...
No reversions found.