[syslinux] [RESEND][PATCH] gpllib: dmi: set defaultmemory speed to "Unknown"

Sebastian Herbszt herbszt at gmx.de
Mon May 11 13:18:14 PDT 2009


Pierre-Alexandre Meyer wrote:
> On Friday 10 April 2009 à 09:55:24PM, Sebastian Herbszt wrote:
>> The speed value is available since version 2.3 of the SMBIOS specification.
>> Set the default speed string to "Unknown" for older versions.
>>
>> - Sebastian
>>
>> Index: syslinux-3.74-20-g3b80c26/com32/gpllib/dmi/dmi.c
>> ===================================================================
>> --- syslinux-3.74-20-g3b80c26.orig/com32/gpllib/dmi/dmi.c
>> +++ syslinux-3.74-20-g3b80c26/com32/gpllib/dmi/dmi.c
>> @@ -496,6 +496,7 @@ void dmi_decode(struct dmi_header *h, ui
>>                          if (h->length < 0x15) break;
>>  dmi->memory_count++;
>>  s_memory *mem = &dmi->memory[dmi->memory_count-1];
>> + sprintf(mem->speed, "%s", "Unknown");
>>  dmi->memory[dmi->memory_count-1].filled=true;
>>                          dmi_memory_array_error_handle(WORD(data + 0x06),mem->error);
>>                          dmi_memory_device_width(WORD(data + 0x08),mem->total_width);
>
> This is taken care of in dmi_memory_device_speed() if length >= 0x17.

But since the "Speed" field is printed even if length < 0x17 it uses empty mem->speed instead of "Unknown".

> We have the same issue for other 2.3+ fields (serial, manufacturer,
> ...). Wondering if it wouldn't be better to initialize globally all
> fields elsewhere.

The problem is that hdt displays hard coded fields.

> What does dmidecode do?

dmidecode on the other hand prints only data it finds and doesn't display the unavailable "Speed" field.
Maybe change hdt to only display fields it got data for?

- Sebastian




More information about the Syslinux mailing list