GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 20

Protecting memory-mapped input output

Operating Systems · I/O & Disk Scheduling · Full GATE CSE 2005 paper

GATE 2005, Q20 1 mark · MCQ
Report issue

I/O & Disk Scheduling

Question 20, GATE 2005: With memory-mapped I/O and no separate privileged I/O opcodes, what enforces device-access protection? A OS routines alone; B hardware trap; C system configuration alone; D protection impossible.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Map device registers into protected address ranges/pages and have the processor’s memory-protection hardware trap unauthorized user-mode loads or stores. Thus the immediate enforcement is a hardware trap, B, although the operating system configures the permissions and handles the exception. Ordinary unprivileged load/store opcodes do not bypass address protection.

Memory-mapped device registers occupy addresses just like memory. The OS configures access permissions, but hardware checks each user access and raises a protection exception if forbidden. This immediate trap prevents bypassing the OS merely by issuing a load/store instruction. A software routine alone cannot intercept an unchecked direct memory access, so B names enforcement, while configuration establishes policy.

Original paper, page 3