8259 PIC: Possible misinformation in listed source

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
NotYourFox
Posts: 3
Joined: Sun Jun 02, 2024 6:29 am

8259 PIC: Possible misinformation in listed source

Post by NotYourFox »

OSDev 8259 PIC (https://wiki.osdev.org/8259_PIC) article provides the following definitions in the code for reading ISR and IRR registers:

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 */
which, according to official manuals and other sources, is correct, however the listed source (https://helppc.netcore2k.net/hardware/8259) states the following:

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)
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.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: 8259 PIC: Possible misinformation in listed source

Post by nullplan »

In doubt, you should probably believe the Intel datasheet over the claims of random websites. In this case
Intel datasheet wrote:The IRR can be read when, prior to the RD pulse, a Read Register Command is issued with OCW3 (RR = 1, RIS = 0.)
The ISR can be read, when, prior to the RD pulse, a Read Register Command is issued with OCW3 (RR = 1, RIS = 1).
So the values listed on the Wiki are correct and the netcore page is wrong.
Carpe diem!
Post Reply