Lecture 7 Flashcards
Address Translation and Paging (70 cards)
What is address translation?
The process of converting a virtual address into a physical address.
What role does the OS play in address translation?
The OS must manage memory and intervene at key points to set up hardware for address translation.
What is a base and bounds register?
Registers used to define the limits of a process’s address space in memory.
What is dynamic relocation?
A technique where the OS can move address spaces even after a process has started running.
Fill in the blank: The physical address is calculated as _______.
virtual address + base
What happens when a process tries to access memory outside its bounds?
The CPU raises an exception, and the OS must handle it.
What is a free list in memory management?
A list that includes the size and location of physical memory that is not in use.
What is a page fault?
An exception that occurs when a program tries to access a page that is not currently in memory.
True or False: The OS installs exception handlers at boot time.
True
How does the CPU detect an invalid memory access?
The CPU sends the virtual address to the Memory Management Unit (MMU) for translation.
What does the MMU check when translating a virtual address?
It checks if the address is mapped and if the program has the right permissions.
What is memory fragmentation?
A condition where memory is divided into small, non-contiguous blocks, leading to inefficient usage.
When does the OS reclaim memory?
When a process is terminated.
What is the purpose of exception handlers in the OS?
To handle errors such as invalid memory access or page faults.
What happens during a context switch?
The OS saves and restores the base-and-bounds pair for different processes.
What is the role of privileged instructions in address translation?
They allow the OS to set base/bounds values and handle exceptions.
What is segmentation in memory management?
A technique used to address the issue of fragmentation.
Fill in the blank: The OS must find space for an address space when a process _______.
starts running
What does the OS do when a page fault occurs and the access is valid?
The OS loads the page from disk and returns to user space.
What are the two types of registers required for address translation?
Base register and bounds register.
What is the significance of the Interrupt Descriptor Table (IDT)?
It helps the CPU find the handler for page faults.
What is the consequence of accessing read-only memory?
It triggers a page fault due to permission violation.
What is fragmentation in memory allocation?
Fragmentation occurs when memory is divided into small, non-contiguous blocks, making it difficult to allocate large processes even when enough total memory is available.
What are the two main types of fragmentation?
- Internal Fragmentation
- External Fragmentation