What is a primary benefit of introducing virtual memory (also known as logical memory)?
It makes memory management easier.
Initially, how was the size of a process’s virtual memory constrained in relation to physical memory?
It was limited to the size of physical memory.
What does virtual memory allow regarding a process’s size compared to physical memory?
It allows the size of a process to be greater than the size of physical memory.
The technique that allows a process’s size to be greater than physical memory is known as _____.
demand paging
What is the first method mentioned for loading a program into physical memory at execution time?
Load the entire program in physical memory.
What is a potential inefficiency of loading an entire program into memory when it starts?
The entire program may not be needed in memory initially.
In a program with selectable options, what is the consequence of loading the entire program at once?
It loads the executable code for all options, regardless of whether an option is selected.
What is the second method for loading a program, which involves loading pages only as needed?
Demand paging.
With demand-paged virtual memory, pages are loaded only when they are _____ during program execution.
demanded
Under demand paging, what portion of a program is initially loaded into physical memory?
Only part of the program.
During execution with demand paging, where can a process’s pages be located?
Some pages will be in memory, and some will be in secondary storage.
What is needed to distinguish between pages in memory and pages on disk in a demand-paged system?
Some form of hardware support.
What can be added to a page table to implement demand paging?
A valid-invalid bit.
If a page’s valid-invalid bit is set to ‘valid’, where is the corresponding page located?
The corresponding page is in memory.
If a page’s valid-invalid bit is set to ‘invalid’, where is the corresponding page located?
The page is currently in secondary storage.
What event is triggered when a process tries to access a page that is not in memory?
A page fault, which results in a trap to the OS.
What is the first step the hardware takes when handling a memory access?
Extract the address from the current instruction.
What is the second step in the page fault procedure, after extracting the address?
Use the page table to check if the page is loaded; an ‘invalid’ bit generates a trap.
What is the third step the OS performs after a page fault trap is generated?
Find a free frame in physical memory.
What is the fourth step in handling a page fault, after a free frame is found?
Move the desired page into the newly allocated frame.
What is the fifth step in handling a page fault, after the needed page is moved into memory?
Modify the page table to indicate that the page is now in memory.
What is the final step in the procedure for handling a page fault?
Restart the instruction that was interrupted by the trap.
After a page fault is successfully handled, how does the process access the page?
As if it had always been in memory.
What aspect of a computer system can be significantly affected by demand paging?
The performance of the system.