[vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-04 Thread Martin Fleisz
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

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-05 Thread Michal Necasek
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? Regards, Michal On 2/4/2019 12:16 PM, Martin Fleisz wrote:

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-05 Thread Martin Fleisz
Hi Michal, I compile the OSE version (with some very small modifications in VBoxBiosAlternative386.asm but that shouldn't do any harm to my understanding) and w

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-05 Thread Michal Necasek
Hi Martin, 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

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-05 Thread Martin Fleisz
Hi Michal, I don't think that biossums is the way you can fix this issue because in DevPcBios.cpp the _DMI_ table is patched dynamically (see https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Devices/PC/DevPcBios.cpp#L1594 where the number and size of the DMI tables is updated) and therefore

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-05 Thread Michal Necasek
Hi Martin, That's not what I'm saying. What I'm saying is that because my BIOS image was run through biossums, I didn't see the dmidecode problem because although the _DMI_ header checksum is wrong (incorrect calculation in DevPcBios.cpp), it does not matter in practice because dmidecode

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-05 Thread Martin Fleisz
Hi Michal, when you look at the source of dmidecode that is not really the case. You are right that dmidecode first looks for the _SM_ header. But then it will check the _SM_ checksum, the _DMI_ signature and the _DMI_ checksum (see https://github.com/mirror/dmidecode/blob/master/dmidecode.c#L5379

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-11 Thread Michal Necasek
Hi Martin, I think I now finally understand what's happening. The checksum calculation code in DevPcBios.cpp is wrong... *but* it actually delivers the correct result, as long as the BIOS image was run through 'biossums' first! Here's why: biossums calculates the checksum of the _DMI_

Re: [vbox-dev] [PATCH] Fix broken SMBios checksum calculation

2019-02-11 Thread Martin Fleisz
Hi Michal, exactly ... that was what I tried to explain! :-) Gave the patch a go and it works just fine - thanks! Cheers, Martin On 11.02.2019 12:09, Michal Necasek wrote: > >    Hi Martin, > >  I think I now finally understand what's happening. The checksum > calculation code in DevPcBios.cpp i