[syslinux:lwip] dmi: Add a few more DMI strings

syslinux-bot for H. Peter Anvin hpa at zytor.com
Wed Apr 27 10:45:39 PDT 2011


Commit-ID:  4dda3cb6a74a6651fe263ad538ed48516653c744
Gitweb:     http://syslinux.zytor.com/commit/4dda3cb6a74a6651fe263ad538ed48516653c744
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Wed, 27 Apr 2011 10:07:42 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Wed, 27 Apr 2011 10:44:03 -0700

dmi: Add a few more DMI strings

Add the BIOSVENDOR, BIOSVERSION, and SYSFF strings.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 com32/include/syslinux/sysappend.h |    3 ++
 core/dmi.c                         |   36 +++++++++++++++++++++++----------
 doc/syslinux.txt                   |   38 ++++++++++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 11 deletions(-)

diff --git a/com32/include/syslinux/sysappend.h b/com32/include/syslinux/sysappend.h
index c2a4c53..322456b 100644
--- a/com32/include/syslinux/sysappend.h
+++ b/com32/include/syslinux/sysappend.h
@@ -49,6 +49,9 @@ enum syslinux_sysappend {
     SYSAPPEND_MBVERSION,	/* System or MB version from DMI */
     SYSAPPEND_MBSERIAL,		/* System or MB serial from DMI */
     SYSAPPEND_MBASSET,		/* MB asset tag from DMI */
+    SYSAPPEND_BIOSVENDOR,	/* BIOS vendor */
+    SYSAPPEND_BIOSVERSION,	/* BIOS version string */
+    SYSAPPEND_SYSFF,		/* System form factor */
     SYSAPPEND_MAX		/* Total number of strings */
 };
 
diff --git a/core/dmi.c b/core/dmi.c
index 10e3565..9589ac8 100644
--- a/core/dmi.c
+++ b/core/dmi.c
@@ -237,17 +237,19 @@ struct sysappend_dmi_strings {
 };
 
 static const struct sysappend_dmi_strings dmi_strings[] = {
-    { "SYSVENDOR=",  SYSAPPEND_SYSVENDOR,  1, 0x04 },
-    { "SYSPRODUCT=", SYSAPPEND_SYSPRODUCT, 1, 0x05 },
-    { "SYSVERSION=", SYSAPPEND_SYSVERSION, 1, 0x06 },
-    { "SYSSERIAL=",  SYSAPPEND_SYSSERIAL,  1, 0x07 },
-    { "SYSSKU=",     SYSAPPEND_SYSSKU,     1, 0x19 },
-    { "SYSFAMILY=",  SYSAPPEND_SYSFAMILY,  1, 0x1a },
-    { "MBVENDOR=",   SYSAPPEND_MBVENDOR,   2, 0x04 },
-    { "MBPRODUCT=",  SYSAPPEND_MBPRODUCT,  2, 0x05 },
-    { "MBVERSION=",  SYSAPPEND_MBVERSION,  2, 0x06 },
-    { "MBSERIAL=",   SYSAPPEND_MBSERIAL,   2, 0x07 },
-    { "MBASSET=",    SYSAPPEND_MBASSET,    2, 0x08 },
+    { "SYSVENDOR=",   SYSAPPEND_SYSVENDOR,   1, 0x04 },
+    { "SYSPRODUCT=",  SYSAPPEND_SYSPRODUCT,  1, 0x05 },
+    { "SYSVERSION=",  SYSAPPEND_SYSVERSION,  1, 0x06 },
+    { "SYSSERIAL=",   SYSAPPEND_SYSSERIAL,   1, 0x07 },
+    { "SYSSKU=",      SYSAPPEND_SYSSKU,      1, 0x19 },
+    { "SYSFAMILY=",   SYSAPPEND_SYSFAMILY,   1, 0x1a },
+    { "MBVENDOR=",    SYSAPPEND_MBVENDOR,    2, 0x04 },
+    { "MBPRODUCT=",   SYSAPPEND_MBPRODUCT,   2, 0x05 },
+    { "MBVERSION=",   SYSAPPEND_MBVERSION,   2, 0x06 },
+    { "MBSERIAL=",    SYSAPPEND_MBSERIAL,    2, 0x07 },
+    { "MBASSET=",     SYSAPPEND_MBASSET,     2, 0x08 },
+    { "BIOSVENDOR=",  SYSAPPEND_BIOSVENDOR,  0, 0x04 },
+    { "BIOSVERSION=", SYSAPPEND_BIOSVERSION, 0, 0x05 },
     { NULL, 0, 0, 0 }
 };
 
@@ -295,6 +297,17 @@ static const char *dmi_install_string(const char *pfx, const char *str)
     return nstr;
 }
 
+static void sysappend_set_sysff(const uint8_t *type)
+{
+    static char sysff_str[] = "SYSFF=000";
+
+    if (!type || !*type)
+	return;
+    
+    sprintf(sysff_str+6, "%u", *type & 0x7f);
+    sysappend_strings[SYSAPPEND_SYSFF] = sysff_str;
+}
+
 void dmi_init(void)
 {
     const struct sysappend_dmi_strings *ds;
@@ -304,6 +317,7 @@ void dmi_init(void)
 	return;
 
     sysappend_set_uuid(dmi_find_data(1, 0x08, 16));
+    sysappend_set_sysff(dmi_find_data(3, 0x05, 1));
 
     for (ds = dmi_strings; ds->prefix; ds++) {
 	if (!sysappend_strings[ds->sa]) {
diff --git a/doc/syslinux.txt b/doc/syslinux.txt
index 67740f6..d7efd1c 100644
--- a/doc/syslinux.txt
+++ b/doc/syslinux.txt
@@ -212,10 +212,48 @@ IPAPPEND bitmask
 	0x0400	MBVERSION=	Motherboard version
 	0x0800	MBSERIAL=	Motherboard serial number
 	0x1000	MBASSET=	Motherboard asset tag
+	0x2000  BIOSVENDOR=	BIOS vendor name
+	0x4000	BIOSVERSION=	BIOS version
+	0x8000	SYSFF=		System form factor
 
 	If these strings contain whitespace they it is replaced with
 	underscores (_).
 
+	The system form factor value is a number defined in the SMBIOS
+	specification, available at http://www.dmtf.org/.  As of
+	version 2.7.1 of the specification, the following values are
+	defined:
+
+	  1	Other
+	  2	Unknown
+	  3	Desktop
+	  4	Low profile desktop
+	  5	Pizza box
+	  6	Mini tower
+	  7	Tower
+	  8	Portble
+	  9	Laptop
+	 10	Notebook
+	 11	Handheld
+	 12	Docking station
+	 13	All-in-one
+	 14	Subnotebook
+	 15	Space-saving
+	 16	Lunch box
+	 17	Main server chassis
+	 18	Expansion chassis
+	 19	Subchassis
+	 20	Bus expansion chassis
+	 21	Peripheral chassis
+	 22	RAID chassis
+	 23	Rack mount chasss
+	 24	Sealed-case PC
+	 25	Multi-system chassis
+	 26	Compact PCI
+	 27	Advanced TCI
+	 28	Blade
+	 29	Blade enclosure
+
 SENDCOOKIES bitmask			[PXELINUX only]
 
 	When downloading files over http, the SYSAPPEND strings are



More information about the Syslinux-commits mailing list