[vbox-dev] [PATCH] Fix broken SMBios checksum calculation
michal.necasek at oracle.com
Tue Feb 5 16:02:45 UTC 2019
Now it's making sense. The '_DMI_' table header checksum code is wrong
in DevPCBios.cpp. But dmidecode normally does not get that far, because
it finds the '_SM_' marker first, and that one has the right checksum if
the BIOS image got run through the 'biossums' tool. I suspect that's not
happening for you, and that is something which is probably missing from
I can't see into your repository on github. But you're probably right
and it's not doing any harm. Anyway, now I see how to reproduce the
On 2/5/2019 4:09 PM, Martin Fleisz wrote:
> Hi Michal,
> I compile the OSE version (with some very small modifications in
> but that shouldn't do any harm to my understanding) and when running
> dmidecode on Ubuntu 18.04 it reports "# No SMBIOS nor DMI entry point
> found, sorry.". After applying the patch everything worked just fine.
> I checked with VirtualBox 6.0.4 and it works just fine out of the box
> ... so I guess either the checksum is somehow valid by accident or there
> is some code missing/different in the OSE repository.
> Best regards, Martin
> On 05.02.2019 15:48, Michal Necasek wrote:
>> Hi Martin,
>> The patch looks good, but I'm struggling to reproduce the problem.
>> The dmidecode utility in Ubuntu 18.04.1 and 18.10 (dmidecode version
>> 3.1 in both) does not generate any complaints. So what exactly does?
>> On 2/4/2019 12:16 PM, Martin Fleisz wrote:
>>> 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
>>> 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] =
>>> *(uint16_t*)&pThis->pu8PcBios[i + 0x0C] =
>>> 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;
>>> vbox-dev mailing list
>>> vbox-dev at virtualbox.org
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
> vbox-dev mailing list
> vbox-dev at virtualbox.org
More information about the vbox-dev