aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include
diff options
context:
space:
mode:
authorErwan Velu <erwan@seanodes.com>2006-08-14 22:10:33 +0200
committerH. Peter Anvin <hpa@zytor.com>2006-08-14 22:25:26 -0700
commit1442feb3e09f6752a58191b4630a76e3051bca60 (patch)
tree5eb98c7a2012479ac12562998459c427ea14fb46 /com32/include
parent104dd7b80670b7180cd1ea84f5f9832e92bbcf54 (diff)
downloadsyslinux-1442feb3e09f6752a58191b4630a76e3051bca60.tar.gz
syslinux-1442feb3e09f6752a58191b4630a76e3051bca60.tar.xz
syslinux-1442feb3e09f6752a58191b4630a76e3051bca60.zip
Adding a com32 module to handle DMI
From : Erwan Velu <erwan.velu@free.fr> This patch add a new com32 module named dmi. It can parse DMI Hanldes number 0,1,2,3,4. Using a very simple API, you can read the values of the following "Handles" - BIOS - CHASSIS - SYSTEM - BASE_BOARD - PROCESSOR It's possible and easy to extend to many other Handles. A sample code program called dmitest shows how you can use and display this structures. The codes is mainly taken from the Linux Kernel and the smartmontool projects. Both are GPL, my code too. Testing and feedback are welcomed. Signed-off-by:Erwan Velu <erwan.velu@free.fr>
Diffstat (limited to 'com32/include')
-rw-r--r--com32/include/dmi/dmi.h80
-rw-r--r--com32/include/dmi/dmi_base_board.h57
-rw-r--r--com32/include/dmi/dmi_bios.h148
-rw-r--r--com32/include/dmi/dmi_chassis.h123
-rw-r--r--com32/include/dmi/dmi_processor.h479
-rw-r--r--com32/include/dmi/dmi_system.h36
6 files changed, 923 insertions, 0 deletions
diff --git a/com32/include/dmi/dmi.h b/com32/include/dmi/dmi.h
new file mode 100644
index 00000000..5e72b82c
--- /dev/null
+++ b/com32/include/dmi/dmi.h
@@ -0,0 +1,80 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2006 Erwan Velu - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_H
+#define DMI_H
+
+#define u32 unsigned int
+#define u16 unsigned short
+#define u8 unsigned char
+#define PAGE_SIZE 4096
+
+typedef struct {
+ u32 l;
+ u32 h;
+} u64;
+
+static const char *out_of_spec = "<OUT OF SPEC>";
+static const char *bad_index = "<BAD INDEX>";
+
+#define WORD(x) (u16)(*(const u16 *)(x))
+#define DWORD(x) (u32)(*(const u32 *)(x))
+#define QWORD(x) (*(const u64 *)(x))
+
+#include "dmi_bios.h"
+#include "dmi_system.h"
+#include "dmi_base_board.h"
+#include "dmi_chassis.h"
+#include "dmi_processor.h"
+
+extern char display_line;
+#define moreprintf(...) do { display_line++; if (display_line == 24) { char tempbuf[10]; display_line=0; printf("Press enter to continue"); fgets(tempbuf, sizeof tempbuf, stdin);} printf ( __VA_ARGS__); } while (0);
+
+typedef struct {
+u16 num;
+u16 len;
+u16 ver;
+u32 base;
+} dmi_table;
+
+static dmi_table dmitable;
+
+
+struct dmi_header
+{
+ u8 type;
+ u8 length;
+ u16 handle;
+ u8 *data;
+};
+
+typedef struct {
+ s_bios bios;
+ s_system system;
+ s_base_board base_board;
+ s_chassis chassis;
+ s_processor processor;
+} s_dmi;
+
+void to_dmi_header(struct dmi_header *h, u8 *data);
+void dmi_bios_runtime_size(u32 code, s_dmi *dmi);
+const char *dmi_string(struct dmi_header *dm, u8 s);
+inline int dmi_checksum(u8 *buf);
+void parse_dmitable(s_dmi *dmi);
+void dmi_decode(struct dmi_header *h, u16 ver, s_dmi *dmi);
+int dmi_interate();
+
+/* dmi_utils.c */
+void display_bios_characteristics(s_dmi *dmi);
+void display_base_board_features(s_dmi *dmi);
+void display_processor_flags(s_dmi *dmi);
+#endif
diff --git a/com32/include/dmi/dmi_base_board.h b/com32/include/dmi/dmi_base_board.h
new file mode 100644
index 00000000..8de8adc0
--- /dev/null
+++ b/com32/include/dmi/dmi_base_board.h
@@ -0,0 +1,57 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2006 Erwan Velu - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_BASE_BOARD_H
+#define DMI_BASE_BOARD_H
+
+#include "stdbool.h"
+#define BASE_BOARD_MANUFACTURER_SIZE 32
+#define BASE_BOARD_PRODUCT_NAME_SIZE 32
+#define BASE_BOARD_VERSION_SIZE 16
+#define BASE_BOARD_SERIAL_SIZE 32
+#define BASE_BOARD_ASSET_TAG_SIZE 32
+#define BASE_BOARD_LOCATION_SIZE 32
+#define BASE_BOARD_FEATURES_SIZE 32
+#define BASE_BOARD_TYPE_SIZE 32
+
+#define BASE_BOARD_NB_ELEMENTS 5
+
+static const char *base_board_features_strings[]={
+ "Board is a hosting board", /* 0 */
+ "Board requires at least one daughter board",
+ "Board is removable",
+ "Board is replaceable",
+ "Board is hot swappable" /* 4 */
+};
+
+/* this struct have BASE_BOARD_NB_ELEMENTS */
+/* each bool is associated to the relevant message above */
+typedef struct {
+bool hosting;
+bool board_needs_daughter;
+bool removable;
+bool replaceable;
+bool hot_swappable;
+} __attribute__((__packed__)) s_base_board_features;
+
+typedef struct {
+char manufacturer[BASE_BOARD_MANUFACTURER_SIZE];
+char product_name[BASE_BOARD_PRODUCT_NAME_SIZE];
+char version[BASE_BOARD_VERSION_SIZE];
+char serial[BASE_BOARD_SERIAL_SIZE];
+char asset_tag[BASE_BOARD_ASSET_TAG_SIZE];
+char location[BASE_BOARD_LOCATION_SIZE];
+char type[BASE_BOARD_TYPE_SIZE];
+s_base_board_features features;
+} s_base_board;
+
+#endif
diff --git a/com32/include/dmi/dmi_bios.h b/com32/include/dmi/dmi_bios.h
new file mode 100644
index 00000000..735647ff
--- /dev/null
+++ b/com32/include/dmi/dmi_bios.h
@@ -0,0 +1,148 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2006 Erwan Velu - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_BIOS_H
+#define DMI_BIOS_H
+
+#include "stdbool.h"
+#define BIOS_VENDOR_SIZE 32
+#define BIOS_VERSION_SIZE 32
+#define BIOS_RELEASE_SIZE 16
+#define BIOS_RUNTIME_SIZE_UNIT_SIZE 16
+#define BIOS_ROM_UNIT_SIZE 16
+#define BIOS_BIOS_REVISION_SIZE 16
+#define BIOS_FIRMWARE_REVISION_SIZE 16
+
+#define BIOS_CHAR_NB_ELEMENTS 27
+#define BIOS_CHAR_X1_NB_ELEMENTS 8
+#define BIOS_CHAR_X2_NB_ELEMENTS 3
+
+static const char *bios_charac_strings[]={
+ "BIOS characteristics not supported", /* 3 */
+ "ISA is supported",
+ "MCA is supported",
+ "EISA is supported",
+ "PCI is supported",
+ "PC Card (PCMCIA) is supported",
+ "PNP is supported",
+ "APM is supported",
+ "BIOS is upgradeable",
+ "BIOS shadowing is allowed",
+ "VLB is supported",
+ "ESCD support is available",
+ "Boot from CD is supported",
+ "Selectable boot is supported",
+ "BIOS ROM is socketed",
+ "Boot from PC Card (PCMCIA) is supported",
+ "EDD is supported",
+ "Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)",
+ "Japanese floppy for Toshiba 1.2 MB is supported (int 13h)",
+ "5.25\"/360 KB floppy services are supported (int 13h)",
+ "5.25\"/1.2 MB floppy services are supported (int 13h)",
+ "3.5\"/720 KB floppy services are supported (int 13h)",
+ "3.5\"/2.88 MB floppy services are supported (int 13h)",
+ "Print screen service is supported (int 5h)",
+ "8042 keyboard services are supported (int 9h)",
+ "Serial services are supported (int 14h)",
+ "Printer services are supported (int 17h)",
+ "CGA/mono video services are supported (int 10h)",
+ "NEC PC-98" /* 31 */
+};
+
+/* this struct have BIOS_CHAR_NB_ELEMENTS */
+/* each bool is associated to the relevant message above */
+typedef struct {
+bool bios_characteristics_not_supported;
+bool isa;
+bool mca;
+bool eisa;
+bool pci;
+bool pc_card;
+bool pnp;
+bool apm;
+bool bios_upgreadable;
+bool bios_shadowing;
+bool vlb;
+bool escd;
+bool boot_from_cd;
+bool selectable_boot;
+bool bios_rom_socketed;
+bool edd;
+bool japanese_floppy_nec_9800_1_2MB;
+bool japanese_floppy_toshiba_1_2MB;
+bool floppy_5_25_360KB;
+bool floppy_5_25_1_2MB;
+bool floppy_3_5_720KB;
+bool floppy_3_5_2_88MB;
+bool print_screen;
+bool keyboard_8042_support;
+bool serial_support;
+bool printer_support;
+bool cga_mono_support;
+bool nec_pc_98;
+} __attribute__((__packed__)) s_characteristics;
+
+static const char *bios_charac_x1_strings[]={
+ "ACPI is supported", /* 0 */
+ "USB legacy is supported",
+ "AGP is supported",
+ "I2O boot is supported",
+ "LS-120 boot is supported",
+ "ATAPI Zip drive boot is supported",
+ "IEEE 1394 boot is supported",
+ "Smart battery is supported" /* 7 */
+};
+
+/* this struct have BIOS_CHAR_X1_NB_ELEMENTS */
+/* each bool is associated to the relevant message above */
+typedef struct {
+bool acpi;
+bool usb_legacy;
+bool agp;
+bool i2o_boot;
+bool ls_120_boot;
+bool zip_drive_boot;
+bool ieee_1394_boot;
+bool smart_battery;
+} __attribute__((__packed__)) s_characteristics_x1;
+
+static const char *bios_charac_x2_strings[]={
+ "BIOS boot specification is supported", /* 0 */
+ "Function key-initiated network boot is supported",
+ "Targeted content distribution is supported" /* 2 */
+};
+
+/* this struct have BIOS_CHAR_X2_NB_ELEMENTS */
+/* each bool is associated to the relevant message above */
+typedef struct {
+bool bios_boot_specification;
+bool bios_network_boot_by_keypress;
+bool target_content_distribution;
+} __attribute__((__packed__)) s_characteristics_x2;
+
+typedef struct {
+char vendor[BIOS_VENDOR_SIZE];
+char version[BIOS_VERSION_SIZE];
+char release_date[BIOS_RELEASE_SIZE];
+u16 address;
+u16 runtime_size;
+char runtime_size_unit[BIOS_RUNTIME_SIZE_UNIT_SIZE];
+u16 rom_size;
+char rom_size_unit[BIOS_ROM_UNIT_SIZE];
+s_characteristics characteristics;
+s_characteristics_x1 characteristics_x1;
+s_characteristics_x2 characteristics_x2;
+char bios_revision [BIOS_BIOS_REVISION_SIZE];
+char firmware_revision [BIOS_FIRMWARE_REVISION_SIZE];
+} s_bios;
+
+#endif
diff --git a/com32/include/dmi/dmi_chassis.h b/com32/include/dmi/dmi_chassis.h
new file mode 100644
index 00000000..933b80b9
--- /dev/null
+++ b/com32/include/dmi/dmi_chassis.h
@@ -0,0 +1,123 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2006 Erwan Velu - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_CHASSIS_H
+#define DMI_CHASSIS_H
+
+#define CHASSIS_MANUFACTURER_SIZE 32
+#define CHASSIS_TYPE_SIZE 16
+#define CHASSIS_LOCK_SIZE 16
+#define CHASSIS_VERSION_SIZE 16
+#define CHASSIS_SERIAL_SIZE 32
+#define CHASSIS_ASSET_TAG_SIZE 32
+#define CHASSIS_BOOT_UP_STATE_SIZE 32
+#define CHASSIS_POWER_SUPPLY_STATE_SIZE 32
+#define CHASSIS_THERMAL_STATE_SIZE 32
+#define CHASSIS_SECURITY_STATUS_SIZE 32
+#define CHASSIS_OEM_INFORMATION_SIZE 32
+
+typedef struct {
+char manufacturer[CHASSIS_MANUFACTURER_SIZE];
+char type[CHASSIS_TYPE_SIZE];
+char lock[CHASSIS_LOCK_SIZE];
+char version[CHASSIS_VERSION_SIZE];
+char serial[CHASSIS_SERIAL_SIZE];
+char asset_tag[CHASSIS_ASSET_TAG_SIZE];
+char boot_up_state[CHASSIS_BOOT_UP_STATE_SIZE];
+char power_supply_state[CHASSIS_POWER_SUPPLY_STATE_SIZE];
+char thermal_state[CHASSIS_THERMAL_STATE_SIZE];
+char security_status[CHASSIS_SECURITY_STATUS_SIZE];
+char oem_information[CHASSIS_OEM_INFORMATION_SIZE];
+u16 height;
+u16 nb_power_cords;
+} s_chassis;
+
+static const char *dmi_chassis_type(u8 code)
+{
+ /* 3.3.4.1 */
+ static const char *type[]={
+ "Other", /* 0x01 */
+ "Unknown",
+ "Desktop",
+ "Low Profile Desktop",
+ "Pizza Box",
+ "Mini Tower",
+ "Tower",
+ "Portable",
+ "Laptop",
+ "Notebook",
+ "Hand Held",
+ "Docking Station",
+ "All In One",
+ "Sub Notebook",
+ "Space-saving",
+ "Lunch Box",
+ "Main Server Chassis", /* master.mif says System */
+ "Expansion Chassis",
+ "Sub Chassis",
+ "Bus Expansion Chassis",
+ "Peripheral Chassis",
+ "RAID Chassis",
+ "Rack Mount Chassis",
+ "Sealed-case PC",
+ "Multi-system" /* 0x19 */
+ };
+
+ if(code>=0x01 && code<=0x19)
+ return type[code-0x01];
+ return out_of_spec;
+}
+
+static const char *dmi_chassis_lock(u8 code)
+{
+ static const char *lock[]={
+ "Not Present", /* 0x00 */
+ "Present" /* 0x01 */
+ };
+
+ return lock[code];
+}
+
+static const char *dmi_chassis_state(u8 code)
+{
+ /* 3.3.4.2 */
+ static const char *state[]={
+ "Other", /* 0x01 */
+ "Unknown",
+ "Safe", /* master.mif says OK */
+ "Warning",
+ "Critical",
+ "Non-recoverable" /* 0x06 */
+ };
+
+ if(code>=0x01 && code<=0x06)
+ return(state[code-0x01]);
+ return out_of_spec;
+}
+
+static const char *dmi_chassis_security_status(u8 code)
+{
+ /* 3.3.4.3 */
+ static const char *status[]={
+ "Other", /* 0x01 */
+ "Unknown",
+ "None",
+ "External Interface Locked Out",
+ "External Interface Enabled" /* 0x05 */
+ };
+
+ if(code>=0x01 && code<=0x05)
+ return(status[code-0x01]);
+ return out_of_spec;
+}
+
+#endif
diff --git a/com32/include/dmi/dmi_processor.h b/com32/include/dmi/dmi_processor.h
new file mode 100644
index 00000000..4473d935
--- /dev/null
+++ b/com32/include/dmi/dmi_processor.h
@@ -0,0 +1,479 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2006 Erwan Velu - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_PROCESSOR_H
+#define DMI_PROCESSOR_H
+
+#include "stdbool.h"
+#define PROCESSOR_SOCKET_DESIGNATION_SIZE 32
+#define PROCESSOR_TYPE_SIZE 32
+#define PROCESSOR_FAMILY_SIZE 32
+#define PROCESSOR_MANUFACTURER_SIZE 64
+#define PROCESSOR_VERSION_SIZE 32
+#define PROCESSOR_VOLTAGE_SIZE 16
+#define PROCESSOR_STATUS_SIZE 16
+#define PROCESSOR_UPGRADE_SIZE 16
+#define PROCESSOR_CACHE_SIZE 16
+#define PROCESSOR_SERIAL_SIZE 32
+#define PROCESSOR_ASSET_TAG_SIZE 32
+#define PROCESSOR_PART_NUMBER_SIZE 32
+#define PROCESSOR_ID_SIZE 32
+
+#define PROCESSOR_FLAGS_ELEMENTS 32
+/* Intel AP-485 revision 28, table 5 */
+static const char *cpu_flags_strings[32]={
+ "FPU (Floating-point unit on-chip)", /* 0 */
+ "VME (Virtual mode extension)",
+ "DE (Debugging extension)",
+ "PSE (Page size extension)",
+ "TSC (Time stamp counter)",
+ "MSR (Model specific registers)",
+ "PAE (Physical address extension)",
+ "MCE (Machine check exception)",
+ "CX8 (CMPXCHG8 instruction supported)",
+ "APIC (On-chip APIC hardware supported)",
+ NULL, /* 10 */
+ "SEP (Fast system call)",
+ "MTRR (Memory type range registers)",
+ "PGE (Page global enable)",
+ "MCA (Machine check architecture)",
+ "CMOV (Conditional move instruction supported)",
+ "PAT (Page attribute table)",
+ "PSE-36 (36-bit page size extension)",
+ "PSN (Processor serial number present and enabled)",
+ "CLFSH (CLFLUSH instruction supported)",
+ NULL, /* 20 */
+ "DS (Debug store)",
+ "ACPI (ACPI supported)",
+ "MMX (MMX technology supported)",
+ "FXSR (Fast floating-point save and restore)",
+ "SSE (Streaming SIMD extensions)",
+ "SSE2 (Streaming SIMD extensions 2)",
+ "SS (Self-snoop)",
+ "HTT (Hyper-threading technology)",
+ "TM (Thermal monitor supported)",
+ NULL, /* 30 */
+ "PBE (Pending break enabled)" /* 31 */
+};
+
+/* this struct have PROCESSOR_FLAGS_ELEMENTS */
+/* each bool is associated to the relevant message above */
+typedef struct {
+bool fpu;
+bool vme;
+bool de;
+bool pse;
+bool tsc;
+bool msr;
+bool pae;
+bool mce;
+bool cx8;
+bool apic;
+bool sep;
+bool mtrr;
+bool pge;
+bool mca;
+bool cmov;
+bool pat;
+bool pse_36;
+bool psn;
+bool clfsh;
+bool ds;
+bool acpi;
+bool mmx;
+bool fxsr;
+bool sse;
+bool sse2;
+bool ss;
+bool htt;
+bool tm;
+bool pbe;
+} __attribute__((__packed__)) s_cpu_flags;
+
+typedef struct {
+u8 type;
+u8 family;
+u8 model;
+u8 stepping;
+u8 minor_stepping;
+} __attribute__((__packed__)) s_signature;
+
+typedef struct {
+char socket_designation[PROCESSOR_SOCKET_DESIGNATION_SIZE];
+char type[PROCESSOR_TYPE_SIZE];
+char family[PROCESSOR_FAMILY_SIZE];
+char manufacturer[PROCESSOR_MANUFACTURER_SIZE];
+char version[PROCESSOR_VERSION_SIZE];
+float voltage;
+u16 external_clock;
+u16 max_speed;
+u16 current_speed;
+char status[PROCESSOR_STATUS_SIZE];
+char upgrade[PROCESSOR_UPGRADE_SIZE];
+char cache1[PROCESSOR_CACHE_SIZE];
+char cache2[PROCESSOR_CACHE_SIZE];
+char cache3[PROCESSOR_CACHE_SIZE];
+char serial[PROCESSOR_SERIAL_SIZE];
+char asset_tag[PROCESSOR_ASSET_TAG_SIZE];
+char part_number[PROCESSOR_PART_NUMBER_SIZE];
+char id[PROCESSOR_ID_SIZE];
+s_cpu_flags cpu_flags;
+s_signature signature;
+} s_processor;
+
+static const char *dmi_processor_type(u8 code)
+{
+ /* 3.3.5.1 */
+ static const char *type[]={
+ "Other", /* 0x01 */
+ "Unknown",
+ "Central Processor",
+ "Math Processor",
+ "DSP Processor",
+ "Video Processor" /* 0x06 */
+ };
+
+ if(code>=0x01 && code<=0x06)
+ return type[code-0x01];
+ return out_of_spec;
+}
+
+static const char *dmi_processor_family(u8 code)
+{
+ /* 3.3.5.2 */
+ static const char *family[]={
+ NULL, /* 0x00 */
+ "Other",
+ "Unknown",
+ "8086",
+ "80286",
+ "80386",
+ "80486",
+ "8087",
+ "80287",
+ "80387",
+ "80487",
+ "Pentium",
+ "Pentium Pro",
+ "Pentium II",
+ "Pentium MMX",
+ "Celeron",
+ "Pentium II Xeon",
+ "Pentium III",
+ "M1",
+ "M2",
+ NULL, /* 0x14 */
+ NULL,
+ NULL,
+ NULL, /* 0x17 */
+ "Duron",
+ "K5",
+ "K6",
+ "K6-2",
+ "K6-3",
+ "Athlon",
+ "AMD2900",
+ "K6-2+",
+ "Power PC",
+ "Power PC 601",
+ "Power PC 603",
+ "Power PC 603+",
+ "Power PC 604",
+ "Power PC 620",
+ "Power PC x704",
+ "Power PC 750",
+ NULL, /* 0x28 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,/* 0x2F */
+ "Alpha",
+ "Alpha 21064",
+ "Alpha 21066",
+ "Alpha 21164",
+ "Alpha 21164PC",
+ "Alpha 21164a",
+ "Alpha 21264",
+ "Alpha 21364",
+ NULL, /* 0x38 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x3F */
+ "MIPS",
+ "MIPS R4000",
+ "MIPS R4200",
+ "MIPS R4400",
+ "MIPS R4600",
+ "MIPS R10000",
+ NULL, /* 0x46 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x4F */
+ "SPARC",
+ "SuperSPARC",
+ "MicroSPARC II",
+ "MicroSPARC IIep",
+ "UltraSPARC",
+ "UltraSPARC II",
+ "UltraSPARC IIi",
+ "UltraSPARC III",
+ "UltraSPARC IIIi",
+ NULL, /* 0x59 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x5F */
+ "68040",
+ "68xxx",
+ "68000",
+ "68010",
+ "68020",
+ "68030",
+ NULL, /* 0x66 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x6F */
+ "Hobbit",
+ NULL, /* 0x71 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x77 */
+ "Crusoe TM5000",
+ "Crusoe TM3000",
+ "Efficeon TM8000",
+ NULL, /* 0x7B */
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x7F */
+ "Weitek",
+ NULL, /* 0x81 */
+ "Itanium",
+ "Athlon 64",
+ "Opteron",
+ "Sempron",
+ NULL, /* 0x86 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x8F */
+ "PA-RISC",
+ "PA-RISC 8500",
+ "PA-RISC 8000",
+ "PA-RISC 7300LC",
+ "PA-RISC 7200",
+ "PA-RISC 7100LC",
+ "PA-RISC 7100",
+ NULL, /* 0x97 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0x9F */
+ "V30",
+ NULL, /* 0xA1 */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0xAF */
+ "Pentium III Xeon",
+ "Pentium III Speedstep",
+ "Pentium 4",
+ "Xeon",
+ "AS400",
+ "Xeon MP",
+ "Athlon XP",
+ "Athlon MP",
+ "Itanium 2",
+ "Pentium M",
+ NULL, /* 0xBA */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0xC7 */
+ "IBM390",
+ "G4",
+ "G5",
+ NULL, /* 0xCB */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL, /* 0xF9 */
+ "i860",
+ "i960",
+ NULL, /* 0xFC */
+ NULL,
+ NULL,
+ NULL /* 0xFF */
+ /* master.mif has values beyond that, but they can't be used for DMI */
+ };
+
+ if(family[code]!=NULL) {
+ return family[code];
+ }
+ return out_of_spec;
+}
+
+static const char *dmi_processor_status(u8 code)
+{
+ static const char *status[]={
+ "Unknown", /* 0x00 */
+ "Enabled",
+ "Disabled By User",
+ "Disabled By BIOS",
+ "Idle", /* 0x04 */
+ "Other" /* 0x07 */
+ };
+
+ if(code<=0x04)
+ return status[code];
+ if(code==0x07)
+ return status[0x05];
+ return out_of_spec;
+}
+static const char *dmi_processor_upgrade(u8 code)
+{
+ /* 3.3.5.5 */
+ static const char *upgrade[]={
+ "Other", /* 0x01 */
+ "Unknown",
+ "Daughter Board",
+ "ZIF Socket",
+ "Replaceable Piggy Back",
+ "None",
+ "LIF Socket",
+ "Slot 1",
+ "Slot 2",
+ "370-pin Socket",
+ "Slot A",
+ "Slot M",
+ "Socket 423",
+ "Socket A (Socket 462)",
+ "Socket 478",
+ "Socket 754",
+ "Socket 940",
+ "Socket 939" /* 0x12 */
+ };
+
+ if(code>=0x01 && code<=0x11)
+ return upgrade[code-0x01];
+ return out_of_spec;
+}
+
+static void dmi_processor_cache(u16 code, const char *level, u16 ver, char *cache)
+{
+ if(code==0xFFFF)
+ {
+ if(ver>=0x0203)
+ sprintf(cache,"Not Provided");
+ else
+ sprintf(cache,"No %s Cache", level);
+ }
+ else
+ sprintf(cache,"0x%04X", code);
+}
+
+
+#endif
diff --git a/com32/include/dmi/dmi_system.h b/com32/include/dmi/dmi_system.h
new file mode 100644
index 00000000..02f2382c
--- /dev/null
+++ b/com32/include/dmi/dmi_system.h
@@ -0,0 +1,36 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2006 Erwan Velu - All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_SYSTEM_H
+#define DMI_SYSTEM_H
+
+#define SYSTEM_MANUFACTURER_SIZE 32
+#define SYSTEM_PRODUCT_NAME_SIZE 32
+#define SYSTEM_VERSION_SIZE 16
+#define SYSTEM_SERIAL_SIZE 32
+#define SYSTEM_UUID_SIZE 40
+#define SYSTEM_WAKEUP_TYPE_SIZE 32
+#define SYSTEM_SKU_NUMBER_SIZE 32
+#define SYSTEM_FAMILY_SIZE 32
+
+typedef struct {
+char manufacturer[SYSTEM_MANUFACTURER_SIZE];
+char product_name[SYSTEM_PRODUCT_NAME_SIZE];
+char version[SYSTEM_VERSION_SIZE];
+char serial[SYSTEM_SERIAL_SIZE];
+char uuid[SYSTEM_UUID_SIZE];
+char wakeup_type[SYSTEM_WAKEUP_TYPE_SIZE];
+char sku_number[SYSTEM_SKU_NUMBER_SIZE];
+char family[SYSTEM_FAMILY_SIZE];
+} s_system;
+
+#endif