Date: Tue, 26 Jul 2005 14:39:02 -0400 From: Jung-uk Kim <jkim@FreeBSD.org> To: Peter Wemm <peter@wemm.org> Cc: Dag-Erling =?euc-kr?q?Sm=A9=AArgrav?= <des@des.no>, src-committers@FreeBSD.org, cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/boot/i386/libi386 Makefile libi386.h smbios.c src/sys/boot/i386/loader main.c Message-ID: <200507261439.06189.jkim@FreeBSD.org> In-Reply-To: <200507261002.31596.peter@wemm.org> References: <200507141952.j6EJqMVQ009846@repoman.freebsd.org> <86oe8phlq1.fsf@xps.des.no> <200507261002.31596.peter@wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Tuesday 26 July 2005 01:02 pm, Peter Wemm wrote:
> On Tuesday 26 July 2005 04:04 am, Dag-Erling Smørgrav wrote:
> > Jung-uk Kim <jkim@FreeBSD.org> writes:
> > > Log:
> > > Scan static SMBIOS structures and export the following
> > > environment variables to loader: [...]
> >
> > These values are sometimes padded, IWBNI libi386 could remove
> > that padding:
> >
> > hint.smbios.0.system.maker="Dell Inc. "
> > hint.smbios.0.system.product="Dimension XPS Gen 3 "
> >
> > also, there's a typo in one of the strings:
> >
> > Hint.smbios.0.planar.version=" "
> >
> > (note the capital H)
I think we should keep the spaces. SMBIOS spec. says anything before
NULL is valid if my memory serves.
> It's not a typo. Its got the wrong number of fields so the hint
> scanner disables it.
> if (strncmp(cp, "hint.", 5) != 0)
> hit = 0;
> else
> n = sscanf(cp,
> "hint.%32[^.].%d.%32[^=]=%128s", r_name, &r_unit, r_resname,
> r_value); if (hit && n != 4) {
> printf("CONFIG: invalid hint '%s'\n", cp);
> p = index(cp, 'h');
> *p = 'H';
> hit = 0;
> }
>
> hint.smbios.0.planar.version is an illegal hint. It has 5 fields,
> not 4. These are not free-form strings.
Ouch... Is this okay for you?
Thanks,
Jung-uk Kim
[-- Attachment #2 --]
Index: sys/boot/i386/libi386/smbios.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/i386/libi386/smbios.c,v
retrieving revision 1.1
diff -u -r1.1 smbios.c
--- sys/boot/i386/libi386/smbios.c 14 Jul 2005 19:52:22 -0000 1.1
+++ sys/boot/i386/libi386/smbios.c 26 Jul 2005 18:34:34 -0000
@@ -91,26 +91,26 @@
switch(dmi[0]) {
case 0: /* Type 0: BIOS */
- smbios_setenv("hint.smbios.0.bios.vendor", dmi, 0x04);
- smbios_setenv("hint.smbios.0.bios.version", dmi, 0x05);
- smbios_setenv("hint.smbios.0.bios.reldate", dmi, 0x08);
+ smbios_setenv("hint.smbios.0.bios_vendor", dmi, 0x04);
+ smbios_setenv("hint.smbios.0.bios_version", dmi, 0x05);
+ smbios_setenv("hint.smbios.0.bios_reldate", dmi, 0x08);
break;
case 1: /* Type 1: System */
- smbios_setenv("hint.smbios.0.system.maker", dmi, 0x04);
- smbios_setenv("hint.smbios.0.system.product", dmi, 0x05);
- smbios_setenv("hint.smbios.0.system.version", dmi, 0x06);
+ smbios_setenv("hint.smbios.0.system_maker", dmi, 0x04);
+ smbios_setenv("hint.smbios.0.system_product", dmi, 0x05);
+ smbios_setenv("hint.smbios.0.system_version", dmi, 0x06);
break;
case 2: /* Type 2: Base Board (or Module) */
- smbios_setenv("hint.smbios.0.planar.maker", dmi, 0x04);
- smbios_setenv("hint.smbios.0.planar.product", dmi, 0x05);
- smbios_setenv("hint.smbios.0.planar.version", dmi, 0x06);
+ smbios_setenv("hint.smbios.0.planar_maker", dmi, 0x04);
+ smbios_setenv("hint.smbios.0.planar_product", dmi, 0x05);
+ smbios_setenv("hint.smbios.0.planar_version", dmi, 0x06);
break;
case 3: /* Type 3: System Enclosure or Chassis */
- smbios_setenv("hint.smbios.0.chassis.maker", dmi, 0x04);
- smbios_setenv("hint.smbios.0.chassis.version", dmi, 0x06);
+ smbios_setenv("hint.smbios.0.chassis_maker", dmi, 0x04);
+ smbios_setenv("hint.smbios.0.chassis_version", dmi, 0x06);
break;
default: /* skip other types */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507261439.06189.jkim>
