What is the difference between an interrupt and a trap?
Correct answer C. An interrupt comes from hardware such as a device, while a trap is a software-generated event such as a system call or division by zero
Hardware devices signal the CPU asynchronously with interrupts, for example when a disk read completes. A trap (or exception) is raised synchronously by the running program itself, either deliberately for a system call or because of an error such as division by zero. Both transfer control to kernel handlers through a table of handler addresses.
Answer checked How we write and check questions
Discussion