It say's that to tell the master pic that the slave is at irq2, you for some reason have to send 4 to it instead. The manual vaguely mentions a "PIC number" to send as icw3 which I assumed meant the irq number, i.e. 2 not 4. I've looked in the technical reference for the IBM AT and it doesn't mention anything that it's doing that could cause this and at this point I just have no idea what it could beoutb(PIC1_DATA, 4); // ICW3: tell Master PIC that there is a slave PIC at IRQ2 (0000 0100)
PIC ICW3 explanation
PIC ICW3 explanation
I'm having trouble understanding this line on the wiki for the 8259 pic initialisation:
If I see one more magic number in wiki code then I'm going to lose it.
Re: PIC ICW3 explanation
I think each bit represents an IRQ line - 100b sets the second bit (counting from zero) to represent which IRQ line the PIC2 connects to.
Re: PIC ICW3 explanation
Oh right that does make sense. Documentation was vague so I thought it meant the actual IRQ number
If I see one more magic number in wiki code then I'm going to lose it.
Re: PIC ICW3 explanation
Given that I said that my struggle was with why the value was 4 and not 2 should tell you that I understand how to read binary numbers. I was looking for help about the information that the PIC was expecting due to finding the documentation difficult to read.
If I see one more magic number in wiki code then I'm going to lose it.