瀏覽代碼

fix: execute cli before setting idt

greatbridf 3 年之前
父節點
當前提交
8e0fa0e23a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/kernel/interrupt.c

+ 2 - 0
src/kernel/interrupt.c

@@ -11,6 +11,8 @@ static struct IDT_entry IDT[256];
 
 void init_idt()
 {
+    asm_cli();
+
     asm_outb(PORT_PIC1_COMMAND, 0x11); // edge trigger mode
     asm_outb(PORT_PIC1_DATA, 0x20); // start from int 0x20
     asm_outb(PORT_PIC1_DATA, 0x04); // PIC1 is connected to IRQ2 (1 << 2)