smbios.c revision 199767f8919635c4928607450d9e0abb932109ce
2N/A * Copyright (c) 2005-2009 Jung-uk Kim <jkim@FreeBSD.org> 2N/A * All rights reserved. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * 1. Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions and the following disclaimer. 2N/A * 2. Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in the 2N/A * documentation and/or other materials provided with the distribution. 2N/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2N/A/* In EFI, we don't need PTOV(). */ * Detect SMBIOS and export information about the SMBIOS into the * System Management BIOS Reference Specification, v2.6 Final * 2.1.1 SMBIOS Structure Table Entry Point * "On non-EFI systems, the SMBIOS Entry Point structure, described below, can * be located by application software by searching for the anchor-string on * paragraph (16-byte) boundaries within the physical memory address range * 000F0000h to 000FFFFFh. This entry point encapsulates an intermediate anchor * string that is used by some existing DMI browsers." for (
sum = 0, i = 0; i <
len; i++)
/* Search on 16-byte boundaries. */ for (i =
1; i <
idx; i++)
if (
zeros == 0 && n == 0)
else if (
ones == 0 && n ==
1)
* "Although RFC 4122 recommends network byte order for all * fields, the PC industry (including the ACPI, UEFI, and * Microsoft specifications) has consistently used * little-endian byte encoding for the first three fields: * time_low, time_mid, time_hi_and_version. The same encoding, * also known as wire format, should also be used for the * SMBIOS representation of the UUID." * Note: We use network byte order for backward compatibility * unless SMBIOS version is 2.6+ or little-endian is forced. "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
case 0:
/* 3.3.1 BIOS Information (Type 0) */ case 1:
/* 3.3.2 System Information (Type 1) */ case 2:
/* 3.3.3 Base Board (or Module) Information (Type 2) */ case 3:
/* 3.3.4 System Enclosure or Chassis (Type 3) */ case 4:
/* 3.3.5 Processor Information (Type 4) */ * Offset 18h: Processor Status * Bit 7 Reserved, must be 0 * Bit 6 CPU Socket Populated * 1 - CPU Socket Populated * 0 - CPU Socket Unpopulated * Bit 5:3 Reserved, must be zero * 2h - CPU Disabled by User via BIOS Setup * 3h - CPU Disabled by BIOS (POST Error) * 4h - CPU is Idle, waiting to be enabled case 6:
/* 3.3.7 Memory Module Information (Type 6, Obsolete) */ * Offset 0Ah: Enabled Size * 1 - Double-bank connection * 0 - Single-bank connection * Bit 6:0 Size (n), where 2**n is the size in MB * 7Dh - Not determinable (Installed Size only) * 7Eh - Module is installed, but no memory case 17:
/* 3.3.18 Memory Device (Type 17) */ * 1 - Value is in kilobytes units * 0 - Value is in megabytes units default:
/* skip other types */ /* Find structure terminator. */ /* Find structure terminator. */ /* Search signatures and validate checksums. */ /* Get system information from SMBIOS */ /* XXXRP currently, only called from non-EFI. */