Operating System Learning 28/9/2015
Virtual Memory: The program can be larger than the memory, allowing the execution of the program is not all in memory, on-demand paging.
On-Demand paging: By setting a valid invalid bit, the page is valid and in memory, invalid indicates that the page is not within the logical space of the process or that the page is legitimate but on disk. An error trap occurs when a process tries to access a page with an invalid bit. Processing: 1. Check the Internal page table of the process to determine if the reference is legal and, if it is illegal, to terminate the process and, if it is legal, to invoke the page; 2. Find a free frame in memory, drop the page from the disk into the frame, 3. Modify the Internal table and page table of the process and 4. (Re-fetch, decode, etc.)
The fork () call creates a child process as a copy of the parent process, copying the page that belongs to the parent process, which is not necessary and can be replicated on a write-time.
Page Replacement algorithm:
FIFO: Select the oldest page, the FIFO queue to manage the page, each time the team first, the new page added to the end of the team. Generates a Belady exception (the page error rate may increase as the number of frames allocated increases).
Optimal Displacement (opt/min): Replaces pages that will not be used for the longest time in the future. is the lowest page error rate in all algorithms, with no Belady exception. Difficult to achieve, mainly used for comparative studies.
LRU least Recently used algorithm: Select pages that are not used for the longest time. The use of counters or stacks to maintain the most recent time is often used as a page replacement algorithm.
Approximate LRU: by reference bit. 1. Attach the reference bit algorithm, using 8 bits to indicate whether the page has been referenced in the last 8 cycles, and the minimum value is substituted. 2. Two chance algorithm, based on FIFO, a reference bit, for 1 gives second chance. 3. Enhanced two-chance algorithm, two reference bits, recently used and recently modified, divided into 4 categories.
Operating System Learning 28/9/2015