๐ŸŽ“ BookMCQ
โ† Back to 8. Main Memory

๐Ÿ“ Protection in Paging (11 MCQs)

๐Ÿ“– From Operating System โ€ข 8. Main Memory โ€ข 11 questions available

What is Protection in Paging?

Definition:
Protection bits in page table entries control read/write/execute permissions per page enforced by MMU on every access preventing unauthorized operations.

Example:
Code page marked R=1,W=0,X=1R=1, W=0, X=1 allows execution but traps on write attempt protecting against code injection attacks.

Reason:
Fine-grained per-page protection enables secure multitasking and implements W^X policy critical for modern OS security architectures.

3
Easy
4
Medium
4
Hard

๐Ÿ“ All Protection in Paging MCQs

Q1. What is the primary purpose of a limit register in a protected memory system?

A.It holds the smallest physical address
B.It specifies the maximum logical address range โœ…
C.It translates virtual to physical addresses
D.It stores the current instruction pointer
๐Ÿ’ก Difficulty: easy | โœ… Correct: B

๐Ÿ“– Explanation: The limit register defines the upper bound of a processโ€™s logical address space, so any address larger than this limit is invalid. This prevents a process from reading or writing outside its allotted memory. Options A and C describe the relocation (base) register and address translation, while D is unrelated to memory protection. Understanding the limit registerโ€™s role is essential for enforcing isolation between processes.

Q2. A process attempts to read a logical address that exceeds its limit register value. What will the hardware typically do?

A.The MMU adds the relocation value and accesses memory anyway โœ…
B.The CPU raises a protection fault or segmentation fault
C.The operating system silently adjusts the address to fit the limit
D.The process is automatically granted additional memory
๐Ÿ’ก Difficulty: medium | โœ… Correct: A

๐Ÿ“– Explanation: When a logical address is outside the range defined by the limit register, the MMU detects the violation and signals a fault, usually a segmentation fault. This stops the process from accessing unauthorized memory. Option A ignores the limit check, Option C would break protection guarantees, and Option D is not how modern systems allocate memory dynamically. The fault mechanism safeguards system stability.

Q3. Why are both a relocation (base) register and a limit register needed for effective memory protection?

A.Only one of them is sufficient for protection
B.The relocation register provides a starting physical address while the limit register defines the allowable range โœ…
C.Both registers duplicate each otherโ€™s functionality
D.They encrypt addresses for security
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: The relocation (base) register translates a processโ€™s logical addresses to physical addresses by adding a constant offset, establishing where the process begins in memory. The limit register then caps the highest logical address the process may use, ensuring it cannot exceed its allocated region. Options A and C misunderstand their distinct roles, and D describes a function not related to basic protection. Together they give both location and bounds, essential for isolating processes.

Q4. Given a relocation register value of 100040 and a limit register of 74600, what physical address corresponds to logical address 50000?

A.150040
B.175040 โœ…
C.100040
D.74600
๐Ÿ’ก Difficulty: easy | โœ… Correct: B

๐Ÿ“– Explanation: The physical address is calculated by adding the relocation base to the logical address: 100040+50000=150040100040 + 50000 = 150040. This translation places the logical address within the processโ€™s allocated memory region. Option B adds the limit incorrectly, Option C ignores the logical offset, and Option D mistakenly uses the limit as the physical address. This simple arithmetic illustrates how base registers map a processโ€™s address space to actual memory locations.

Q5. How does a limit register enforce memory bounds for a running process?

A.It checks each logical address against the limit value before translation โœ…
B.It adds the limit value to every address
C.It stores the programโ€™s executable code
D.It controls the CPU clock speed
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: Before the MMU translates a logical address, it compares the address with the limit register. If the address exceeds the limit, the access is denied and a fault is raised. This check ensures a process cannot stray beyond its allocated region. Options B and C misrepresent the function of the limit register, and D is unrelated to memory protection. The bound check is a core safeguard in multitasking environments.

