fix(pic): unmask cascade IRQ2 when enabling a slave IRQ - #106
Merged
Conversation
pic_remap() masks every IRQ line (0xFF) including IRQ2, the cascade input for the slave PIC, and nothing ever unmasks it. Any IRQ in the 8-15 range (RTC, PS/2 mouse, ATA, ...) could therefore never be delivered, even after calling pic_unmask_irq() for it. Unmask the cascade line on the master whenever a slave IRQ is enabled.
Contributor
Author
PoC
outb(PIC1_DATA, 0xFF);
outb(PIC2_DATA, 0xFF);That includes IRQ2 on the master : the line the slave PIC is cascaded onto : and nothing ever clears it. So no slave interrupt (IRQ 8–15) can reach the CPU, even after you "enable" it: // try to enable the RTC (IRQ 8)
irq_register_handler(8, rtc_callback);
pic_unmask_irq(8); // clears IRQ8 in the SLAVE mask only
// rtc_callback never fires: IRQ2 on the master is still masked,
// so the slave's output is blocked before it reaches the CPU
|
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pic_remap()masks every IRQ line (0xFF) including IRQ2, the cascade input for the slave PIC, and nothing ever unmasks it. Any IRQ in the 8-15 range (RTC, PS/2 mouse, ATA, ...) could therefore never be delivered, even after callingpic_unmask_irq()for it. This unmasks the cascade line on the master whenever a slave IRQ is enabled.