Why linux kernel use trap gate to handle divide_error exception?

后端 未结 5 1450
一个人的身影
一个人的身影 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:30

    The kernel is not running under user mode. It has to handle the trap generated by user mode programs (e.g. linux processes in user-land). Kernel code is not expected to divide by zero.

    I don't understand well your question. How would you implement it otherwise?

提交回复
热议问题