[vbox-dev] Updating _DMI_ needs updating _SM_ V2

Jan Schunk scpcom at gmx.de
Mon Apr 2 16:33:35 GMT 2012


Version 2:
pcbiosConstruct has now code updating the _DMI_ structure, but this also 
needs updating the _SM_ structure.
_DMI_ checksum is only for the entry itself.

-------------- next part --------------
Index: VBox/Devices/PC/DevPcBios.cpp
===================================================================
--- VBox/Devices/PC/DevPcBios.cpp	(revision 40732)
+++ VBox/Devices/PC/DevPcBios.cpp	(working copy)
@@ -1272,12 +1272,24 @@
     {
         *(uint16_t*)&pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x06] = cbDmiTables;
         uint8_t u8Sum = 0;
-        for (unsigned i = 0; i < pThis->cbPcBios; i++)
-            if (i != VBOX_DMI_TABLE_OFFSET + 0x05)
-                u8Sum += pThis->pu8PcBios[i];
+        for (unsigned i = 0; i < 0x0f; i++)
+            if (i != 0x05)
+                u8Sum += pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + i];
         pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x05] = -u8Sum;
     }
 
+    if (   pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET - 0x10 + 0x00] == '_'
+        && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET - 0x10 + 0x01] == 'S'
+        && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET - 0x10 + 0x02] == 'M'
+        && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET - 0x10 + 0x03] == '_')
+    {
+        uint8_t u8Sum = 0;
+        for (unsigned i = 0; i < 0x1f; i++)
+            if (i != 0x04)
+                u8Sum += pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET - 0x10 + i];
+        pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET - 0x10 + 0x04] = -u8Sum;
+    }
+
     if (pThis->u8IOAPIC)
         FwCommonPlantMpsTable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE,
                               _4K - VBOX_DMI_TABLE_SIZE, pThis->cCpus);


More information about the vbox-dev mailing list