- 论坛徽章:
- 2
|
liuiang 发表于 2014-02-15 11:29 ![]()
ia32中,进入Ring0的方式有四种,分别为:中断门,任务门,调用门和陷阱门。
linux只是用了中断门,其余 ...
还真是这样,看了下新的代码,现在除了0x80走GATE_TRAP外,其他都走TRAP_INTERRUPT了。
我以前记得笔记(2006年?),还是有很多走GATE_TRAP的:- [旧笔记]Linux为从0到19这20个异常设置handler,在trap_init函数中。
- set_trap_gate(0, ÷_error);
- set_intr_gate(1, &debug);
- set_intr_gate(2, &nmi);
- set_system_intr_gate(3, &int3); /* int3/4 can be called from all */
- set_system_gate(4, &overflow);
- set_trap_gate(5, &bounds);
- set_trap_gate(6, &invalid_op);
- set_trap_gate(7, &device_not_available);
- set_task_gate(8, GDT_ENTRY_DOUBLEFAULT_TSS);
- set_trap_gate(9, &coprocessor_segment_overrun);
- set_trap_gate(10, &invalid_TSS);
- set_trap_gate(11, &segment_not_present);
- set_trap_gate(12, &stack_segment);
- set_trap_gate(13, &general_protection);
- set_intr_gate(14, &page_fault);
- set_trap_gate(15, &spurious_interrupt_bug);
- set_trap_gate(16, &coprocessor_error);
- set_trap_gate(17, &alignment_check);
- #ifdef CONFIG_X86_MCE
- set_trap_gate(18, &machine_check);
- #endif
- set_trap_gate(19, &simd_coprocessor_error);
- ...
- set_system_gate(SYSCALL_VECTOR, &system_call);
复制代码 |
|