VOGONS


First post, by riplin

User metadata
Rank Newbie
Rank
Newbie

Hi folks,

I'm writing some code for my own enjoyment and for that I need to scan through the PCI device tree to find the video card. The problem is, I'm only seeing 2 PCI devices, which are just the chipset devices. Nothing else. The system also boots up without any PCI device listing, which I'm not sure is supposed to be a standard thing?

Here's a picture of just after boot and me running a little tool I wrote to list the vendor and device id's:

BLcDgcN.jpg

The motherboard in question is a TI5VG+ -Z2-0622 running Award BIOS v4.51PG. The BIOS version is 06/19/1998-VP3-586B-W877-2A5LEM2FC-00

I'm running a Pentium MMX 233MHz in this thing and incidentally, when I turn on the external cache, the system won't boot at all. I don't know if it's the cache or the fact that it's a super socket 7 machine so it's not really made to run Pentiums.

Any hints / tips as to what's going wrong?

Reply 1 of 7, by technokater

User metadata
Rank Newbie
Rank
Newbie

Is PnP/PCI configuration set to Auto? I'm actually not sure if that BIOS would list the PCI devices. On my SS7 with AMI BIOS (and an S7 with Award) it is shown after the boxed table and before "Verifying DMI Pool Data" (text is PCI device listing).

Besides having no listings, do the PCI devices work or not?

Reply 2 of 7, by riplin

User metadata
Rank Newbie
Rank
Newbie

Yes, config is set to auto.

The devices work, the issue I'm having is that when I iterate the PCI device list through ports 0xCF8 and 0xCFC, I only get the two devices back shown in the picture (the chipset devices). Not the video card (Trio64 PCI) or the Promise UltraATA card or the 3COM network card. Querying through BIOS calls works, but not port IO, which is supposed to be a requirement for PCI 2+.

Reply 3 of 7, by technokater

User metadata
Rank Newbie
Rank
Newbie

From what I've seen, there is a way to check which operation is supported on the hardware.

AX=0xB101
int 0x1A
bool isPciBios = (AH == 0) && (DX == 0x4350)
int numBus = CL
int pciVersion = BX
int configVer = AL

Those are probably the BIOS functions you are using, right?

Otherwise, the 0xCF8/0xCFC should also work but you need to make sure that no other code is overwriting the register in the meantime. I couldn't find from when this is supported. Do you mind sharing your code? Maybe something is wrong with it. Since it does enumerate some devices I would suspect that the IO port way is supported in general.

Reply 5 of 7, by riplin

User metadata
Rank Newbie
Rank
Newbie

My PCI implementation lives here:
https://github.com/riplin/hag/blob/main/inclu … ag/system/pci.h
https://github.com/riplin/hag/blob/main/src/system/pci.cpp

I use it here, bottom of the file:

https://github.com/riplin/hag/blob/main/tests/tstmodes.cpp

The goal is to get the linear frame buffer address of the video card. I prefer to use the IO ports because I don't want to depend on the DPMI host and drop down to real mode to execute an interrupt. That's also why I'm working on making the video mode setting code work in protected mode (all legacy modes work, I was working on testing the VESA modes).

Barring any bugs in the PCI code, my next step was to disassemble the interrupt handler of the int 0x1A handler and for VIA chipsets try to use whatever it is they do (if the regular IO ports don't return anything).

I also ordered an ALI motherboard in the hopes that that has properly working ports to test the regular IO port path (plus I hope it also solves the external cache not working issue, making the system a bit faster).

Another issue my current motherboard seems to have is that it's not shadowing the video BIOS. even with the settings set to shadow video memory in the BIOS, the video BIOS still lives at 0xC000.

Reply 6 of 7, by mkarcher

User metadata
Rank l33t
Rank
l33t

https://github.com/riplin/hag/blob/main/src/s … tem/pci.cpp#L14

should read continue;, not return;. Currently, you abort on the first unused slot number instead of skipping to the next slot number.

Reply 7 of 7, by riplin

User metadata
Rank Newbie
Rank
Newbie
mkarcher wrote on 2023-11-09, 22:13:

https://github.com/riplin/hag/blob/main/src/s … tem/pci.cpp#L14

should read continue;, not return;. Currently, you abort on the first unused slot number instead of skipping to the next slot number.

Yeah, I also just figured that out when I just brute force dumped all the data regardless of what was in it. I stupidly assumed the devices would be a contiguous list. 🙁 Oh well, thanks for all the help folks! 😁