Q6. If a system administrator mistakenly sets a processโ€™s limit register to a value larger than its actual memory allocation, what risk does this create?

A.The process may read or write into memory belonging to other processes โœ…
B.The process will execute faster due to fewer checks
C.There is no impact; the limit is only advisory
D.The operating system will immediately crash
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: An oversized limit register removes the boundary that isolates a process, allowing it to access physical addresses that belong to other processes or the kernel. This can lead to data corruption, security breaches, or system instability. Options B and C underestimate the security implications, and D is extreme; the OS typically continues running but the protection is compromised. Proper limit settings are vital for safe multitasking.

Q7. What does the acronym MMU stand for in computer architecture?

A.Memory Management Unit โœ…
B.Main Memory Utility
C.Microprocessor Monitoring Unit
D.Multiple Memory Union
๐Ÿ’ก Difficulty: easy | โœ… Correct: A

๐Ÿ“– Explanation: The MMU is the hardware component that handles address translation, mapping logical (virtual) addresses to physical memory locations and enforcing protection checks. Options B, C, and D are plausible-sounding but incorrect expansions. Knowing the correct term is fundamental for discussing how computers isolate processes and manage memory efficiently.

Q8. In a system with several concurrent processes, each process is given its own relocation register value. How does this design help prevent one process from interfering with another's memory?

A.All processes share the same base address, causing overlap
B.Each process receives a unique base address, so their physical address ranges do not intersect โœ…
C.Relocation registers are ignored during address translation
D.Limit registers become irrelevant when multiple processes run
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: Assigning a distinct base (relocation) value to each process shifts its logical address space to a separate physical region, ensuring that even if two processes use the same logical address, the resulting physical addresses differ. This separation prevents accidental or malicious memory overlap. Options A and C negate the protective effect, while D misunderstands the role of limit registers, which still define each processโ€™s range.

Q9. How does segmentation differ from a simple base/limit (relocation) scheme in terms of protection and flexibility?

A.Segmentation provides variableโ€‘sized logical blocks with individual limits, while base/limit uses a single fixed range โœ…
B.Base/limit offers protection, segmentation does not
C.Segmentation combines protection with flexible block sizes, unlike the fixedโ€‘size base/limit approach
D.Both approaches are identical in functionality
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: Segmentation divides a programโ€™s address space into named segments (code, data, stack), each with its own base and limit, allowing different sized regions and independent protection checks. A simple base/limit scheme uses one contiguous range, limiting flexibility. Option A reverses the characteristics, Option B incorrectly claims segmentation lacks protection, and Option D ignores the distinct mechanisms. Segmentation thus enhances both security and adaptability.

Q10. A program attempts to write to a logical address that is exactly one byte beyond its limit register value. Which hardware component will detect this violation?

A.Arithmetic Logic Unit (ALU)
B.Cache controller
C.MMU limitโ€‘check logic โœ…
D.Graphics Processing Unit (GPU)
๐Ÿ’ก Difficulty: medium | โœ… Correct: C

๐Ÿ“– Explanation: The MMU performs the bound check against the limit register before allowing a write. When the address exceeds the limit, the MMU raises a fault, preventing the illegal write. The ALU processes arithmetic operations, the cache controller manages cached data, and the GPU handles graphics; none are responsible for memory protection checks. This detection is crucial for maintaining process isolation.

Q11. If a programโ€™s base address (relocation register) is changed after it has been loaded into memory, what effect does this have on address translation?

A.All logical addresses are shifted by the new base value during translation โœ…
B.Physical addresses remain unchanged regardless of the new base
C.The limit register becomes unnecessary
D.The CPU ignores the relocation change entirely
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: Changing the relocation register updates the offset added to every logical address, so each address now maps to a different physical location. This allows the operating system to move a program in memory without altering its internal code. Options B and D contradict the fundamental role of the base register, and C misstates the continued need for a limit to enforce bounds. Properly updating the base ensures continued protection and correct operation.

๐Ÿ”— Related Topics (MCQs)