Why linux kernel use trap gate to handle divide_error exception?

后端 未结 5 1454
一个人的身影
一个人的身影 2020-12-09 20:16

In kernel 2.6.11.5, divide zero exception handler is set up as:

set_trap_gate(0,÷_error);

According to \"Understanding The Linux

5条回答
  •  一生所求
    2020-12-09 20:29

    DPL bit in IDT is looked at only when software interrupt is called with the int instruction. Division by zero is a software interrupt triggered by the CPU and thus has DPL has no effect in this case

提交回复
热议问题