PCI lines remapping in IO Apic

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
iman
Member
Member
Posts: 84
Joined: Wed Feb 06, 2019 10:41 am
Libera.chat IRC: ImAn

PCI lines remapping in IO Apic

Post by iman »

Hi.
For the IO Apic vector remapping, I have 24 entries.
The first 16 are used to remap ISA IRQs. The rest would then be for PCI lines A# to H#. Is this true?

Question:
I used Multi Processor (MP) tables to obtain ISA vectors.
How can I get PCI lines from MP (and not ACPI) table?

Best.
Iman.
Iman Abdollahzadeh
Github
Codeberg
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: PCI lines remapping in IO Apic

Post by nexos »

You should read the MP spec. Basically, IRQ redirection entries contains a source bus field. You then search for a bus entry with this ID. If the bus entry's name is PCI, then you know this is a PCI IRQ. Note that PCI IRQs are encoded. The first two bits say if it is INTA, INTB, or INTC. The next 5 bits give the slot of this IRQ. The last bit reserved. You really should look through the spec, though.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
User avatar
iman
Member
Member
Posts: 84
Joined: Wed Feb 06, 2019 10:41 am
Libera.chat IRC: ImAn

Re: PCI lines remapping in IO Apic

Post by iman »

nexos wrote:You should read the MP spec.
Thanks for your reply. Indeed first I had a quick search in MP spec, but couldn't find it. Anyway I will know now how to go.
Iman Abdollahzadeh
Github
Codeberg
Post Reply