PCI BIOS32 SET_PCI_IRQ call fails
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
PCI BIOS32 SET_PCI_IRQ call fails
I try to configure PCI IRQ on my own os.
It uses protected mode with PIC interrupt controller.
When I call PCIBIOS function 0xb10f it fails with error code 0x88 on 2 computers.
It looks like I don't configure something priror calling it.
It uses protected mode with PIC interrupt controller.
When I call PCIBIOS function 0xb10f it fails with error code 0x88 on 2 computers.
It looks like I don't configure something priror calling it.
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
What parameters are you passing to this function?korneliuszo wrote:When I call PCIBIOS function 0xb10f it fails with error code 0x88 on 2 computers.
What are the contents of the PCI IRQ routing table? (Either the table returned by function 0xB10E or the $PIR table.)
Re: PCI BIOS32 SET_PCI_IRQ call fails
So I just had a look at SeaBIOS, and it does not support this function. I would therefore assume that it is not always supported, and that tells me it might not be implemented very well on the BIOSes you did test with.
Carpe diem!
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
Re: PCI BIOS32 SET_PCI_IRQ call fails
I call 0xb10f function with:
https://github.com/korneliuszo/bezbios/ ... i.cpp#L147
PIR table found by $PIR table allows routing I want to make.
https://github.com/korneliuszo/bezbios/ ... i.cpp#L147
PIR table found by $PIR table allows routing I want to make.
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
Okay, but what are the actual values in each register when you perform that call? And what are the actual contents of the $PIR table?
It may also help to disassemble the BIOS code and see if it expects anything unusual. The PCI spec says the way you're calling it should be fine, but maybe the code isn't as position-independent as it should be (or maybe it just plain doesn't work because everyone uses ACPI).
It may also help to disassemble the BIOS code and see if it expects anything unusual. The PCI spec says the way you're calling it should be fine, but maybe the code isn't as position-independent as it should be (or maybe it just plain doesn't work because everyone uses ACPI).
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
Re: PCI BIOS32 SET_PCI_IRQ call fails
It looks relocatable, but I'm not proficient in reverse engineering.
output from pir.py on thinkpad T235
output from pir.py on thinkpad T235
Code: Select all
Found PIR Len: 144
checksum 0
PCI Interrupt Routing 1.0 present.
Router Device: 00:01.0
Exclusive IRQs: None
Compatible Router: 1045:c700
Device: 00:00, on-board
INTA#: Link 0x00, IRQ Bitmap None
INTB#: Link 0x00, IRQ Bitmap None
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
Device: 00:01, on-board
INTA#: Link 0x00, IRQ Bitmap None
INTB#: Link 0x00, IRQ Bitmap None
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
Device: 00:02, on-board
INTA#: Link 0x02, IRQ Bitmap 3 4 5 7 9 10 11 12 14
INTB#: Link 0x12, IRQ Bitmap 3 4 5 7 9 10 11 12 14
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
Device: 00:03, on-board
INTA#: Link 0x00, IRQ Bitmap None
INTB#: Link 0x00, IRQ Bitmap None
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
Device: 00:04, on-board
INTA#: Link 0x22, IRQ Bitmap 3 4 5 7 9 10 11 12 14
INTB#: Link 0x00, IRQ Bitmap None
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
Device: 00:05, on-board
INTA#: Link 0x32, IRQ Bitmap 3 4 5 7 9 10 11 12 14
INTB#: Link 0x00, IRQ Bitmap None
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
Device: 00:14, on-board
INTA#: Link 0x22, IRQ Bitmap 3 4 5 7 9 10 11 12 14
INTB#: Link 0x00, IRQ Bitmap None
INTC#: Link 0x00, IRQ Bitmap None
INTD#: Link 0x00, IRQ Bitmap None
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
You mean 235? That should be old enough for the BIOS to handle IRQ routing. Which IRQ are you trying to route? Could there be a conflict?korneliuszo wrote:thinkpad T235
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
Re: PCI BIOS32 SET_PCI_IRQ call fails
IRQ10, 00:02 link A
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
What happens if you pick a different IRQ?
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
Re: PCI BIOS32 SET_PCI_IRQ call fails
IRQ 11 same effect
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
Can I see the BIOS code? Maybe there's something in there to explain why it doesn't work for you.
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
Re: PCI BIOS32 SET_PCI_IRQ call fails
https://drive.google.com/file/d/1maeKH9 ... sp=sharing
I would post on forum but bin files are not allowed
Set offset as 0 (it sits in 0xf0000 but segments can be reallocated)
I would post on forum but bin files are not allowed
Set offset as 0 (it sits in 0xf0000 but segments can be reallocated)
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
I see nothing wrong with the BIOS code. Are you sure the correct values are in every register? Add "int $3\n\t" right before the call instruction and use the interrupt handler to dump the register contents.
-
- Posts: 10
- Joined: Tue May 23, 2023 4:29 am
Re: PCI BIOS32 SET_PCI_IRQ call fails
Code: Select all
b'INT3!!!'
b'EIP: 0x001090D2'
b'CS: 0x00000008'
b'EFLAGS: 0x00000006'
b'EAX: 0x0000B10F'
b'EBX: 0x00000010'
b'ECX: 0x00000A0A'
b'EDX: 0x00148100'
b'ESI: 0x00148108'
b'EDI: 0x001479CB'
b'EBP: 0x00147980'
b'DS: 0x00000010'
b'ES: 0x00000010'
b'FS: 0x00000010'
b'GS: 0x00000010'
b'PCI 0x000FD86C'
b'PCI 0x0000880F'
-
- Member
- Posts: 5443
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PCI BIOS32 SET_PCI_IRQ call fails
Set an execute breakpoint at offset 0xD7B1 in the BIOS code. Do you hit the breakpoint when you call the BIOS? If so, what is the value of CX at that point?
Are there any unconfigured PCI-to-PCI bridges? (An unconfigured bridge will have class 6, subclass 4, and zero at either offset 0x19 or offset 0x1A in the configuration space.)
Are there any unconfigured PCI-to-PCI bridges? (An unconfigured bridge will have class 6, subclass 4, and zero at either offset 0x19 or offset 0x1A in the configuration space.)