diff --git a/arch/x86_64/src/device/pic.rs b/arch/x86_64/src/device/pic.rs index d2ae4b032940eaef327674cb036161c426abaed4..8156ad2127a67a87360cd504a56974d40c7cf487 100644 --- a/arch/x86_64/src/device/pic.rs +++ b/arch/x86_64/src/device/pic.rs @@ -16,9 +16,9 @@ pub unsafe fn init() { MASTER.data.write(4); SLAVE.data.write(2); - // Set up interrupt mode (1 is manual, 2 is auto EOI) - MASTER.data.write(2); - SLAVE.data.write(2); + // Set up interrupt mode (1 is 8086/88 mode, 2 is auto EOI) + MASTER.data.write(1); + SLAVE.data.write(1); // Unmask interrupts MASTER.data.write(0); diff --git a/arch/x86_64/src/interrupt/irq.rs b/arch/x86_64/src/interrupt/irq.rs index 8e2aa0337baa14271929dc7daab4d26ab1668e37..f6f38621ae6112f43343ec042058fe174785200d 100644 --- a/arch/x86_64/src/interrupt/irq.rs +++ b/arch/x86_64/src/interrupt/irq.rs @@ -10,8 +10,11 @@ unsafe fn trigger(irq: u8) { if irq < 16 { if irq >= 8 { pic::SLAVE.mask_set(irq - 8); + pic::MASTER.ack(); + pic::SLAVE.ack(); } else { pic::MASTER.mask_set(irq); + pic::MASTER.ack(); } } @@ -37,6 +40,8 @@ interrupt!(pit, { let sum = offset.1 + PIT_RATE; offset.1 = sum % 1000000000; offset.0 += sum / 1000000000; + + pic::MASTER.ack(); }); interrupt!(keyboard, {