• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Would it be possible to add support for saving BIOS on S3 Graphic cards?

stickedy

New Member
Joined
Jan 17, 2008
Messages
30 (0.01/day)
Sadly there's no Windows tool for saving BIOS image of S3 Graphics cards, but perhaps it would be possible to add the support to GPU-Z? I have a tool to flash VGA BIOS for S3 Graphics cards but it's rather useless without a simple way to extract the BIOS.

However, with Linux a rather simple Python script makes it possible to save the BIOS image. I don't know how much is Linux specific, but I guess it should also be possible with Windows?

http://unichrome.cvs.sourceforge.net/unichrome/utils/ (it's part of the work for UniChrome/OpenChrome open source driver)
Code:
#! /usr/bin/env python
#
# Reads VGA rom on standard x86 memory location.
# Tries to retrieve pci vendor and card ids from pci data structure.
# Writes image out to /tmp/VGAROM_<vendor>_<device>.img.
#
#
# /dev/mem is probably awfully linux specific
#
# Luc Verhaegen -- nothing copyrightable here.

from array import array
import sys

if __name__ == "__main__":
    mem = open("/dev/mem", "rb")
    mem.seek(0xC0000)

    rom = array("B")
    rom.fromfile(mem, 3)

    if (rom[0] != 0x55) and (rom[1] != 0xAA):
        print "No x86 video rom found."
        mem.close()
        sys.exit()
        
    size = rom[2] * 512
    print "x86 video rom found: %d bytes large." % size
    rom.fromfile(mem, size - 3)
    mem.close()
    
    crc = 0;
    for byte in rom:
        crc = crc + byte
        if crc > 0xFF:
            crc = crc - 0x100
            
    if crc:
        print "Checksum failed."

    # Read location of pci data.
    pciloc = rom[0x18]

    # check signature
    if ((rom[pciloc] != 0x50) or (rom[pciloc + 1] != 0x43) or
        (rom[pciloc + 2] != 0x49) or (rom[pciloc + 3] != 0x52)):
        print "no PCIR signature."

        name = "/tmp/VGAROM_unknown.img"
    else:
        vendor = "%04X" % ((rom[pciloc + 5] << 8) | rom[pciloc + 4])
        device = "%04X" % ((rom[pciloc + 7] << 8) | rom[pciloc + 6])

        name = "/tmp/VGAROM_%s_%s.img" % (vendor, device)

    dump = open(name, "wb")
    print "Writing complete rom to %s" % name
    rom.tofile(dump)

Please!
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
27,052 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
reading the rom from c0000 is not reliable enough. i asked s3 for how to read the rom but they didnt give a useful answer
 

stickedy

New Member
Joined
Jan 17, 2008
Messages
30 (0.01/day)
reading the rom from c0000 is not reliable enough. i asked s3 for how to read the rom but they didnt give a useful answer
Thanks for your reply! I'm not really a programmer so I guess you know more about those things than myself, but I read the BIOS from two S3 cards with this script and compared it to a "leaked" BIOS from S3 Graphics and the files were identical, at least nothing was viewable missing. Don't know how this works with Windows *shrug*

Is this "reading from c0000 is not reliable enough" some special thing or a general concern? If it could work, perhaps I could test an implementation if it works or not (if it's not to complicated to implement).

However, thanks that you have looked into it!
 

stickedy

New Member
Joined
Jan 17, 2008
Messages
30 (0.01/day)
There's a reply on S3 Graphic's support forum and it seems that someone from S3 Graphics will contact you soon on this topic (or did it already happen?).
 
Last edited:

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
27,052 (3.71/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
they did contact me yesterday night
 
Top