Browse Source

fix: execute cli before setting idt

greatbridf 3 years ago
parent
commit
8e0fa0e23a
1 changed files with 2 additions and 0 deletions
  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)