2023-04-24

PCI Bios 2.1 Question - How to set device interrupt

I am in hopes someone with PCI programming experience would lend me some advice.

I own a piece of test equipment (Logic Analyzer) which uses an old Pentium class (circa '97) motherboard running Win98 This motherboard appears to be 'hard-configured' such that configuration through the bios is limited. There are only a couple of PCI devices which are embedded on the motherboard. However, there is an unpopulated PCI slot that I am attempting to get up and running. I managed to solder in a PCI connector and soldered several jumpers so that the slot is working fine from a hardware standpoint. I've installed a PCI LAN board which the system recognizes and allocates resources. The problem is the BIOS is not assigning an interrupt. One of the limitations of the BIOS configuration is that there is no way to assign interrupts and the BIOS is not doing that automatically. A BIOS update is not happening.

My idea as to a solution was to write a small application that will write to the 82371 South Bridge part that controls the IRQ routing. This appears to work, but the OS/Bios is reverting to the original. Specifically, when reading from the 82371 router config registers:

` A# - IRQ 11   
  B# - IRQ-NONE  
  C# - IRQ-NONE  
  D# - IRQ 9`

I've verified that there exists no routing table and IRQ 11/9 are the only PCI interrupts. I should note that the LAN card is a single function device and the A# int output is physically routed to the router B# input (as you would expect). After writing to the 82371 router registers, B# - IRQ 10 (10 is not used in my system and is available), I read back the registers and it indicates a correct write. After a brief period of time someone changes it back to B# - IRQ-NONE. I am successful in setting the interrupt controller and setting the interrupts to be level-triggered. These changes are permanent until the next boot.

So, does anyone have any suggestions as to forcing the PCI slot to be assigned IRQ-10 to the router B# input?

I see in the PCI Bios Rev 2.1 spec a function for setting the PCI Hardware Interrupt (Sec 4.2.3) and I was going to try this but I'm confused about how to call this function. Below is a copy/paste of the relevant section on using this function. Not being fluent in assembly language may be part of the issue. I understand the concept of segment:offset but the description below speaks of setting the DS segment so that the physical address should resolve to 0x0F0000 but there is no mention of which register is used for the offset. I am guessing that BX is used and thus the segment is computed based on what is setup in the BX register.

I would appreciate any input on my questions. Thanks Jim

`  ENTRY:
   [AH] PCI_FUNCTION_ID
   [AL] SET_PCI_HW_INT
   [CL] IntPin parameter. Valid values 0Ah..0Dh
   [CH] IRQNum parameter. Valid values 0..0Fh
   [BX] BusDev parameter. [BH] holds bus number, 
   [BL] holds Device (upper five bits) and Function (lower 3 bits) numbers.
   [DS] Segment or Selector for BIOS data.
        For 16-bit code the real-mode segment or PM selector
        must resolve to physical address 0F0000h and have a limit of 64K.
   EXIT:
   [AH] Return Code:
   SUCCESSFUL
   SET_FAILED
   FUNC_NOT_SUPPORTED
   [CF] Completion Status, set = error, cleared = success`


No comments:

Post a Comment