Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPUs having explicit I/O instructions, such I/O protection is ensured by having the I/O instruction privileged. In a CPU with memory mapped I/O, there is no explicit I/O instruction. Which one of the following is true for a CPU with memory mapped I/O?
A. I/O protection is ensured by operating system routine(s)
B. I/O protection is ensured by a hardware trap
C. I/O protection is ensured during system configuration
D. I/O protection is not possible
According to me, the answer should be (B). I believe it is the best option, as it prevents any form of accidents or foul plays from the user.
But my book says the answer should be (A).
Can anyone please help me whether I am right? If not so, then please explain where am I commiting my mistake?
Thanks in advance!