8259 PIC: Possible misinformation in listed source
Posted: Mon Jun 03, 2024 1:53 pm
OSDev 8259 PIC (https://wiki.osdev.org/8259_PIC) article provides the following definitions in the code for reading ISR and IRR registers:
which, according to official manuals and other sources, is correct, however the listed source (https://helppc.netcore2k.net/hardware/8259) states the following:
implying, that bit 0 of OCW3 should be clear, so the command word should be 0x0a.
Considering that the latter is the only source I've found saying that bit 0 should be clear, I believe it is a typo in that source.
I think, however, the mistake is worth being noted in the 8259 PIC article to prevent future readers from getting confused.
Code: Select all
#define PIC_READ_IRR 0x0a /* OCW3 irq ready next CMD read */
#define PIC_READ_ISR 0x0b /* OCW3 irq service next CMD read */
Code: Select all
Operation Control Word 3 (Ports 20h & A0h)
│7│6│5│4│3│2│1│0│ OCW3
│ │ │ │ │ │ │ └─── 1=read IRR on next read, 0=read ISR on next read
│ │ │ │ │ │ └──── 1=act on value of bit 0, 0=no action if bit 0 set
│ │ │ │ │ └───── 1=poll command issued, 0=no poll command issued
│ │ │ │ └────── must be 1 for OCW3
│ │ │ └─────── must be 0 for OCW3
│ │ └──────── 1=set special mask, 0=reset special mask
│ └───────── 1=act on value of bit 5, 0=no action if bit 5 set
└────────── not used (zero)
Considering that the latter is the only source I've found saying that bit 0 should be clear, I believe it is a typo in that source.
I think, however, the mistake is worth being noted in the 8259 PIC article to prevent future readers from getting confused.