When using legacy BIOS the Intermediate Checksum of the SMBIOS Entry Point 
Structure is calculated incorrectly.

The calculation starts at the wrong offset (at the beginning of pu8PcBios 
rather than pu8PcBios[i]) and creates the sum over the whole pu8PcBios data 
instead of just the next 15 bytes.

The patch below fixes checksum calculation and makes applications like 
dmidecode work again in the guest.

The patch is contributed under the terms of the MIT license.

Cheers, Martin

diff --git src/VBox/Devices/PC/DevPcBios.cpp src/VBox/Devices/PC/DevPcBios.cpp
index e967adff2f..7e56cc18fe 100644
--- src/VBox/Devices/PC/DevPcBios.cpp
+++ src/VBox/Devices/PC/DevPcBios.cpp
@@ -1594,9 +1594,9 @@ static DECLCALLBACK(int)  pcbiosConstruct(PPDMDEVINS 
pDevIns, int iInstance, PCF
             *(uint16_t*)&pThis->pu8PcBios[i + 0x06] = RT_H2LE_U16(cbDmiTables);
             *(uint16_t*)&pThis->pu8PcBios[i + 0x0C] = 
RT_H2LE_U16(cNumDmiTables);
             uint8_t u8Sum = 0;
-            for (unsigned j = 0; j < pThis->cbPcBios; j++)
-                if (j != i + 0x05)
-                    u8Sum += pThis->pu8PcBios[j];
+            for (unsigned j = 0; j < 0x0F; j++)
+                if (j != 0x05)
+                    u8Sum += pThis->pu8PcBios[i + j];
             pThis->pu8PcBios[i + 0x05] = -u8Sum;
             break;
         }

_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to