Sorry,
here is a bit from the file
Bool VIAGetBIOSTable(VIABIOSInfoPtr pBIOSInfo) { VIAModeTablePtr pViaModeTable = pBIOSInfo->pModeTable; unsigned char *pBIOS = NULL, *pRom, *pTable, *pFPanel, *pLCDTable, *pSuptTable; unsigned char *pRefreshTableStart; unsigned char *pRefreshIndexTable; unsigned char *pRefreshTable; unsigned char numSuptPanel, numEntry; unsigned short tableSize; int romSize; int i = 0, j, k, m, sum;
DEBUG(xf86DrvMsg(pBIOSInfo->scrnIndex, X_INFO, "VIAGetBIOSTable\n"));
if (!(pBIOS=xcalloc(1, 0x10000))) { ErrorF("Allocate memory fail !!\n"); return FALSE; }
if (xf86ReadBIOS(0xC0000, 0, pBIOS, 0x10000) != 0x10000) { pBIOSInfo->UseBIOS = FALSE; xfree(pBIOS); ErrorF("Read VGA BIOS image fail !!\n"); } else { if (*((CARD16 *) pBIOS) != 0xAA55) { pBIOSInfo->UseBIOS = FALSE; xfree(pBIOS); ErrorF("VGA BIOS image is wrong!!\n"); } else { romSize = *((CARD8 *) (pBIOS + VIA_BIOS_SIZE_POS)) * 512; pRom = pBIOS; sum = 0;
for (i = 0; i < romSize; i++) { sum += *pRom++; }
if (((CARD8) sum) != 0) { pBIOSInfo->UseBIOS = FALSE; xfree(pBIOS); ErrorF("VGA BIOS image is wrong!! CheckSum = %x\n", sum); } } }