Paging





Each process has its own page table. Each page table entry contains the frame number of the corresponding page in main memory. A bit is needed to indicate whether the page is in main memory or not. Another modify bit is needed to indicate if the page has been altered since it was last loaded into main memory. If no change has been made, the page does not have to be written to the disk when it needs to be swapped out.




A process’s VAS is its context which contains its code, data, and stack. Code pages are stored in a user’s file on disk. Some are currently residing in memory; most are not. Data and stack pages are also stored in a file. Although this file is typically not visible to users. File only exists while a program is executing. OS determines which portions of a process’s Virtual Address Space (VAS) are mapped in memory at any one time. When program need data that is in Virtual Memory, Operating System copies a certain number of pages, blocks of data from hard disk to Main Memory. When requested data is not in Main Memory, the Operating System goes to hard disk and copies the correct page into Main Memory.

Home