在设置中断之前将所有的中断描述符定向到unsupported处理函数

This commit is contained in:
pointer-to-bios 2024-04-04 22:47:42 +08:00
parent bec4634857
commit 37ee2ca85d
1 changed files with 8 additions and 1 deletions

View File

@ -4,8 +4,14 @@
#include <kernel/arch/x86_64/interrupt_procs.h> #include <kernel/arch/x86_64/interrupt_procs.h>
void interrupt_init() void interrupt_init()
{ {
gate_descriptor_t gate; gate_descriptor_t gate;
trap_gate_generate(gate, interrupt_entry_sym(UNSUPPORTED));
for (usize i = 4; i < 256; i++)
{
interrupt_register_gate(gate, i);
}
trap_gate_generate(gate, interrupt_entry_sym(DE)); trap_gate_generate(gate, interrupt_entry_sym(DE));
interrupt_register_gate(gate, 0); interrupt_register_gate(gate, 0);
trap_gate_generate(gate, interrupt_entry_sym(UNSUPPORTED)); trap_gate_generate(gate, interrupt_entry_sym(UNSUPPORTED));
@ -14,5 +20,6 @@ void interrupt_init()
interrupt_register_gate(gate, 2); interrupt_register_gate(gate, 2);
trap_gate_generate(gate, interrupt_entry_sym(BP)); trap_gate_generate(gate, interrupt_entry_sym(BP));
interrupt_register_gate(gate, 3); interrupt_register_gate(gate, 3);
interrupt_open(); interrupt_open();
} }