Practice mode Operating Systems

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

Explanation

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.