What is the difference between Trap and Interrupt?

后端 未结 10 1076
时光说笑
时光说笑 2020-12-02 03:44

What is the difference between Trap and Interrupt?

If the terminology is different for different systems, then what do they mean on x86?

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-02 03:59

    A trap is called by code like programs and used e. g. to call OS routines (i. e. normally synchronous). An interrupt is called by events (many times hardware, like the network card having received data, or the CPU timer), and - as the name suggests - interrupts the normal control flow, as the CPU has to switch to the driver routine to handle the event.

提交回复
热议问题