Skip to content
Snippets Groups Projects
Commit 05bb497f authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Use normal EOI mode

parent 7dd8de77
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,9 @@ pub unsafe fn init() { ...@@ -16,9 +16,9 @@ pub unsafe fn init() {
MASTER.data.write(4); MASTER.data.write(4);
SLAVE.data.write(2); SLAVE.data.write(2);
// Set up interrupt mode (1 is manual, 2 is auto EOI) // Set up interrupt mode (1 is 8086/88 mode, 2 is auto EOI)
MASTER.data.write(2); MASTER.data.write(1);
SLAVE.data.write(2); SLAVE.data.write(1);
// Unmask interrupts // Unmask interrupts
MASTER.data.write(0); MASTER.data.write(0);
......
...@@ -10,8 +10,11 @@ unsafe fn trigger(irq: u8) { ...@@ -10,8 +10,11 @@ unsafe fn trigger(irq: u8) {
if irq < 16 { if irq < 16 {
if irq >= 8 { if irq >= 8 {
pic::SLAVE.mask_set(irq - 8); pic::SLAVE.mask_set(irq - 8);
pic::MASTER.ack();
pic::SLAVE.ack();
} else { } else {
pic::MASTER.mask_set(irq); pic::MASTER.mask_set(irq);
pic::MASTER.ack();
} }
} }
...@@ -37,6 +40,8 @@ interrupt!(pit, { ...@@ -37,6 +40,8 @@ interrupt!(pit, {
let sum = offset.1 + PIT_RATE; let sum = offset.1 + PIT_RATE;
offset.1 = sum % 1000000000; offset.1 = sum % 1000000000;
offset.0 += sum / 1000000000; offset.0 += sum / 1000000000;
pic::MASTER.ack();
}); });
interrupt!(keyboard, { interrupt!(keyboard, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment