Page 1 of 1

Need to patch PCI configuration table in Award BIOS 4.51PG

Posted: Sun Sep 22, 2002 3:23 pm
by oalexandre
I've got a M577 mainboard with an Award BIOS 4.51PG and wanted to fia a PnP problem with a SCSI adapter card. After much searching and posting on forums I found another BIOS form a similar motherboard what fixed that problem, but the new BIOS has another map for PCI devices and MODBIN doesn't let you change those settings.

Does anybody know the way to change the PCI Configuration table?

Posted: Sun Sep 22, 2002 3:47 pm
by Rainbow
I did that a couple of times. You need to decompress the main block (usually called original.tmp). Then search for the numbers using hex editor (e.g. if the numbers in MODBIN are 0D, 0E and 0F, search for byte sequence 0Dh, 0Eh, 0Fh) and change them to new values.
You also need to edit PCI IRQ routing table so IRQ routing will work in Windows 98 and up. Search for $PIR in main block. After this signature, there will be some 16b long entries for PCI slots. Each entry begins with 00h, then the slot number shl 3, then another bytes and ends with 00h. In the 0Dh 0Eh 0Fh case, the numbers should be 68h (0Dh shl 3), 70h (0Eh shl 3) and 78h (0Fh shl 3). Usually there's one more entry with number 39h - that's for onboard peripherals.
After editing, you need to compress the BIOS again - I posted a guide somewhere in the forum (regarding HDD size detection).

Some work done

Posted: Sun Sep 22, 2002 5:44 pm
by oalexandre
Ok, I find those values and changed them in the decompressed BIOS image, but after that i tried to load it into modbin and got a checksum error!!! :( So, after modify the BIOS image, I have to recalculate and change the checksum, how?????

Posted: Sun Sep 22, 2002 5:51 pm
by NickS

Posted: Sun Sep 22, 2002 7:12 pm
by Rainbow

Posted: Mon Sep 23, 2002 11:26 pm
by oalexandre
M577 BIOS patching: the whole story

I've got a PC-Chips M577 mainboard with the 990306S BIOS and a Symbios 53C815 SCSI adapter with SDMS BIOS. No problems until I decided to upgrade the Symbios BIOS to the 4.12 version, which supports booting from CD-ROMs. After several EPROMs wasted (because at first I didn't know where to put the 32K BIOS code on the 64K chip), I managed it to install, but my mainboard didn't recognized the new BIOS and loaded the old NCR 3.07 version instead (removing this code with CBROM didn't solve this problem).

I also tried the Jan Steunebrink's patched PC-Chips M577/Amptron PM9900 BIOS and got an INT 13h exception fault when booting Win98 (as I've got a 30 GB IDE HDD, I don't really need this one). After serching the Internet, I found an almost-twin brother of M577, the Chaintech 5AGM2 board, and downloaded its BIOS at http://www.chaintech.de/BIOS/586/5AGM2B02.EXE, flashed it and booted successfully, loading the Symbios BIOS, but unfortunately PCI device numbers were different from the M577 (0D, 0E and 0F instead of 08, 09 and 0A), so PCI cards won't be assigned IRQs :(

I tried twice to patch this BIOS following Rainbow's expertised instructions, but I failed both times and had to go to the EPROM programer service (the same people who burnt my SCSI BIOSes) .... Not only does the 5AGM2 BIOS solve my problem, but also Chaintech's web page claims it to be patched for the >32 GB bug, and furthermore, it has much more chipset features available than the M577.

With all these benefits, I think I would be a good idea if Rainbow could do the patching and then post the BIOS at his web site to made it available to community users.

What do you think of it, Rainbow?

Re:

Posted: Fri Jan 03, 2014 6:56 am
by Komponent
Rainbow wrote:I did that a couple of times. You need to decompress the main block (usually called original.tmp). Then search for the numbers using hex editor (e.g. if the numbers in MODBIN are 0D, 0E and 0F, search for byte sequence 0Dh, 0Eh, 0Fh) and change them to new values.
You also need to edit PCI IRQ routing table so IRQ routing will work in Windows 98 and up. Search for $PIR in main block. After this signature, there will be some 16b long entries for PCI slots. Each entry begins with 00h, then the slot number shl 3, then another bytes and ends with 00h. In the 0Dh 0Eh 0Fh case, the numbers should be 68h (0Dh shl 3), 70h (0Eh shl 3) and 78h (0Fh shl 3). Usually there's one more entry with number 39h - that's for onboard peripherals.
After editing, you need to compress the BIOS again - I posted a guide somewhere in the forum (regarding HDD size detection).
I did exactly that and it didn't change the device number.
Here is my problem:
I have this motherboard:
http://www.ecsusa.com/ECSWebSite/Produc ... 24&LanID=0
The Device Number por the pci slots are:
PCI1 - DEV 8 (IDSEL=AD19)
PCI2 - DEV 9 (IDSEL=AD20)
PCI3 - DEV 10(IDSEL=AD21)
For my project I need to change the device number for one PCI slot, let's choose the second one, so IDSEL=AD16, so I will then have:
PCI2 - DEV 5 (28 HEX after shl 3)
I followed the exact instructions above, flashed the BIOS, yet if I plug a PCI card in the slot, it still reads a Device Number of 9, not 5 (modbin and awdbedit show 5).
Please, do you have any ideeas?

Re: Need to patch PCI configuration table in Award BIOS 4.51

Posted: Fri Jan 03, 2014 8:41 pm
by gandhig
Did you disassemble the original.tmp fully and replaced all the references to the old slot no. with the new no?

Re: Need to patch PCI configuration table in Award BIOS 4.51

Posted: Sat Jan 04, 2014 1:00 am
by Komponent
No, I only did as instructed above and made those 2 changes. If you know how to do it, can you have a look at it?

Re: Need to patch PCI configuration table in Award BIOS 4.51

Posted: Sat Jan 04, 2014 2:52 pm
by gandhig
I'm not an expert or something. but I can give it a try if it is not much different from mine that I recently disassembled. which bios version are you using? Can you send the disassembled bios so that I can continue from there?

Re: Need to patch PCI configuration table in Award BIOS 4.51

Posted: Fri Jan 10, 2014 5:06 pm
by Komponent
I'm not a programmer.
It's this BIOS:
http://eudownload.ecs.com.tw/dlfileecs/ ... m2_10d.exe

Anybody has an idea about how to change device number for a PCI slot?

Re: Need to patch PCI configuration table in Award BIOS 4.51

Posted: Tue Jan 21, 2014 11:16 am
by gandhig
hi, your mainboard's bios has lot of code-wise similarities to my motherboard's bios. but the platform and chipset are entirely different. i'm trying my best to understand the issue. will update if i find something.

meanwhile if you happen to come across the datasheet of this chipset (VT8378/VT8237), share it with us.

Re: Need to patch PCI configuration table in Award BIOS 4.51

Posted: Tue Jan 21, 2014 2:29 pm
by edwin
That datasheet is under NDA from VIA technologies. Only the large OEMs and developers are allowed to have it...