Created
November 19, 2013 02:23
-
-
Save StefanoFiumara/7539225 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(virtual_memory[index_to_access] == -1) { | |
//not in ram | |
//it's on the disk | |
//call page fault handler | |
int new_frame = page_fault_handler(); | |
//clear out old frame info | |
if(ram[new_frame] != -1) { | |
virtual_memory[ ram[new_frame] ] = -1; | |
} | |
//mark page table entry | |
virtual_memory[index_to_access] = new_frame; | |
//place page in new_frame index of main memory | |
ram[new_frame] = index_to_access; | |
} else { | |
//it's in ram | |
//update info for page replacement algorithms | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment