Answer
8
Both
traps and interrupts are methods of calling operating
system functions by non-operating system entities. Both
cause a switch to supervisor mode. The difference is what
entity does the calling, and how the "call" is done.
Traps allow user programs to
call OS functions by executing a special trap instruction
or software interrupt. Parameters can be passed by placing
them in processor registers prior to executing the trap.
Interrupts allow devices to
"call" operating system functions by raising a signal
on a special hardware bus. The CPU saves the current
execution context and activates a context previously
set up to handle the interrupt. The interrupt service
routine reads device registers and/or blocks of control
information in memory to determine how to handle the
interrupt.
Contributor: Naveen PN