* [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine
@ 2007-12-07 20:45 Ryan Harper
0 siblings, 0 replies; 16+ messages in thread
From: Ryan Harper @ 2007-12-07 20:45 UTC (permalink / raw)
To: qemu-devel
This patchset introduces SMBIOS/DMI table generation to qemu for PC machines.
The intial patch includes all changes needed to create the tables and load
them into memory. This patch depends on libuuid. The subsequent patches
detect for libuuid and optionally link to the library if present. The final
patch adds a -uuid option for a user to specify their own uuid.
These patches should apply against qemu-cvs. Tested on target x86_64-softmmu.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
7 files changed, 821 insertions(+), 5 deletions(-)
Makefile.target | 9
configure | 26 ++
hw/pc.c | 47 ++++
smbios.c | 540 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
smbios_types.h | 182 ++++++++++++++++++
sysemu.h | 4
vl.c | 18 +
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine
@ 2007-12-11 20:08 Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines Ryan Harper
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Ryan Harper @ 2007-12-11 20:08 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
This patchset introduces SMBIOS/DMI table generation to qemu for PC machines.
The intial patch includes all changes needed to create the tables and load
them into memory. This patch depends on libuuid. The subsequent patches
detect for libuuid and optionally link to the library if present. The final
patch adds a -uuid option for a user to specify their own uuid.
These patches should apply against qemu-cvs. Tested on target x86_64-softmmu.
Updates:
- moved smbios.o into i386 target section
- removed open segment in hw/pc.c and moved variable declaration
- removed some uneeded externs from smbios.c
- added uuid_parse implementation allowing -uuid to be available with or without linking against libuuid.
- reduced the number of CONFIG_UUID defines
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
7 files changed, 848 insertions(+), 11 deletions(-)
Makefile.target | 9
configure | 26 ++
hw/pc.c | 45 ++++
smbios.c | 584 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
smbios_types.h | 182 +++++++++++++++++
sysemu.h | 5
vl.c | 8
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines
2007-12-11 20:08 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
@ 2007-12-11 20:08 ` Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 3 of 3] Add -uuid command line flag Ryan Harper
2 siblings, 0 replies; 16+ messages in thread
From: Ryan Harper @ 2007-12-11 20:08 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
5 files changed, 749 insertions(+), 3 deletions(-)
Makefile.target | 4
hw/pc.c | 45 ++++
smbios.c | 517 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
smbios_types.h | 182 +++++++++++++++++++
sysemu.h | 4
# HG changeset patch
# User Ryan Harper <ryanh@us.ibm.com>
# Date 1197402121 21600
# Node ID e81bef5fa072360d12b87b3237b7d3f72c9b9784
# Parent 25082b761acbe8b7fa535dedb4a53e02ef74128d
export SMBIOS/DMI tables to PC machines.
This patch introduces code to generate PC SMBIOS/DMI tables and load them
into machine memory. The resultant machine can use standard tools like
dmidecode to examine the in-memory generated table.
Moved smbios.o to TARGET_BASE_ARCH=i386 section of Makefile.target
Removed inner scoping for smbios table call in hw/pc.c
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
diff -r 25082b761acb -r e81bef5fa072 Makefile.target
--- a/Makefile.target Wed Dec 05 03:23:38 2007 +0000
+++ b/Makefile.target Tue Dec 11 13:42:01 2007 -0600
@@ -440,7 +440,7 @@ VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SO
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
-VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
+VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o smbios.o
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
endif
ifeq ($(TARGET_BASE_ARCH), ppc)
@@ -535,7 +535,7 @@ ifndef CONFIG_DARWIN
ifndef CONFIG_DARWIN
ifndef CONFIG_WIN32
ifndef CONFIG_SOLARIS
-VL_LIBS+=-lutil
+VL_LIBS+=-lutil -luuid
endif
endif
endif
diff -r 25082b761acb -r e81bef5fa072 hw/pc.c
--- a/hw/pc.c Wed Dec 05 03:23:38 2007 +0000
+++ b/hw/pc.c Tue Dec 11 13:42:01 2007 -0600
@@ -44,6 +44,13 @@
#define MAX_IDE_BUS 2
+/* Hole in BIOS space between 0xF0000 and 0xFFF0 for DMI entry point */
+#define SMBIOS_ENTRY 0x000fac00
+
+/* ensure SMBIOS tables have enough room to support MAX_CPUS number of
+ * processor entries */
+#define SMBIOS_EXTRA (5 << 12)
+
static fdctrl_t *floppy_controller;
static RTCState *rtc_state;
static PITState *pit;
@@ -706,7 +713,9 @@ static void pc_init1(int ram_size, int v
char buf[1024];
int ret, linux_boot, i;
ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset;
- int bios_size, isa_bios_size, vga_bios_size;
+ ram_addr_t smbios_offset, entrypoint_offset, smbios_base;
+ uint32_t smbios_phys;
+ int bios_size, isa_bios_size, vga_bios_size, smbios_size;
PCIBus *pci_bus;
int piix3_devfn = -1;
CPUState *env;
@@ -832,6 +841,40 @@ static void pc_init1(int ram_size, int v
}
}
+ /* phys_ram_base + bios_offset implies 0xe0000 in guest ram */
+ smbios_base = (ram_addr_t)phys_ram_base + bios_offset;
+
+ /* take a guess at smbios size */
+ smbios_size = (SMBIOS_EXTRA-1) & ~4095;
+
+ /* we only have 32k of space between rombios32 and rombios16 */
+ if (smbios_size > SMBIOS_MAXIMUM_SIZE) {
+ fprintf(stderr, "qemu: SMBIOS image size too big (%u), max %u\n",
+ smbios_size, SMBIOS_MAXIMUM_SIZE);
+ exit(1);
+ }
+
+ /* smbios is composed of two regions, an entry point table and
+ * a second table of all of the data. These regions will live
+ * at different phyiscal addresses so we need to reserve space
+ * for two locations
+ * NB: Entry point is a fixed size (0x1f)
+ */
+
+ /* use the hole between end of rombios32 and start of
+ * rombios16 @ 0xf0000 */
+ smbios_phys = 0xf0000 - smbios_size;
+ smbios_offset = (ram_addr_t)(smbios_phys - 0xe0000);
+ entrypoint_offset = (ram_addr_t)(SMBIOS_ENTRY - 0xe0000);
+
+ ret = load_smbios_tables((uint8_t *)smbios_base + entrypoint_offset,
+ (uint8_t *)smbios_base + smbios_offset,
+ smbios_phys);
+ if (ret < 0) {
+ fprintf(stderr, "qemu: could not generate SMBIOS\n");
+ exit(1);
+ }
+
/* map all the bios at the top of memory */
cpu_register_physical_memory((uint32_t)(-bios_size),
bios_size, bios_offset | IO_MEM_ROM);
diff -r 25082b761acb -r e81bef5fa072 smbios.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smbios.c Tue Dec 11 13:42:01 2007 -0600
@@ -0,0 +1,517 @@
+/*
+ * smbios.c - Generate SMBIOS tables for Xen HVM domU's.
+ * - Adapted for QEMU/KVM
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) IBM Corporation, 2006, 2007
+ *
+ * Authors: Andrew D. Ball <aball@us.ibm.com>
+ * Ryan Harper <ryanh@us.ibm.com>
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <uuid/uuid.h>
+#include "hw/hw.h"
+#include "sysemu.h"
+#include "smbios_types.h"
+#include "config-host.h"
+
+/* Write a two-character hex representation of 'byte' to digits[].
+ Pre-condition: sizeof(digits) >= 2 */
+void
+byte_to_hex(char *digits, uint8_t byte)
+{
+ uint8_t nybbel = byte >> 4;
+
+ if ( nybbel > 9 )
+ digits[0] = 'a' + nybbel-10;
+ else
+ digits[0] = '0' + nybbel;
+
+ nybbel = byte & 0x0f;
+ if ( nybbel > 9 )
+ digits[1] = 'a' + nybbel-10;
+ else
+ digits[1] = '0' + nybbel;
+}
+
+/* Convert an array of 16 unsigned bytes to a DCE/OSF formatted UUID
+ string.
+
+ Pre-condition: sizeof(dest) >= 37 */
+static void
+uuid_to_string(char *dest, uint8_t *uuid)
+{
+ int i = 0;
+ char *p = dest;
+
+ for ( i = 0; i < 4; i++ )
+ {
+ byte_to_hex(p, uuid[i]);
+ p += 2;
+ }
+ *p++ = '-';
+ for ( i = 4; i < 6; i++ )
+ {
+ byte_to_hex(p, uuid[i]);
+ p += 2;
+ }
+ *p++ = '-';
+ for ( i = 6; i < 8; i++ )
+ {
+ byte_to_hex(p, uuid[i]);
+ p += 2;
+ }
+ *p++ = '-';
+ for ( i = 8; i < 10; i++ )
+ {
+ byte_to_hex(p, uuid[i]);
+ p += 2;
+ }
+ *p++ = '-';
+ for ( i = 10; i < 16; i++ )
+ {
+ byte_to_hex(p, uuid[i]);
+ p += 2;
+ }
+ *p = '\0';
+}
+
+static void
+smbios_entry_point_init(void *start,
+ uint16_t max_structure_size,
+ uint16_t structure_table_length,
+ uint32_t structure_table_address,
+ uint16_t number_of_structures)
+{
+ uint8_t sum;
+ int i;
+ struct smbios_entry_point *ep = (struct smbios_entry_point *)start;
+
+ strncpy(ep->anchor_string, "_SM_", 4);
+ ep->length = 0x1f;
+ ep->smbios_major_version = 2;
+ ep->smbios_minor_version = 4;
+ ep->max_structure_size = max_structure_size;
+ ep->entry_point_revision = 0;
+ memset(ep->formatted_area, 0, 5);
+ strncpy(ep->intermediate_anchor_string, "_DMI_", 5);
+
+ ep->structure_table_length = structure_table_length;
+ ep->structure_table_address = structure_table_address;
+ ep->number_of_structures = number_of_structures;
+ ep->smbios_bcd_revision = 0x24;
+
+ ep->checksum = 0;
+ ep->intermediate_checksum = 0;
+
+ sum = 0;
+ for ( i = 0; i < 0x10; i++ )
+ sum += ((int8_t *)start)[i];
+ ep->checksum = -sum;
+
+ sum = 0;
+ for ( i = 0x10; i < ep->length; i++ )
+ sum += ((int8_t *)start)[i];
+ ep->intermediate_checksum = -sum;
+}
+
+/* Type 0 -- BIOS Information */
+#define RELEASE_DATE_STR "01/01/2007"
+static void *
+smbios_type_0_init(void *start, const char *version,
+ uint32_t major_version, uint32_t minor_version)
+{
+ struct smbios_type_0 *p = (struct smbios_type_0 *)start;
+
+ p->header.type = 0;
+ p->header.length = sizeof(struct smbios_type_0);
+ p->header.handle = 0;
+
+ p->vendor_str = 1;
+ p->version_str = 2;
+ p->starting_address_segment = 0xe800;
+ p->release_date_str = 3;
+ p->rom_size = 0;
+
+ memset(p->characteristics, 0, 8);
+ p->characteristics[7] = 0x08; /* BIOS characteristics not supported */
+ p->characteristics_extension_bytes[0] = 0;
+ p->characteristics_extension_bytes[1] = 0;
+
+ p->major_release = (uint8_t) major_version;
+ p->minor_release = (uint8_t) minor_version;
+ p->embedded_controller_major = 0xff;
+ p->embedded_controller_minor = 0xff;
+
+ /* copy in vendor string */
+ start += sizeof(struct smbios_type_0);
+ strcpy((char *)start, "QEMU");
+
+ /* copy in version string */
+ start += strlen("QEMU") + 1;
+ strcpy((char *)start, version);
+
+ /* copy in release date string */
+ start += strlen(version) + 1;
+ strcpy((char *)start, RELEASE_DATE_STR);
+ start += strlen(RELEASE_DATE_STR) +1;
+
+ *((uint8_t *)start) = 0;
+ return start + 1;
+}
+
+/* Type 1 -- System Information */
+static void *
+smbios_type_1_init(void *start, const char *version,
+ uint8_t uuid[16])
+{
+ char uuid_str[37];
+ struct smbios_type_1 *p = (struct smbios_type_1 *)start;
+ p->header.type = 1;
+ p->header.length = sizeof(struct smbios_type_1);
+ p->header.handle = 0x100;
+
+ p->manufacturer_str = 1;
+ p->product_name_str = 2;
+ p->version_str = 3;
+ p->serial_number_str = 4;
+
+ memcpy(p->uuid, uuid, 16);
+
+ p->wake_up_type = 0x06; /* power switch */
+ p->sku_str = 0;
+ p->family_str = 0;
+
+ start += sizeof(struct smbios_type_1);
+
+ strcpy((char *)start, "QEMU");
+ start += strlen("QEMU") + 1;
+ strcpy((char *)start, "QEMU");
+ start += strlen("QEMU") + 1;
+ strcpy((char *)start, version);
+ start += strlen(version) + 1;
+ uuid_to_string(uuid_str, uuid);
+ strcpy((char *)start, uuid_str);
+ start += strlen(uuid_str) + 1;
+ *((uint8_t *)start) = 0;
+
+ return start+1;
+}
+
+/* Type 3 -- System Enclosure */
+static void *
+smbios_type_3_init(void *start)
+{
+ struct smbios_type_3 *p = (struct smbios_type_3 *)start;
+
+ p->header.type = 3;
+ p->header.length = sizeof(struct smbios_type_3);
+ p->header.handle = 0x300;
+
+ p->manufacturer_str = 1;
+ p->type = 0x01; /* other */
+ p->version_str = 0;
+ p->serial_number_str = 0;
+ p->asset_tag_str = 0;
+ p->boot_up_state = 0x03; /* safe */
+ p->power_supply_state = 0x03; /* safe */
+ p->thermal_state = 0x03; /* safe */
+ p->security_status = 0x02; /* unknown */
+
+ start += sizeof(struct smbios_type_3);
+
+ strcpy((char *)start, "QEMU");
+ start += strlen("QEMU") + 1;
+ *((uint8_t *)start) = 0;
+ return start+1;
+}
+
+/* Type 4 -- Processor Information */
+static void *
+smbios_type_4_init(void *start, unsigned int cpu_number, char *cpu_manufacturer)
+{
+ char buf[80];
+ struct smbios_type_4 *p = (struct smbios_type_4 *)start;
+ CPUState *env = first_cpu;
+
+ p->header.type = 4;
+ p->header.length = sizeof(struct smbios_type_4);
+ p->header.handle = 0x400 + cpu_number;
+
+ p->socket_designation_str = 1;
+ p->processor_type = 0x03; /* CPU */
+ p->processor_family = 0x01; /* other */
+ p->manufacturer_str = 2;
+
+ p->cpuid[0] = env->cpuid_version;
+ p->cpuid[1] = env->cpuid_features;
+
+ p->version_str = 0;
+ p->voltage = 0;
+ p->external_clock = 0;
+
+ p->max_speed = 0; /* unknown */
+ p->current_speed = 0; /* unknown */
+
+ p->status = 0x41; /* socket populated, CPU enabled */
+ p->upgrade = 0x01; /* other */
+
+ start += sizeof(struct smbios_type_4);
+
+ /* NB: supports up to 255 cpus */
+ strncpy(buf, "CPU ", sizeof(buf));
+ if ( (sizeof(buf) - strlen("CPU ")) >= 3 )
+ snprintf(buf + strlen("CPU "), 4, "%d", cpu_number);
+
+ strcpy((char *)start, buf);
+ start += strlen(buf) + 1;
+
+ strcpy((char *)start, cpu_manufacturer);
+ start += strlen(cpu_manufacturer) + 1;
+
+ *((uint8_t *)start) = 0;
+ return start+1;
+}
+
+/* Type 16 -- Physical Memory Array */
+static void *
+smbios_type_16_init(void *start, uint32_t memsize)
+{
+ struct smbios_type_16 *p = (struct smbios_type_16*)start;
+
+ p->header.type = 16;
+ p->header.handle = 0x1000;
+ p->header.length = sizeof(struct smbios_type_16);
+
+ p->location = 0x01; /* other */
+ p->use = 0x03; /* system memory */
+ p->error_correction = 0x01; /* other */
+ p->maximum_capacity = memsize * 1024;
+ p->memory_error_information_handle = 0xfffe; /* none provided */
+ p->number_of_memory_devices = 1;
+
+ start += sizeof(struct smbios_type_16);
+ *((uint16_t *)start) = 0;
+ return start + 2;
+}
+
+/* Type 17 -- Memory Device */
+static void *
+smbios_type_17_init(void *start, uint32_t memory_size_mb)
+{
+ struct smbios_type_17 *p = (struct smbios_type_17 *)start;
+
+ p->header.type = 17;
+ p->header.length = sizeof(struct smbios_type_17);
+ p->header.handle = 0x1100;
+
+ p->physical_memory_array_handle = 0x1000;
+ p->total_width = 64;
+ p->data_width = 64;
+ /* truncate memory_size_mb to 16 bits and clear most significant
+ bit [indicates size in MB] */
+ p->size = (uint16_t) memory_size_mb & 0x7fff;
+ p->form_factor = 0x09; /* DIMM */
+ p->device_set = 0;
+ p->device_locator_str = 1;
+ p->bank_locator_str = 0;
+ p->memory_type = 0x07; /* RAM */
+ p->type_detail = 0;
+
+ start += sizeof(struct smbios_type_17);
+ strcpy((char *)start, "DIMM 1");
+ start += strlen("DIMM 1") + 1;
+ *((uint8_t *)start) = 0;
+
+ return start+1;
+}
+
+/* Type 19 -- Memory Array Mapped Address */
+static void *
+smbios_type_19_init(void *start, uint32_t memory_size_mb)
+{
+ struct smbios_type_19 *p = (struct smbios_type_19 *)start;
+
+ p->header.type = 19;
+ p->header.length = sizeof(struct smbios_type_19);
+ p->header.handle = 0x1300;
+
+ p->starting_address = 0;
+ p->ending_address = (memory_size_mb-1) * 1024;
+ p->memory_array_handle = 0x1000;
+ p->partition_width = 1;
+
+ start += sizeof(struct smbios_type_19);
+ *((uint16_t *)start) = 0;
+ return start + 2;
+}
+
+/* Type 20 -- Memory Device Mapped Address */
+static void *
+smbios_type_20_init(void *start, uint32_t memory_size_mb)
+{
+ struct smbios_type_20 *p = (struct smbios_type_20 *)start;
+
+ p->header.type = 20;
+ p->header.length = sizeof(struct smbios_type_20);
+ p->header.handle = 0x1400;
+
+ p->starting_address = 0;
+ p->ending_address = (memory_size_mb-1) * 1024;
+ p->memory_device_handle = 0x1100;
+ p->memory_array_mapped_address_handle = 0x1300;
+ p->partition_row_position = 1;
+ p->interleave_position = 0;
+ p->interleaved_data_depth = 0;
+
+ start += sizeof(struct smbios_type_20);
+
+ *((uint16_t *)start) = 0;
+ return start+2;
+}
+
+/* Type 32 -- System Boot Information */
+static void *
+smbios_type_32_init(void *start)
+{
+ struct smbios_type_32 *p = (struct smbios_type_32 *)start;
+
+ p->header.type = 32;
+ p->header.length = sizeof(struct smbios_type_32);
+ p->header.handle = 0x2000;
+ memset(p->reserved, 0, 6);
+ p->boot_status = 0; /* no errors detected */
+
+ start += sizeof(struct smbios_type_32);
+ *((uint16_t *)start) = 0;
+ return start+2;
+}
+
+/* Type 127 -- End of Table */
+static void *
+smbios_type_127_init(void *start)
+{
+ struct smbios_type_127 *p = (struct smbios_type_127 *)start;
+
+ p->header.type = 127;
+ p->header.length = sizeof(struct smbios_type_127);
+ p->header.handle = 0x7f00;
+
+ start += sizeof(struct smbios_type_127);
+ *((uint16_t *)start) = 0;
+ return start + 2;
+}
+
+static void
+get_cpu_manufacturer(char *buf, int len)
+{
+ char id[12];
+ CPUState *env = first_cpu;
+
+ /* load id with cpuid(0) call */
+ memcpy(id, &(env->cpuid_vendor1), 4);
+ memcpy(id+4, &(env->cpuid_vendor2), 4);
+ memcpy(id+8, &(env->cpuid_vendor3), 4);
+
+ if (memcmp(id, "GenuineIntel", 12) == 0)
+ strncpy(buf, "Intel", len);
+ else if (memcmp(id, "AuthenticAMD", 12) == 0)
+ strncpy(buf, "AMD", len);
+ else
+ strncpy(buf, "unknown", len);
+}
+
+static int
+write_smbios_tables(uint8_t *entry, uint8_t *tables,
+ uint32_t table_phys_start,
+ uint32_t vcpus, uint64_t memsize,
+ uint8_t uuid[16], const char *version,
+ uint32_t major_version, uint32_t minor_version)
+{
+ unsigned cpu_num, nr_structs = 0, max_struct_size = 0;
+ char *p, *q;
+ char cpu_manufacturer[15];
+
+ get_cpu_manufacturer(cpu_manufacturer, 15);
+
+ p = tables;
+
+#define do_struct(fn) do { \
+ q = (fn); \
+ nr_structs++; \
+ if ( (q - p) > max_struct_size ) \
+ max_struct_size = q - p; \
+ p = q; \
+} while (0)
+
+ do_struct(smbios_type_0_init(p, version, major_version,
+ minor_version));
+ do_struct(smbios_type_1_init(p, version, uuid));
+ do_struct(smbios_type_3_init(p));
+ for ( cpu_num = 1; cpu_num <= vcpus; cpu_num++ )
+ do_struct(smbios_type_4_init(p, cpu_num, cpu_manufacturer));
+ do_struct(smbios_type_16_init(p, memsize));
+ do_struct(smbios_type_17_init(p, memsize));
+ do_struct(smbios_type_19_init(p, memsize));
+ do_struct(smbios_type_20_init(p, memsize));
+ do_struct(smbios_type_32_init(p));
+ do_struct(smbios_type_127_init(p));
+
+#undef do_struct
+
+ smbios_entry_point_init(entry, max_struct_size,
+ (p - (char *)tables),
+ table_phys_start, nr_structs);
+
+ return ((char *)p - (char *)tables);
+}
+
+/* entry point */
+int
+load_smbios_tables(uint8_t *entry, uint8_t *table, uint32_t phys_table_start)
+{
+ int len;
+ uint32_t major_version = 0;
+ uint32_t minor_version = 9;
+ uuid_t uuid;
+
+ uuid_generate(uuid);
+
+ len = write_smbios_tables(entry, table, phys_table_start,
+ smp_cpus, (ram_size >> 20),
+ uuid, QEMU_VERSION,
+ major_version, minor_version);
+
+ if (len > SMBIOS_MAXIMUM_SIZE) {
+ fprintf(stderr, "SMBIOS: Could not write SMBIOS tables\n");
+ return -1;
+ }
+
+ return len;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 25082b761acb -r e81bef5fa072 smbios_types.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/smbios_types.h Tue Dec 11 13:42:01 2007 -0600
@@ -0,0 +1,182 @@
+/*
+ * smbios_types.h - data structure definitions for Xen HVM SMBIOS support
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) IBM Corporation, 2006
+ *
+ * Authors: Andrew D. Ball <aball@us.ibm.com>
+ *
+ * See the SMBIOS 2.4 spec for more detail:
+ * http://www.dmtf.org/standards/smbios/
+ */
+
+#ifndef SMBIOS_TYPES_H
+#define SMBIOS_TYPES_H
+
+#include <stdint.h>
+
+/* SMBIOS entry point -- must be written to a 16-bit aligned address
+ between 0xf0000 and 0xfffff.
+ */
+struct smbios_entry_point {
+ char anchor_string[4];
+ uint8_t checksum;
+ uint8_t length;
+ uint8_t smbios_major_version;
+ uint8_t smbios_minor_version;
+ uint16_t max_structure_size;
+ uint8_t entry_point_revision;
+ uint8_t formatted_area[5];
+ char intermediate_anchor_string[5];
+ uint8_t intermediate_checksum;
+ uint16_t structure_table_length;
+ uint32_t structure_table_address;
+ uint16_t number_of_structures;
+ uint8_t smbios_bcd_revision;
+} __attribute__ ((packed));
+
+/* This goes at the beginning of every SMBIOS structure. */
+struct smbios_structure_header {
+ uint8_t type;
+ uint8_t length;
+ uint16_t handle;
+} __attribute__ ((packed));
+
+/* SMBIOS type 0 - BIOS Information */
+struct smbios_type_0 {
+ struct smbios_structure_header header;
+ uint8_t vendor_str;
+ uint8_t version_str;
+ uint16_t starting_address_segment;
+ uint8_t release_date_str;
+ uint8_t rom_size;
+ uint8_t characteristics[8];
+ uint8_t characteristics_extension_bytes[2];
+ uint8_t major_release;
+ uint8_t minor_release;
+ uint8_t embedded_controller_major;
+ uint8_t embedded_controller_minor;
+} __attribute__ ((packed));
+
+/* SMBIOS type 1 - System Information */
+struct smbios_type_1 {
+ struct smbios_structure_header header;
+ uint8_t manufacturer_str;
+ uint8_t product_name_str;
+ uint8_t version_str;
+ uint8_t serial_number_str;
+ uint8_t uuid[16];
+ uint8_t wake_up_type;
+ uint8_t sku_str;
+ uint8_t family_str;
+} __attribute__ ((packed));
+
+/* SMBIOS type 3 - System Enclosure */
+struct smbios_type_3 {
+ struct smbios_structure_header header;
+ uint8_t manufacturer_str;
+ uint8_t type;
+ uint8_t version_str;
+ uint8_t serial_number_str;
+ uint8_t asset_tag_str;
+ uint8_t boot_up_state;
+ uint8_t power_supply_state;
+ uint8_t thermal_state;
+ uint8_t security_status;
+} __attribute__ ((packed));
+
+/* SMBIOS type 4 - Processor Information */
+struct smbios_type_4 {
+ struct smbios_structure_header header;
+ uint8_t socket_designation_str;
+ uint8_t processor_type;
+ uint8_t processor_family;
+ uint8_t manufacturer_str;
+ uint32_t cpuid[2];
+ uint8_t version_str;
+ uint8_t voltage;
+ uint16_t external_clock;
+ uint16_t max_speed;
+ uint16_t current_speed;
+ uint8_t status;
+ uint8_t upgrade;
+} __attribute__ ((packed));
+
+/* SMBIOS type 16 - Physical Memory Array
+ * Associated with one type 17 (Memory Device).
+ */
+struct smbios_type_16 {
+ struct smbios_structure_header header;
+ uint8_t location;
+ uint8_t use;
+ uint8_t error_correction;
+ uint32_t maximum_capacity;
+ uint16_t memory_error_information_handle;
+ uint16_t number_of_memory_devices;
+} __attribute__ ((packed));
+
+/* SMBIOS type 17 - Memory Device
+ * Associated with one type 19
+ */
+struct smbios_type_17 {
+ struct smbios_structure_header header;
+ uint16_t physical_memory_array_handle;
+ uint16_t memory_error_information_handle;
+ uint16_t total_width;
+ uint16_t data_width;
+ uint16_t size;
+ uint8_t form_factor;
+ uint8_t device_set;
+ uint8_t device_locator_str;
+ uint8_t bank_locator_str;
+ uint8_t memory_type;
+ uint16_t type_detail;
+} __attribute__ ((packed));
+
+/* SMBIOS type 19 - Memory Array Mapped Address */
+struct smbios_type_19 {
+ struct smbios_structure_header header;
+ uint32_t starting_address;
+ uint32_t ending_address;
+ uint16_t memory_array_handle;
+ uint8_t partition_width;
+} __attribute__ ((packed));
+
+/* SMBIOS type 20 - Memory Device Mapped Address */
+struct smbios_type_20 {
+ struct smbios_structure_header header;
+ uint32_t starting_address;
+ uint32_t ending_address;
+ uint16_t memory_device_handle;
+ uint16_t memory_array_mapped_address_handle;
+ uint8_t partition_row_position;
+ uint8_t interleave_position;
+ uint8_t interleaved_data_depth;
+} __attribute__ ((packed));
+
+/* SMBIOS type 32 - System Boot Information */
+struct smbios_type_32 {
+ struct smbios_structure_header header;
+ uint8_t reserved[6];
+ uint8_t boot_status;
+} __attribute__ ((packed));
+
+/* SMBIOS type 127 -- End-of-table */
+struct smbios_type_127 {
+ struct smbios_structure_header header;
+} __attribute__ ((packed));
+
+#endif /* SMBIOS_TYPES_H */
diff -r 25082b761acb -r e81bef5fa072 sysemu.h
--- a/sysemu.h Wed Dec 05 03:23:38 2007 +0000
+++ b/sysemu.h Tue Dec 11 13:42:01 2007 -0600
@@ -116,6 +116,10 @@ extern unsigned int nb_prom_envs;
#define BIOS_SIZE (4 * 1024 * 1024)
#endif
+#define SMBIOS_MAXIMUM_SIZE (32 << 10)
+int load_smbios_tables(uint8_t *entry, uint8_t *table,
+ uint32_t phys_table_start);
+
typedef enum {
IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD
} BlockInterfaceType;
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2007-12-11 20:08 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines Ryan Harper
@ 2007-12-11 20:08 ` Ryan Harper
2007-12-11 21:19 ` Filip Navara
2007-12-11 21:21 ` Filip Navara
2007-12-11 20:08 ` [Qemu-devel] [PATCH 3 of 3] Add -uuid command line flag Ryan Harper
2 siblings, 2 replies; 16+ messages in thread
From: Ryan Harper @ 2007-12-11 20:08 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
3 files changed, 38 insertions(+), 2 deletions(-)
Makefile.target | 5 ++++-
configure | 26 ++++++++++++++++++++++++++
smbios.c | 9 ++++++++-
# HG changeset patch
# User Ryan Harper <ryanh@us.ibm.com>
# Date 1197402122 21600
# Node ID 115f40a4994be1d5b44ef193b3ccbe8e26410eef
# Parent e81bef5fa072360d12b87b3237b7d3f72c9b9784
Optionally link against libuuid if present.
This patch makes libuuid optional. If not detected, SMBIOS tables will use
canned UUID.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
diff -r e81bef5fa072 -r 115f40a4994b Makefile.target
--- a/Makefile.target Tue Dec 11 13:42:01 2007 -0600
+++ b/Makefile.target Tue Dec 11 13:42:02 2007 -0600
@@ -402,6 +402,9 @@ VL_OBJS+=block-raw.o
ifdef CONFIG_ALSA
LIBS += -lasound
+endif
+ifdef CONFIG_UUID
+LIBS += -luuid
endif
ifdef CONFIG_DSOUND
LIBS += -lole32 -ldxguid
@@ -535,7 +538,7 @@ ifndef CONFIG_DARWIN
ifndef CONFIG_DARWIN
ifndef CONFIG_WIN32
ifndef CONFIG_SOLARIS
-VL_LIBS+=-lutil -luuid
+VL_LIBS+=-lutil
endif
endif
endif
diff -r e81bef5fa072 -r 115f40a4994b configure
--- a/configure Tue Dec 11 13:42:01 2007 -0600
+++ b/configure Tue Dec 11 13:42:02 2007 -0600
@@ -89,6 +89,7 @@ dsound="no"
dsound="no"
coreaudio="no"
alsa="no"
+uuid="yes"
fmod="no"
fmod_lib=""
fmod_inc=""
@@ -260,6 +261,8 @@ for opt do
;;
--enable-alsa) alsa="yes"
;;
+ --enable-uuid) uuid="yes"
+ ;;
--enable-dsound) dsound="yes"
;;
--enable-fmod) fmod="yes"
@@ -404,6 +407,7 @@ echo " --enable-adlib enable
echo " --enable-adlib enable Adlib emulation"
echo " --enable-coreaudio enable Coreaudio audio driver"
echo " --enable-alsa enable ALSA audio driver"
+echo " --enable-uuid enable UUID generation for machines"
echo " --enable-fmod enable FMOD audio driver"
echo " --enable-dsound enable DirectSound audio driver"
echo " --disable-vnc-tls disable TLS encryption for VNC server"
@@ -662,6 +666,23 @@ EOF
fi
fi
+##########################################
+# uuid library
+if test "$uuid" = "yes" ; then
+ cat > $TMPC << EOF
+#include <uuid/uuid.h>
+int main(void) { uuid_t u; return 0; }
+EOF
+ if $cc -o $TMPE $TMPC -luuid 2> /dev/null ; then
+ :
+ else
+ echo
+ echo "Error: Could not find uuid"
+ echo "Make sure to have the uuid libs and headers installed."
+ echo
+ exit 1
+ fi
+fi
# Check if tools are available to build documentation.
if [ -x "`which texi2html 2>/dev/null`" ] && \
[ -x "`which pod2man 2>/dev/null`" ]; then
@@ -716,6 +737,7 @@ echo "Adlib support $adlib"
echo "Adlib support $adlib"
echo "CoreAudio support $coreaudio"
echo "ALSA support $alsa"
+echo "UUID support $uuid"
echo "DSound support $dsound"
if test "$fmod" = "yes"; then
if test -z $fmod_lib || test -z $fmod_inc; then
@@ -901,6 +923,10 @@ if test "$alsa" = "yes" ; then
echo "CONFIG_ALSA=yes" >> $config_mak
echo "#define CONFIG_ALSA 1" >> $config_h
fi
+if test "$uuid" = "yes" ; then
+ echo "CONFIG_UUID=yes" >> $config_mak
+ echo "#define CONFIG_UUID 1" >> $config_h
+fi
if test "$dsound" = "yes" ; then
echo "CONFIG_DSOUND=yes" >> $config_mak
echo "#define CONFIG_DSOUND 1" >> $config_h
diff -r e81bef5fa072 -r 115f40a4994b smbios.c
--- a/smbios.c Tue Dec 11 13:42:01 2007 -0600
+++ b/smbios.c Tue Dec 11 13:42:02 2007 -0600
@@ -25,11 +25,14 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
-#include <uuid/uuid.h>
#include "hw/hw.h"
#include "sysemu.h"
#include "smbios_types.h"
#include "config-host.h"
+
+#ifdef CONFIG_UUID
+#include <uuid/uuid.h>
+#endif
/* Write a two-character hex representation of 'byte' to digits[].
Pre-condition: sizeof(digits) >= 2 */
@@ -489,9 +492,13 @@ load_smbios_tables(uint8_t *entry, uint8
int len;
uint32_t major_version = 0;
uint32_t minor_version = 9;
+#ifdef CONFIG_UUID
uuid_t uuid;
uuid_generate(uuid);
+#else
+ uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
+#endif
len = write_smbios_tables(entry, table, phys_table_start,
smp_cpus, (ram_size >> 20),
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH 3 of 3] Add -uuid command line flag
2007-12-11 20:08 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
@ 2007-12-11 20:08 ` Ryan Harper
2 siblings, 0 replies; 16+ messages in thread
From: Ryan Harper @ 2007-12-11 20:08 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
3 files changed, 61 insertions(+), 6 deletions(-)
smbios.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
sysemu.h | 1 +
vl.c | 8 ++++++++
# HG changeset patch
# User Ryan Harper <ryanh@us.ibm.com>
# Date 1197402122 21600
# Node ID f1372e77455459b3e21ae908bb56cd43356159fd
# Parent 115f40a4994be1d5b44ef193b3ccbe8e26410eef
Add -uuid command line flag
This patch allows users to specify a uuid. If no uuid is specified, then one is
generated.
Now supports -uuid both with and without libuuid
Moved some includes into hw/hw.h and sysemh.h
Reduced the number of CONFIG_UUID defines
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
diff -r 115f40a4994b -r f1372e774554 smbios.c
--- a/smbios.c Tue Dec 11 13:42:02 2007 -0600
+++ b/smbios.c Tue Dec 11 13:42:02 2007 -0600
@@ -32,11 +32,47 @@
#ifdef CONFIG_UUID
#include <uuid/uuid.h>
-#endif
+
+static int qemu_uuid_parse(const char *in, uint8_t *uu)
+{
+ if (uuid_parse(in, *((uuid_t *)uu)) < 0)
+ return -1;
+
+ return 0;
+}
+
+#define qemu_uuid_generate(x) (uuid_generate(*((uuid_t *)x)))
+
+#else
+#define UUID2 "%02x%02x"
+#define UUID4 "%02x%02x%02x%02x"
+#define UUID6 "%02x%02x%02x%02x%02x%02x"
+#define UUID_FMT UUID4"-"UUID2"-"UUID2"-"UUID2"-"UUID6
+
+static int qemu_uuid_parse(const char *in, uint8_t *uu)
+{
+ unsigned int u[16];
+ int rv, i;
+
+ /* NB: sscanf requires %x format to store values in unsigned int */
+ rv = sscanf(in, UUID_FMT, u, u+1, u+2, u+3, u+4, u+5, u+6, u+7, u+8,
+ u+9, u+10, u+11, u+12, u+13, u+14, u+15);
+
+ if (rv != 16)
+ return -1;
+
+ for (i=0; i<16; i++)
+ uu[i] = (uint8_t)u[i];
+
+ return 0;
+}
+#define qemu_uuid_generate(x) (memcpy(x, "QEMUQEMUQEMUQEMU", 16))
+
+#endif /* CONFIG_UUID */
/* Write a two-character hex representation of 'byte' to digits[].
Pre-condition: sizeof(digits) >= 2 */
-void
+static void
byte_to_hex(char *digits, uint8_t byte)
{
uint8_t nybbel = byte >> 4;
@@ -493,12 +529,22 @@ load_smbios_tables(uint8_t *entry, uint8
uint32_t major_version = 0;
uint32_t minor_version = 9;
#ifdef CONFIG_UUID
- uuid_t uuid;
-
- uuid_generate(uuid);
+ uuid_t u;
+ uint8_t *uuid = (char *)&u;
#else
- uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
+ uint8_t uuid[16];
#endif
+
+ /* parse user-specified uuid if present */
+ if (qemu_uuid != NULL) {
+ if (qemu_uuid_parse(qemu_uuid, uuid) < 0) {
+ fprintf(stderr, "SMBIOS: Could not parse user UUID"
+ " string, check format.\n");
+ return -1;
+ }
+ } else {
+ qemu_uuid_generate(uuid);
+ }
len = write_smbios_tables(entry, table, phys_table_start,
smp_cpus, (ram_size >> 20),
diff -r 115f40a4994b -r f1372e774554 sysemu.h
--- a/sysemu.h Tue Dec 11 13:42:02 2007 -0600
+++ b/sysemu.h Tue Dec 11 13:42:02 2007 -0600
@@ -90,6 +90,7 @@ extern int autostart;
extern int autostart;
extern int old_param;
extern const char *bootp_filename;
+extern const char *qemu_uuid;
#ifdef USE_KQEMU
diff -r 115f40a4994b -r f1372e774554 vl.c
--- a/vl.c Tue Dec 11 13:42:02 2007 -0600
+++ b/vl.c Tue Dec 11 13:42:02 2007 -0600
@@ -138,6 +138,7 @@ int inet_aton(const char *cp, struct in_
#else
#define SMBD_COMMAND "/usr/sbin/smbd"
#endif
+const char *qemu_uuid;
//#define DEBUG_UNUSED_IOPORT
//#define DEBUG_IOPORT
@@ -7545,6 +7546,8 @@ static void help(int exitcode)
"-no-reboot exit instead of rebooting\n"
"-loadvm file start right away with a saved state (loadvm in monitor)\n"
"-vnc display start a VNC server on display\n"
+ "-uuid %%08x-%%04x-%%04x-%%04x-%%012x\n"
+ " specify machine UUID\n"
#ifndef _WIN32
"-daemonize daemonize QEMU after initializing\n"
#endif
@@ -7647,6 +7650,7 @@ enum {
QEMU_OPTION_vnc,
QEMU_OPTION_no_acpi,
QEMU_OPTION_no_reboot,
+ QEMU_OPTION_uuid,
QEMU_OPTION_show_cursor,
QEMU_OPTION_daemonize,
QEMU_OPTION_option_rom,
@@ -7742,6 +7746,7 @@ const QEMUOption qemu_options[] = {
{ "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice },
{ "smp", HAS_ARG, QEMU_OPTION_smp },
{ "vnc", HAS_ARG, QEMU_OPTION_vnc },
+ { "uuid", HAS_ARG, QEMU_OPTION_uuid },
/* temporary options */
{ "usb", 0, QEMU_OPTION_usb },
@@ -8527,6 +8532,9 @@ int main(int argc, char **argv)
case QEMU_OPTION_daemonize:
daemonize = 1;
break;
+ case QEMU_OPTION_uuid:
+ qemu_uuid = optarg;
+ break;
case QEMU_OPTION_option_rom:
if (nb_option_roms >= MAX_OPTION_ROMS) {
fprintf(stderr, "Too many option ROMs\n");
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2007-12-11 20:08 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
@ 2007-12-11 21:19 ` Filip Navara
2007-12-12 22:51 ` Fabrice Bellard
2008-01-03 19:55 ` Ryan Harper
2007-12-11 21:21 ` Filip Navara
1 sibling, 2 replies; 16+ messages in thread
From: Filip Navara @ 2007-12-11 21:19 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
[-- Attachment #1.1: Type: text/plain, Size: 701 bytes --]
Hi Ryan & others,
now I have been holding a SMBIOS patch on my hard disk for way to long it
seems. I used a different approach from yours, so I decided to publish it
for review or further ideas. What I did was to modify the bochs bios to
produce the SMBIOS tables and I get the UUID using VMware backdoor port from
the virtual machine.
Attached are just the changed files, creating a patch will take a while
because it's against VERY OLD version of the sources.
Oh, it also contains ACPI patch for the processor descriptors which was
needed for some Windows versions and Darwin. Similar patch was used in KVM
before, but this one dynamically detects the number of CPUs.
Best regards,
Filip Navara
[-- Attachment #1.2: Type: text/html, Size: 742 bytes --]
[-- Attachment #2: rombios32.zip --]
[-- Type: application/zip, Size: 14024 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2007-12-11 20:08 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
2007-12-11 21:19 ` Filip Navara
@ 2007-12-11 21:21 ` Filip Navara
1 sibling, 0 replies; 16+ messages in thread
From: Filip Navara @ 2007-12-11 21:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
[-- Attachment #1.1: Type: text/plain, Size: 5189 bytes --]
Hi Ryan & others,
now I have been holding a SMBIOS patch on my hard disk for way to long it
seems. I used a different approach from yours, so I decided to publish it
for review or further ideas. What I did was to modify the bochs bios to
produce the SMBIOS tables and I get the UUID using VMware backdoor port from
the virtual machine.
Attached are just the changed files, creating a patch will take a while
because it's against VERY OLD version of the sources.
Oh, it also contains ACPI patch for the processor descriptors which was
needed for some Windows versions and Darwin. Similar patch was used in KVM
before, but this one dynamically detects the number of CPUs.
Best regards,
Filip Navara
On Dec 11, 2007 9:08 PM, Ryan Harper <ryanh@us.ibm.com> wrote:
> 3 files changed, 38 insertions(+), 2 deletions(-)
> Makefile.target | 5 ++++-
> configure | 26 ++++++++++++++++++++++++++
> smbios.c | 9 ++++++++-
>
>
> # HG changeset patch
> # User Ryan Harper <ryanh@us.ibm.com>
> # Date 1197402122 21600
> # Node ID 115f40a4994be1d5b44ef193b3ccbe8e26410eef
> # Parent e81bef5fa072360d12b87b3237b7d3f72c9b9784
> Optionally link against libuuid if present.
>
> This patch makes libuuid optional. If not detected, SMBIOS tables will
> use
> canned UUID.
>
> Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
>
> diff -r e81bef5fa072 -r 115f40a4994b Makefile.target
> --- a/Makefile.target Tue Dec 11 13:42:01 2007 -0600
> +++ b/Makefile.target Tue Dec 11 13:42:02 2007 -0600
> @@ -402,6 +402,9 @@ VL_OBJS+=block-raw.o
>
> ifdef CONFIG_ALSA
> LIBS += -lasound
> +endif
> +ifdef CONFIG_UUID
> +LIBS += -luuid
> endif
> ifdef CONFIG_DSOUND
> LIBS += -lole32 -ldxguid
> @@ -535,7 +538,7 @@ ifndef CONFIG_DARWIN
> ifndef CONFIG_DARWIN
> ifndef CONFIG_WIN32
> ifndef CONFIG_SOLARIS
> -VL_LIBS+=-lutil -luuid
> +VL_LIBS+=-lutil
> endif
> endif
> endif
> diff -r e81bef5fa072 -r 115f40a4994b configure
> --- a/configure Tue Dec 11 13:42:01 2007 -0600
> +++ b/configure Tue Dec 11 13:42:02 2007 -0600
> @@ -89,6 +89,7 @@ dsound="no"
> dsound="no"
> coreaudio="no"
> alsa="no"
> +uuid="yes"
> fmod="no"
> fmod_lib=""
> fmod_inc=""
> @@ -260,6 +261,8 @@ for opt do
> ;;
> --enable-alsa) alsa="yes"
> ;;
> + --enable-uuid) uuid="yes"
> + ;;
> --enable-dsound) dsound="yes"
> ;;
> --enable-fmod) fmod="yes"
> @@ -404,6 +407,7 @@ echo " --enable-adlib enable
> echo " --enable-adlib enable Adlib emulation"
> echo " --enable-coreaudio enable Coreaudio audio driver"
> echo " --enable-alsa enable ALSA audio driver"
> +echo " --enable-uuid enable UUID generation for machines"
> echo " --enable-fmod enable FMOD audio driver"
> echo " --enable-dsound enable DirectSound audio driver"
> echo " --disable-vnc-tls disable TLS encryption for VNC server"
> @@ -662,6 +666,23 @@ EOF
> fi
> fi
>
> +##########################################
> +# uuid library
> +if test "$uuid" = "yes" ; then
> + cat > $TMPC << EOF
> +#include <uuid/uuid.h>
> +int main(void) { uuid_t u; return 0; }
> +EOF
> + if $cc -o $TMPE $TMPC -luuid 2> /dev/null ; then
> + :
> + else
> + echo
> + echo "Error: Could not find uuid"
> + echo "Make sure to have the uuid libs and headers installed."
> + echo
> + exit 1
> + fi
> +fi
> # Check if tools are available to build documentation.
> if [ -x "`which texi2html 2>/dev/null`" ] && \
> [ -x "`which pod2man 2>/dev/null`" ]; then
> @@ -716,6 +737,7 @@ echo "Adlib support $adlib"
> echo "Adlib support $adlib"
> echo "CoreAudio support $coreaudio"
> echo "ALSA support $alsa"
> +echo "UUID support $uuid"
> echo "DSound support $dsound"
> if test "$fmod" = "yes"; then
> if test -z $fmod_lib || test -z $fmod_inc; then
> @@ -901,6 +923,10 @@ if test "$alsa" = "yes" ; then
> echo "CONFIG_ALSA=yes" >> $config_mak
> echo "#define CONFIG_ALSA 1" >> $config_h
> fi
> +if test "$uuid" = "yes" ; then
> + echo "CONFIG_UUID=yes" >> $config_mak
> + echo "#define CONFIG_UUID 1" >> $config_h
> +fi
> if test "$dsound" = "yes" ; then
> echo "CONFIG_DSOUND=yes" >> $config_mak
> echo "#define CONFIG_DSOUND 1" >> $config_h
> diff -r e81bef5fa072 -r 115f40a4994b smbios.c
> --- a/smbios.c Tue Dec 11 13:42:01 2007 -0600
> +++ b/smbios.c Tue Dec 11 13:42:02 2007 -0600
> @@ -25,11 +25,14 @@
> #include <stdio.h>
> #include <stdint.h>
> #include <string.h>
> -#include <uuid/uuid.h>
> #include "hw/hw.h"
> #include "sysemu.h"
> #include "smbios_types.h"
> #include "config-host.h"
> +
> +#ifdef CONFIG_UUID
> +#include <uuid/uuid.h>
> +#endif
>
> /* Write a two-character hex representation of 'byte' to digits[].
> Pre-condition: sizeof(digits) >= 2 */
> @@ -489,9 +492,13 @@ load_smbios_tables(uint8_t *entry, uint8
> int len;
> uint32_t major_version = 0;
> uint32_t minor_version = 9;
> +#ifdef CONFIG_UUID
> uuid_t uuid;
>
> uuid_generate(uuid);
> +#else
> + uint8_t uuid[16] = "QEMUQEMUQEMUQEMU";
> +#endif
>
> len = write_smbios_tables(entry, table, phys_table_start,
> smp_cpus, (ram_size >> 20),
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 7316 bytes --]
[-- Attachment #2: rombios32.zip --]
[-- Type: application/zip, Size: 14024 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2007-12-11 21:19 ` Filip Navara
@ 2007-12-12 22:51 ` Fabrice Bellard
2008-01-03 19:55 ` Ryan Harper
1 sibling, 0 replies; 16+ messages in thread
From: Fabrice Bellard @ 2007-12-12 22:51 UTC (permalink / raw)
To: qemu-devel
Filip Navara wrote:
> Hi Ryan & others,
>
> now I have been holding a SMBIOS patch on my hard disk for way to long it
> seems. I used a different approach from yours, so I decided to publish it
> for review or further ideas. What I did was to modify the bochs bios to
> produce the SMBIOS tables and I get the UUID using VMware backdoor port from
> the virtual machine.
>
> Attached are just the changed files, creating a patch will take a while
> because it's against VERY OLD version of the sources.
>
> Oh, it also contains ACPI patch for the processor descriptors which was
> needed for some Windows versions and Darwin. Similar patch was used in KVM
> before, but this one dynamically detects the number of CPUs.
I strongly prefer your solution (Bochs BIOS) compared to modifying QEMU:
I already spent a lot of time moving the ACPI tables and other stuff to
the Bochs BIOS just for that !
Regards,
Fabrice.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2007-12-11 21:19 ` Filip Navara
2007-12-12 22:51 ` Fabrice Bellard
@ 2008-01-03 19:55 ` Ryan Harper
2008-01-20 13:17 ` Filip Navara
1 sibling, 1 reply; 16+ messages in thread
From: Ryan Harper @ 2008-01-03 19:55 UTC (permalink / raw)
To: Filip Navara; +Cc: kvm-devel, qemu-devel
* Filip Navara <filip.navara@gmail.com> [2007-12-11 15:29]:
> Hi Ryan & others,
>
> now I have been holding a SMBIOS patch on my hard disk for way to long it
> seems. I used a different approach from yours, so I decided to publish it
> for review or further ideas. What I did was to modify the bochs bios to
> produce the SMBIOS tables and I get the UUID using VMware backdoor port from
> the virtual machine.
>
> Attached are just the changed files, creating a patch will take a while
> because it's against VERY OLD version of the sources.
Filip,
Thanks for posting this. I agree with Fabrice that doing the SMBIOS
tables in rombios is a better approach. The rombio32.c file you
included didn't look that old to me; it has a CVS release tag of:
'rombios32.c,v 1.11 2007/08/03 13:56:13'
AFAICT, it looks like a straight-forward SMBIOS implementation. The
only thing worth adding to yours is the BIOS release date string in the
type 0 table. Setting this date to something newer than typical
CONFIG_ACPI_BLACKLIST_YEAR value (2000 in Gutsy's kernels) lets the
kernel enable ACPI features (like power-off).
Any idea on when you might have a patch that I can test?
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253 T/L: 678-9253
ryanh@us.ibm.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-03 19:55 ` Ryan Harper
@ 2008-01-20 13:17 ` Filip Navara
2008-01-20 14:25 ` Paul Brook
2008-01-20 16:20 ` [kvm-devel] " Alexander Graf
0 siblings, 2 replies; 16+ messages in thread
From: Filip Navara @ 2008-01-20 13:17 UTC (permalink / raw)
To: Ryan Harper; +Cc: kvm-devel, qemu-devel
[-- Attachment #1.1: Type: text/plain, Size: 405 bytes --]
Hello,
attached is a patch that implements the SMBIOS within the Bochs BIOS code.
Complete list of changes:
- Added generation of SSDT ACPI table that contains definitions for
available processors.
- Added basic implementation of SMBIOS.
- Added querying of BIOS UUID using VMware backdoor I/O port (enable only if
BX_QEMU is defined).
- Added RTC device to ACPI DSDT table.
Best regards,
Filip Navara
[-- Attachment #1.2: Type: text/html, Size: 440 bytes --]
[-- Attachment #2: bochs_smbios_acpi.patch --]
[-- Type: application/octet-stream, Size: 51217 bytes --]
Index: acpi-dsdt.dsl
===================================================================
RCS file: /cvsroot/bochs/bochs/bios/acpi-dsdt.dsl,v
retrieving revision 1.1
diff -u -r1.1 acpi-dsdt.dsl
--- acpi-dsdt.dsl 28 Sep 2006 18:56:20 -0000 1.1
+++ acpi-dsdt.dsl 20 Jan 2008 12:47:04 -0000
@@ -170,6 +170,17 @@
/* PIIX PCI to ISA irq remapping */
OperationRegion (P40C, PCI_Config, 0x60, 0x04)
+ /* Real-time clock */
+ Device (RTC)
+ {
+ Name (_HID, EisaId ("PNP0B00"))
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
+ IRQNoFlags () {8}
+ IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
+ })
+ }
/* Keyboard seems to be important for WinXP install */
Device (KBD)
Index: acpi-dsdt.hex
===================================================================
RCS file: /cvsroot/bochs/bochs/bios/acpi-dsdt.hex,v
retrieving revision 1.1
diff -u -r1.1 acpi-dsdt.hex
--- acpi-dsdt.hex 28 Sep 2006 18:56:20 -0000 1.1
+++ acpi-dsdt.hex 20 Jan 2008 12:48:11 -0000
@@ -1,22 +1,22 @@
/*
*
* Intel ACPI Component Architecture
- * ASL Optimizing Compiler version 20060912 [Sep 28 2006]
- * Copyright (C) 2000 - 2006 Intel Corporation
- * Supports ACPI Specification Revision 3.0a
+ * ASL Optimizing Compiler / AML Disassembler version 20050309 [Mar 9 2005]
+ * Copyright (C) 2000 - 2005 Intel Corporation
+ * Supports ACPI Specification Revision 3.0
*
- * Compilation of "acpi-dsdt.dsl" - Thu Sep 28 19:55:07 2006
+ * Compilation of "acpi-dsdt.dsl" - Sun Jan 20 13:48:11 2008
*
* C source code output
*
*/
-unsigned char AmlCode[] =
+unsigned char AmlCode[] =
{
- 0x44,0x53,0x44,0x54,0x32,0x08,0x00,0x00, /* 00000000 "DSDT2..." */
- 0x01,0x0E,0x42,0x58,0x50,0x43,0x00,0x00, /* 00000008 "..BXPC.." */
+ 0x44,0x53,0x44,0x54,0x61,0x08,0x00,0x00, /* 00000000 "DSDTa..." */
+ 0x01,0x94,0x42,0x58,0x50,0x43,0x00,0x00, /* 00000008 "..BXPC.." */
0x42,0x58,0x44,0x53,0x44,0x54,0x00,0x00, /* 00000010 "BXDSDT.." */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x12,0x09,0x06,0x20,0x10,0x4F,0x04,0x5C, /* 00000020 "... .O.\" */
+ 0x09,0x03,0x05,0x20,0x10,0x4F,0x04,0x5C, /* 00000020 "... .O.\" */
0x00,0x5B,0x80,0x43,0x4D,0x53,0x5F,0x01, /* 00000028 ".[.CMS_." */
0x0A,0x70,0x0A,0x02,0x5B,0x81,0x10,0x43, /* 00000030 ".p..[..C" */
0x4D,0x53,0x5F,0x01,0x43,0x4D,0x53,0x49, /* 00000038 "MS_.CMSI" */
@@ -102,177 +102,183 @@
0x50,0x4D,0x49,0x4E,0x74,0x50,0x4D,0x41, /* 000002B8 "PMINtPMA" */
0x58,0x50,0x4D,0x49,0x4E,0x50,0x4C,0x45, /* 000002C0 "XPMINPLE" */
0x4E,0x75,0x50,0x4C,0x45,0x4E,0xA4,0x4D, /* 000002C8 "NuPLEN.M" */
- 0x45,0x4D,0x50,0x10,0x42,0x26,0x2E,0x5F, /* 000002D0 "EMP.B&._" */
+ 0x45,0x4D,0x50,0x10,0x41,0x29,0x2E,0x5F, /* 000002D0 "EMP.A)._" */
0x53,0x42,0x5F,0x50,0x43,0x49,0x30,0x5B, /* 000002D8 "SB_PCI0[" */
- 0x82,0x43,0x20,0x49,0x53,0x41,0x5F,0x08, /* 000002E0 ".C ISA_." */
+ 0x82,0x42,0x23,0x49,0x53,0x41,0x5F,0x08, /* 000002E0 ".B#ISA_." */
0x5F,0x41,0x44,0x52,0x0C,0x00,0x00,0x01, /* 000002E8 "_ADR...." */
0x00,0x5B,0x80,0x50,0x34,0x30,0x43,0x02, /* 000002F0 ".[.P40C." */
- 0x0A,0x60,0x0A,0x04,0x5B,0x82,0x44,0x04, /* 000002F8 ".`..[.D." */
- 0x4B,0x42,0x44,0x5F,0x08,0x5F,0x48,0x49, /* 00000300 "KBD_._HI" */
- 0x44,0x0C,0x41,0xD0,0x03,0x03,0x14,0x09, /* 00000308 "D.A....." */
- 0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F, /* 00000310 "_STA...." */
- 0x14,0x29,0x5F,0x43,0x52,0x53,0x00,0x08, /* 00000318 ".)_CRS.." */
- 0x54,0x4D,0x50,0x5F,0x11,0x18,0x0A,0x15, /* 00000320 "TMP_...." */
- 0x47,0x01,0x60,0x00,0x60,0x00,0x01,0x01, /* 00000328 "G.`.`..." */
- 0x47,0x01,0x64,0x00,0x64,0x00,0x01,0x01, /* 00000330 "G.d.d..." */
- 0x22,0x02,0x00,0x79,0x00,0xA4,0x54,0x4D, /* 00000338 ""..y..TM" */
- 0x50,0x5F,0x5B,0x82,0x33,0x4D,0x4F,0x55, /* 00000340 "P_[.3MOU" */
- 0x5F,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41, /* 00000348 "_._HID.A" */
- 0xD0,0x0F,0x13,0x14,0x09,0x5F,0x53,0x54, /* 00000350 "....._ST" */
- 0x41,0x00,0xA4,0x0A,0x0F,0x14,0x19,0x5F, /* 00000358 "A......_" */
- 0x43,0x52,0x53,0x00,0x08,0x54,0x4D,0x50, /* 00000360 "CRS..TMP" */
- 0x5F,0x11,0x08,0x0A,0x05,0x22,0x00,0x10, /* 00000368 "_....".." */
- 0x79,0x00,0xA4,0x54,0x4D,0x50,0x5F,0x5B, /* 00000370 "y..TMP_[" */
- 0x82,0x47,0x04,0x46,0x44,0x43,0x30,0x08, /* 00000378 ".G.FDC0." */
- 0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x07, /* 00000380 "_HID.A.." */
- 0x00,0x14,0x09,0x5F,0x53,0x54,0x41,0x00, /* 00000388 "..._STA." */
- 0xA4,0x0A,0x0F,0x14,0x2C,0x5F,0x43,0x52, /* 00000390 "....,_CR" */
- 0x53,0x00,0x08,0x42,0x55,0x46,0x30,0x11, /* 00000398 "S..BUF0." */
- 0x1B,0x0A,0x18,0x47,0x01,0xF2,0x03,0xF2, /* 000003A0 "...G...." */
- 0x03,0x00,0x04,0x47,0x01,0xF7,0x03,0xF7, /* 000003A8 "...G...." */
- 0x03,0x00,0x01,0x22,0x40,0x00,0x2A,0x04, /* 000003B0 "..."@.*." */
- 0x00,0x79,0x00,0xA4,0x42,0x55,0x46,0x30, /* 000003B8 ".y..BUF0" */
- 0x5B,0x82,0x4B,0x05,0x4C,0x50,0x54,0x5F, /* 000003C0 "[.K.LPT_" */
- 0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0, /* 000003C8 "._HID.A." */
- 0x04,0x00,0x14,0x28,0x5F,0x53,0x54,0x41, /* 000003D0 "...(_STA" */
- 0x00,0x70,0x5E,0x5E,0x5E,0x2E,0x50,0x58, /* 000003D8 ".p^^^.PX" */
- 0x31,0x33,0x44,0x52,0x53,0x41,0x60,0x7B, /* 000003E0 "13DRSA`{" */
- 0x60,0x0C,0x00,0x00,0x00,0x80,0x60,0xA0, /* 000003E8 "`.....`." */
- 0x06,0x93,0x60,0x00,0xA4,0x00,0xA1,0x04, /* 000003F0 "..`....." */
- 0xA4,0x0A,0x0F,0x14,0x21,0x5F,0x43,0x52, /* 000003F8 "....!_CR" */
- 0x53,0x00,0x08,0x42,0x55,0x46,0x30,0x11, /* 00000400 "S..BUF0." */
- 0x10,0x0A,0x0D,0x47,0x01,0x78,0x03,0x78, /* 00000408 "...G.x.x" */
- 0x03,0x08,0x08,0x22,0x80,0x00,0x79,0x00, /* 00000410 "..."..y." */
- 0xA4,0x42,0x55,0x46,0x30,0x5B,0x82,0x41, /* 00000418 ".BUF0[.A" */
- 0x06,0x43,0x4F,0x4D,0x31,0x08,0x5F,0x48, /* 00000420 ".COM1._H" */
- 0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,0x08, /* 00000428 "ID.A...." */
- 0x5F,0x55,0x49,0x44,0x01,0x14,0x28,0x5F, /* 00000430 "_UID..(_" */
- 0x53,0x54,0x41,0x00,0x70,0x5E,0x5E,0x5E, /* 00000438 "STA.p^^^" */
- 0x2E,0x50,0x58,0x31,0x33,0x44,0x52,0x53, /* 00000440 ".PX13DRS" */
- 0x43,0x60,0x7B,0x60,0x0C,0x00,0x00,0x00, /* 00000448 "C`{`...." */
- 0x08,0x60,0xA0,0x06,0x93,0x60,0x00,0xA4, /* 00000450 ".`...`.." */
- 0x00,0xA1,0x04,0xA4,0x0A,0x0F,0x14,0x21, /* 00000458 ".......!" */
- 0x5F,0x43,0x52,0x53,0x00,0x08,0x42,0x55, /* 00000460 "_CRS..BU" */
- 0x46,0x30,0x11,0x10,0x0A,0x0D,0x47,0x01, /* 00000468 "F0....G." */
- 0xF8,0x03,0xF8,0x03,0x00,0x08,0x22,0x10, /* 00000470 "......"." */
- 0x00,0x79,0x00,0xA4,0x42,0x55,0x46,0x30, /* 00000478 ".y..BUF0" */
- 0x5B,0x82,0x42,0x06,0x43,0x4F,0x4D,0x32, /* 00000480 "[.B.COM2" */
- 0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0, /* 00000488 "._HID.A." */
- 0x05,0x01,0x08,0x5F,0x55,0x49,0x44,0x0A, /* 00000490 "..._UID." */
- 0x02,0x14,0x28,0x5F,0x53,0x54,0x41,0x00, /* 00000498 "..(_STA." */
- 0x70,0x5E,0x5E,0x5E,0x2E,0x50,0x58,0x31, /* 000004A0 "p^^^.PX1" */
- 0x33,0x44,0x52,0x53,0x43,0x60,0x7B,0x60, /* 000004A8 "3DRSC`{`" */
- 0x0C,0x00,0x00,0x00,0x80,0x60,0xA0,0x06, /* 000004B0 ".....`.." */
- 0x93,0x60,0x00,0xA4,0x00,0xA1,0x04,0xA4, /* 000004B8 ".`......" */
- 0x0A,0x0F,0x14,0x21,0x5F,0x43,0x52,0x53, /* 000004C0 "...!_CRS" */
- 0x00,0x08,0x42,0x55,0x46,0x30,0x11,0x10, /* 000004C8 "..BUF0.." */
- 0x0A,0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02, /* 000004D0 "..G....." */
- 0x00,0x08,0x22,0x08,0x00,0x79,0x00,0xA4, /* 000004D8 ".."..y.." */
- 0x42,0x55,0x46,0x30,0x5B,0x82,0x40,0x05, /* 000004E0 "BUF0[.@." */
- 0x50,0x58,0x31,0x33,0x08,0x5F,0x41,0x44, /* 000004E8 "PX13._AD" */
- 0x52,0x0C,0x03,0x00,0x01,0x00,0x5B,0x80, /* 000004F0 "R.....[." */
- 0x50,0x31,0x33,0x43,0x02,0x0A,0x5C,0x0A, /* 000004F8 "P13C..\." */
- 0x24,0x5B,0x81,0x33,0x50,0x31,0x33,0x43, /* 00000500 "$[.3P13C" */
- 0x03,0x44,0x52,0x53,0x41,0x20,0x44,0x52, /* 00000508 ".DRSA DR" */
- 0x53,0x42,0x20,0x44,0x52,0x53,0x43,0x20, /* 00000510 "SB DRSC " */
- 0x44,0x52,0x53,0x45,0x20,0x44,0x52,0x53, /* 00000518 "DRSE DRS" */
- 0x46,0x20,0x44,0x52,0x53,0x47,0x20,0x44, /* 00000520 "F DRSG D" */
- 0x52,0x53,0x48,0x20,0x44,0x52,0x53,0x49, /* 00000528 "RSH DRSI" */
- 0x20,0x44,0x52,0x53,0x4A,0x20,0x10,0x4F, /* 00000530 " DRSJ .O" */
- 0x2E,0x5F,0x53,0x42,0x5F,0x5B,0x81,0x24, /* 00000538 "._SB_[.$" */
- 0x2F,0x03,0x50,0x43,0x49,0x30,0x49,0x53, /* 00000540 "/.PCI0IS" */
- 0x41,0x5F,0x50,0x34,0x30,0x43,0x01,0x50, /* 00000548 "A_P40C.P" */
- 0x52,0x51,0x30,0x08,0x50,0x52,0x51,0x31, /* 00000550 "RQ0.PRQ1" */
- 0x08,0x50,0x52,0x51,0x32,0x08,0x50,0x52, /* 00000558 ".PRQ2.PR" */
- 0x51,0x33,0x08,0x5B,0x82,0x4E,0x0A,0x4C, /* 00000560 "Q3.[.N.L" */
- 0x4E,0x4B,0x41,0x08,0x5F,0x48,0x49,0x44, /* 00000568 "NKA._HID" */
- 0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55, /* 00000570 ".A...._U" */
- 0x49,0x44,0x01,0x08,0x5F,0x50,0x52,0x53, /* 00000578 "ID.._PRS" */
- 0x11,0x09,0x0A,0x06,0x23,0xF8,0x1E,0x18, /* 00000580 "....#..." */
- 0x79,0x00,0x14,0x1A,0x5F,0x53,0x54,0x41, /* 00000588 "y..._STA" */
- 0x00,0x70,0x0A,0x0B,0x60,0xA0,0x0D,0x7B, /* 00000590 ".p..`..{" */
- 0x0A,0x80,0x50,0x52,0x51,0x30,0x61,0x70, /* 00000598 "..PRQ0ap" */
- 0x0A,0x09,0x60,0xA4,0x60,0x14,0x11,0x5F, /* 000005A0 "..`.`.._" */
- 0x44,0x49,0x53,0x00,0x7D,0x50,0x52,0x51, /* 000005A8 "DIS.}PRQ" */
- 0x30,0x0A,0x80,0x50,0x52,0x51,0x30,0x14, /* 000005B0 "0..PRQ0." */
- 0x3F,0x5F,0x43,0x52,0x53,0x00,0x08,0x50, /* 000005B8 "?_CRS..P" */
- 0x52,0x52,0x30,0x11,0x09,0x0A,0x06,0x23, /* 000005C0 "RR0....#" */
- 0x02,0x00,0x18,0x79,0x00,0x8B,0x50,0x52, /* 000005C8 "...y..PR" */
- 0x52,0x30,0x01,0x54,0x4D,0x50,0x5F,0x70, /* 000005D0 "R0.TMP_p" */
- 0x50,0x52,0x51,0x30,0x60,0xA0,0x0C,0x95, /* 000005D8 "PRQ0`..." */
- 0x60,0x0A,0x80,0x79,0x01,0x60,0x54,0x4D, /* 000005E0 "`..y.`TM" */
- 0x50,0x5F,0xA1,0x07,0x70,0x00,0x54,0x4D, /* 000005E8 "P_..p.TM" */
- 0x50,0x5F,0xA4,0x50,0x52,0x52,0x30,0x14, /* 000005F0 "P_.PRR0." */
- 0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68, /* 000005F8 "._SRS..h" */
- 0x01,0x54,0x4D,0x50,0x5F,0x82,0x54,0x4D, /* 00000600 ".TMP_.TM" */
- 0x50,0x5F,0x60,0x76,0x60,0x70,0x60,0x50, /* 00000608 "P_`v`p`P" */
- 0x52,0x51,0x30,0x5B,0x82,0x4F,0x0A,0x4C, /* 00000610 "RQ0[.O.L" */
- 0x4E,0x4B,0x42,0x08,0x5F,0x48,0x49,0x44, /* 00000618 "NKB._HID" */
- 0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55, /* 00000620 ".A...._U" */
- 0x49,0x44,0x0A,0x02,0x08,0x5F,0x50,0x52, /* 00000628 "ID..._PR" */
- 0x53,0x11,0x09,0x0A,0x06,0x23,0xF8,0x1E, /* 00000630 "S....#.." */
- 0x18,0x79,0x00,0x14,0x1A,0x5F,0x53,0x54, /* 00000638 ".y..._ST" */
- 0x41,0x00,0x70,0x0A,0x0B,0x60,0xA0,0x0D, /* 00000640 "A.p..`.." */
- 0x7B,0x0A,0x80,0x50,0x52,0x51,0x31,0x61, /* 00000648 "{..PRQ1a" */
- 0x70,0x0A,0x09,0x60,0xA4,0x60,0x14,0x11, /* 00000650 "p..`.`.." */
- 0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,0x52, /* 00000658 "_DIS.}PR" */
- 0x51,0x31,0x0A,0x80,0x50,0x52,0x51,0x31, /* 00000660 "Q1..PRQ1" */
- 0x14,0x3F,0x5F,0x43,0x52,0x53,0x00,0x08, /* 00000668 ".?_CRS.." */
- 0x50,0x52,0x52,0x30,0x11,0x09,0x0A,0x06, /* 00000670 "PRR0...." */
- 0x23,0x02,0x00,0x18,0x79,0x00,0x8B,0x50, /* 00000678 "#...y..P" */
- 0x52,0x52,0x30,0x01,0x54,0x4D,0x50,0x5F, /* 00000680 "RR0.TMP_" */
- 0x70,0x50,0x52,0x51,0x31,0x60,0xA0,0x0C, /* 00000688 "pPRQ1`.." */
- 0x95,0x60,0x0A,0x80,0x79,0x01,0x60,0x54, /* 00000690 ".`..y.`T" */
- 0x4D,0x50,0x5F,0xA1,0x07,0x70,0x00,0x54, /* 00000698 "MP_..p.T" */
- 0x4D,0x50,0x5F,0xA4,0x50,0x52,0x52,0x30, /* 000006A0 "MP_.PRR0" */
- 0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B, /* 000006A8 ".._SRS.." */
- 0x68,0x01,0x54,0x4D,0x50,0x5F,0x82,0x54, /* 000006B0 "h.TMP_.T" */
- 0x4D,0x50,0x5F,0x60,0x76,0x60,0x70,0x60, /* 000006B8 "MP_`v`p`" */
- 0x50,0x52,0x51,0x31,0x5B,0x82,0x4F,0x0A, /* 000006C0 "PRQ1[.O." */
- 0x4C,0x4E,0x4B,0x43,0x08,0x5F,0x48,0x49, /* 000006C8 "LNKC._HI" */
- 0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F, /* 000006D0 "D.A...._" */
- 0x55,0x49,0x44,0x0A,0x03,0x08,0x5F,0x50, /* 000006D8 "UID..._P" */
- 0x52,0x53,0x11,0x09,0x0A,0x06,0x23,0xF8, /* 000006E0 "RS....#." */
- 0x1E,0x18,0x79,0x00,0x14,0x1A,0x5F,0x53, /* 000006E8 "..y..._S" */
- 0x54,0x41,0x00,0x70,0x0A,0x0B,0x60,0xA0, /* 000006F0 "TA.p..`." */
- 0x0D,0x7B,0x0A,0x80,0x50,0x52,0x51,0x32, /* 000006F8 ".{..PRQ2" */
- 0x61,0x70,0x0A,0x09,0x60,0xA4,0x60,0x14, /* 00000700 "ap..`.`." */
- 0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50, /* 00000708 "._DIS.}P" */
- 0x52,0x51,0x32,0x0A,0x80,0x50,0x52,0x51, /* 00000710 "RQ2..PRQ" */
- 0x32,0x14,0x3F,0x5F,0x43,0x52,0x53,0x00, /* 00000718 "2.?_CRS." */
- 0x08,0x50,0x52,0x52,0x30,0x11,0x09,0x0A, /* 00000720 ".PRR0..." */
- 0x06,0x23,0x02,0x00,0x18,0x79,0x00,0x8B, /* 00000728 ".#...y.." */
- 0x50,0x52,0x52,0x30,0x01,0x54,0x4D,0x50, /* 00000730 "PRR0.TMP" */
- 0x5F,0x70,0x50,0x52,0x51,0x32,0x60,0xA0, /* 00000738 "_pPRQ2`." */
- 0x0C,0x95,0x60,0x0A,0x80,0x79,0x01,0x60, /* 00000740 "..`..y.`" */
- 0x54,0x4D,0x50,0x5F,0xA1,0x07,0x70,0x00, /* 00000748 "TMP_..p." */
- 0x54,0x4D,0x50,0x5F,0xA4,0x50,0x52,0x52, /* 00000750 "TMP_.PRR" */
- 0x30,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01, /* 00000758 "0.._SRS." */
- 0x8B,0x68,0x01,0x54,0x4D,0x50,0x5F,0x82, /* 00000760 ".h.TMP_." */
- 0x54,0x4D,0x50,0x5F,0x60,0x76,0x60,0x70, /* 00000768 "TMP_`v`p" */
- 0x60,0x50,0x52,0x51,0x32,0x5B,0x82,0x4F, /* 00000770 "`PRQ2[.O" */
- 0x0A,0x4C,0x4E,0x4B,0x44,0x08,0x5F,0x48, /* 00000778 ".LNKD._H" */
- 0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08, /* 00000780 "ID.A...." */
- 0x5F,0x55,0x49,0x44,0x0A,0x04,0x08,0x5F, /* 00000788 "_UID..._" */
- 0x50,0x52,0x53,0x11,0x09,0x0A,0x06,0x23, /* 00000790 "PRS....#" */
- 0xF8,0x1E,0x18,0x79,0x00,0x14,0x1A,0x5F, /* 00000798 "...y..._" */
- 0x53,0x54,0x41,0x00,0x70,0x0A,0x0B,0x60, /* 000007A0 "STA.p..`" */
- 0xA0,0x0D,0x7B,0x0A,0x80,0x50,0x52,0x51, /* 000007A8 "..{..PRQ" */
- 0x33,0x61,0x70,0x0A,0x09,0x60,0xA4,0x60, /* 000007B0 "3ap..`.`" */
- 0x14,0x11,0x5F,0x44,0x49,0x53,0x00,0x7D, /* 000007B8 ".._DIS.}" */
- 0x50,0x52,0x51,0x33,0x0A,0x80,0x50,0x52, /* 000007C0 "PRQ3..PR" */
- 0x51,0x33,0x14,0x3F,0x5F,0x43,0x52,0x53, /* 000007C8 "Q3.?_CRS" */
- 0x00,0x08,0x50,0x52,0x52,0x30,0x11,0x09, /* 000007D0 "..PRR0.." */
- 0x0A,0x06,0x23,0x02,0x00,0x18,0x79,0x00, /* 000007D8 "..#...y." */
- 0x8B,0x50,0x52,0x52,0x30,0x01,0x54,0x4D, /* 000007E0 ".PRR0.TM" */
- 0x50,0x5F,0x70,0x50,0x52,0x51,0x33,0x60, /* 000007E8 "P_pPRQ3`" */
- 0xA0,0x0C,0x95,0x60,0x0A,0x80,0x79,0x01, /* 000007F0 "...`..y." */
- 0x60,0x54,0x4D,0x50,0x5F,0xA1,0x07,0x70, /* 000007F8 "`TMP_..p" */
- 0x00,0x54,0x4D,0x50,0x5F,0xA4,0x50,0x52, /* 00000800 ".TMP_.PR" */
- 0x52,0x30,0x14,0x1B,0x5F,0x53,0x52,0x53, /* 00000808 "R0.._SRS" */
- 0x01,0x8B,0x68,0x01,0x54,0x4D,0x50,0x5F, /* 00000810 "..h.TMP_" */
- 0x82,0x54,0x4D,0x50,0x5F,0x60,0x76,0x60, /* 00000818 ".TMP_`v`" */
- 0x70,0x60,0x50,0x52,0x51,0x33,0x08,0x5F, /* 00000820 "p`PRQ3._" */
- 0x53,0x35,0x5F,0x12,0x06,0x04,0x00,0x00, /* 00000828 "S5_....." */
- 0x00,0x00,
+ 0x0A,0x60,0x0A,0x04,0x5B,0x82,0x2D,0x52, /* 000002F8 ".`..[.-R" */
+ 0x54,0x43,0x5F,0x08,0x5F,0x48,0x49,0x44, /* 00000300 "TC_._HID" */
+ 0x0C,0x41,0xD0,0x0B,0x00,0x08,0x5F,0x43, /* 00000308 ".A...._C" */
+ 0x52,0x53,0x11,0x18,0x0A,0x15,0x47,0x01, /* 00000310 "RS....G." */
+ 0x70,0x00,0x70,0x00,0x10,0x02,0x22,0x00, /* 00000318 "p.p..."." */
+ 0x01,0x47,0x01,0x72,0x00,0x72,0x00,0x02, /* 00000320 ".G.r.r.." */
+ 0x06,0x79,0x00,0x5B,0x82,0x44,0x04,0x4B, /* 00000328 ".y.[.D.K" */
+ 0x42,0x44,0x5F,0x08,0x5F,0x48,0x49,0x44, /* 00000330 "BD_._HID" */
+ 0x0C,0x41,0xD0,0x03,0x03,0x14,0x09,0x5F, /* 00000338 ".A....._" */
+ 0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F,0x14, /* 00000340 "STA....." */
+ 0x29,0x5F,0x43,0x52,0x53,0x00,0x08,0x54, /* 00000348 ")_CRS..T" */
+ 0x4D,0x50,0x5F,0x11,0x18,0x0A,0x15,0x47, /* 00000350 "MP_....G" */
+ 0x01,0x60,0x00,0x60,0x00,0x01,0x01,0x47, /* 00000358 ".`.`...G" */
+ 0x01,0x64,0x00,0x64,0x00,0x01,0x01,0x22, /* 00000360 ".d.d..."" */
+ 0x02,0x00,0x79,0x00,0xA4,0x54,0x4D,0x50, /* 00000368 "..y..TMP" */
+ 0x5F,0x5B,0x82,0x33,0x4D,0x4F,0x55,0x5F, /* 00000370 "_[.3MOU_" */
+ 0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0, /* 00000378 "._HID.A." */
+ 0x0F,0x13,0x14,0x09,0x5F,0x53,0x54,0x41, /* 00000380 "...._STA" */
+ 0x00,0xA4,0x0A,0x0F,0x14,0x19,0x5F,0x43, /* 00000388 "......_C" */
+ 0x52,0x53,0x00,0x08,0x54,0x4D,0x50,0x5F, /* 00000390 "RS..TMP_" */
+ 0x11,0x08,0x0A,0x05,0x22,0x00,0x10,0x79, /* 00000398 "...."..y" */
+ 0x00,0xA4,0x54,0x4D,0x50,0x5F,0x5B,0x82, /* 000003A0 "..TMP_[." */
+ 0x47,0x04,0x46,0x44,0x43,0x30,0x08,0x5F, /* 000003A8 "G.FDC0._" */
+ 0x48,0x49,0x44,0x0C,0x41,0xD0,0x07,0x00, /* 000003B0 "HID.A..." */
+ 0x14,0x09,0x5F,0x53,0x54,0x41,0x00,0xA4, /* 000003B8 ".._STA.." */
+ 0x0A,0x0F,0x14,0x2C,0x5F,0x43,0x52,0x53, /* 000003C0 "...,_CRS" */
+ 0x00,0x08,0x42,0x55,0x46,0x30,0x11,0x1B, /* 000003C8 "..BUF0.." */
+ 0x0A,0x18,0x47,0x01,0xF2,0x03,0xF2,0x03, /* 000003D0 "..G....." */
+ 0x00,0x04,0x47,0x01,0xF7,0x03,0xF7,0x03, /* 000003D8 "..G....." */
+ 0x00,0x01,0x22,0x40,0x00,0x2A,0x04,0x00, /* 000003E0 ".."@.*.." */
+ 0x79,0x00,0xA4,0x42,0x55,0x46,0x30,0x5B, /* 000003E8 "y..BUF0[" */
+ 0x82,0x4B,0x05,0x4C,0x50,0x54,0x5F,0x08, /* 000003F0 ".K.LPT_." */
+ 0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x04, /* 000003F8 "_HID.A.." */
+ 0x00,0x14,0x28,0x5F,0x53,0x54,0x41,0x00, /* 00000400 "..(_STA." */
+ 0x70,0x5E,0x5E,0x5E,0x2E,0x50,0x58,0x31, /* 00000408 "p^^^.PX1" */
+ 0x33,0x44,0x52,0x53,0x41,0x60,0x7B,0x60, /* 00000410 "3DRSA`{`" */
+ 0x0C,0x00,0x00,0x00,0x80,0x60,0xA0,0x06, /* 00000418 ".....`.." */
+ 0x93,0x60,0x00,0xA4,0x00,0xA1,0x04,0xA4, /* 00000420 ".`......" */
+ 0x0A,0x0F,0x14,0x21,0x5F,0x43,0x52,0x53, /* 00000428 "...!_CRS" */
+ 0x00,0x08,0x42,0x55,0x46,0x30,0x11,0x10, /* 00000430 "..BUF0.." */
+ 0x0A,0x0D,0x47,0x01,0x78,0x03,0x78,0x03, /* 00000438 "..G.x.x." */
+ 0x08,0x08,0x22,0x80,0x00,0x79,0x00,0xA4, /* 00000440 ".."..y.." */
+ 0x42,0x55,0x46,0x30,0x5B,0x82,0x41,0x06, /* 00000448 "BUF0[.A." */
+ 0x43,0x4F,0x4D,0x31,0x08,0x5F,0x48,0x49, /* 00000450 "COM1._HI" */
+ 0x44,0x0C,0x41,0xD0,0x05,0x01,0x08,0x5F, /* 00000458 "D.A...._" */
+ 0x55,0x49,0x44,0x01,0x14,0x28,0x5F,0x53, /* 00000460 "UID..(_S" */
+ 0x54,0x41,0x00,0x70,0x5E,0x5E,0x5E,0x2E, /* 00000468 "TA.p^^^." */
+ 0x50,0x58,0x31,0x33,0x44,0x52,0x53,0x43, /* 00000470 "PX13DRSC" */
+ 0x60,0x7B,0x60,0x0C,0x00,0x00,0x00,0x08, /* 00000478 "`{`....." */
+ 0x60,0xA0,0x06,0x93,0x60,0x00,0xA4,0x00, /* 00000480 "`...`..." */
+ 0xA1,0x04,0xA4,0x0A,0x0F,0x14,0x21,0x5F, /* 00000488 "......!_" */
+ 0x43,0x52,0x53,0x00,0x08,0x42,0x55,0x46, /* 00000490 "CRS..BUF" */
+ 0x30,0x11,0x10,0x0A,0x0D,0x47,0x01,0xF8, /* 00000498 "0....G.." */
+ 0x03,0xF8,0x03,0x00,0x08,0x22,0x10,0x00, /* 000004A0 ".....".." */
+ 0x79,0x00,0xA4,0x42,0x55,0x46,0x30,0x5B, /* 000004A8 "y..BUF0[" */
+ 0x82,0x42,0x06,0x43,0x4F,0x4D,0x32,0x08, /* 000004B0 ".B.COM2." */
+ 0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x05, /* 000004B8 "_HID.A.." */
+ 0x01,0x08,0x5F,0x55,0x49,0x44,0x0A,0x02, /* 000004C0 ".._UID.." */
+ 0x14,0x28,0x5F,0x53,0x54,0x41,0x00,0x70, /* 000004C8 ".(_STA.p" */
+ 0x5E,0x5E,0x5E,0x2E,0x50,0x58,0x31,0x33, /* 000004D0 "^^^.PX13" */
+ 0x44,0x52,0x53,0x43,0x60,0x7B,0x60,0x0C, /* 000004D8 "DRSC`{`." */
+ 0x00,0x00,0x00,0x80,0x60,0xA0,0x06,0x93, /* 000004E0 "....`..." */
+ 0x60,0x00,0xA4,0x00,0xA1,0x04,0xA4,0x0A, /* 000004E8 "`......." */
+ 0x0F,0x14,0x21,0x5F,0x43,0x52,0x53,0x00, /* 000004F0 "..!_CRS." */
+ 0x08,0x42,0x55,0x46,0x30,0x11,0x10,0x0A, /* 000004F8 ".BUF0..." */
+ 0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02,0x00, /* 00000500 ".G......" */
+ 0x08,0x22,0x08,0x00,0x79,0x00,0xA4,0x42, /* 00000508 "."..y..B" */
+ 0x55,0x46,0x30,0x5B,0x82,0x40,0x05,0x50, /* 00000510 "UF0[.@.P" */
+ 0x58,0x31,0x33,0x08,0x5F,0x41,0x44,0x52, /* 00000518 "X13._ADR" */
+ 0x0C,0x03,0x00,0x01,0x00,0x5B,0x80,0x50, /* 00000520 ".....[.P" */
+ 0x31,0x33,0x43,0x02,0x0A,0x5C,0x0A,0x24, /* 00000528 "13C..\.$" */
+ 0x5B,0x81,0x33,0x50,0x31,0x33,0x43,0x03, /* 00000530 "[.3P13C." */
+ 0x44,0x52,0x53,0x41,0x20,0x44,0x52,0x53, /* 00000538 "DRSA DRS" */
+ 0x42,0x20,0x44,0x52,0x53,0x43,0x20,0x44, /* 00000540 "B DRSC D" */
+ 0x52,0x53,0x45,0x20,0x44,0x52,0x53,0x46, /* 00000548 "RSE DRSF" */
+ 0x20,0x44,0x52,0x53,0x47,0x20,0x44,0x52, /* 00000550 " DRSG DR" */
+ 0x53,0x48,0x20,0x44,0x52,0x53,0x49,0x20, /* 00000558 "SH DRSI " */
+ 0x44,0x52,0x53,0x4A,0x20,0x10,0x4F,0x2E, /* 00000560 "DRSJ .O." */
+ 0x5F,0x53,0x42,0x5F,0x5B,0x81,0x24,0x2F, /* 00000568 "_SB_[.$/" */
+ 0x03,0x50,0x43,0x49,0x30,0x49,0x53,0x41, /* 00000570 ".PCI0ISA" */
+ 0x5F,0x50,0x34,0x30,0x43,0x01,0x50,0x52, /* 00000578 "_P40C.PR" */
+ 0x51,0x30,0x08,0x50,0x52,0x51,0x31,0x08, /* 00000580 "Q0.PRQ1." */
+ 0x50,0x52,0x51,0x32,0x08,0x50,0x52,0x51, /* 00000588 "PRQ2.PRQ" */
+ 0x33,0x08,0x5B,0x82,0x4E,0x0A,0x4C,0x4E, /* 00000590 "3.[.N.LN" */
+ 0x4B,0x41,0x08,0x5F,0x48,0x49,0x44,0x0C, /* 00000598 "KA._HID." */
+ 0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,0x49, /* 000005A0 "A...._UI" */
+ 0x44,0x01,0x08,0x5F,0x50,0x52,0x53,0x11, /* 000005A8 "D.._PRS." */
+ 0x09,0x0A,0x06,0x23,0xF8,0x1E,0x18,0x79, /* 000005B0 "...#...y" */
+ 0x00,0x14,0x1A,0x5F,0x53,0x54,0x41,0x00, /* 000005B8 "..._STA." */
+ 0x70,0x0A,0x0B,0x60,0xA0,0x0D,0x7B,0x0A, /* 000005C0 "p..`..{." */
+ 0x80,0x50,0x52,0x51,0x30,0x61,0x70,0x0A, /* 000005C8 ".PRQ0ap." */
+ 0x09,0x60,0xA4,0x60,0x14,0x11,0x5F,0x44, /* 000005D0 ".`.`.._D" */
+ 0x49,0x53,0x00,0x7D,0x50,0x52,0x51,0x30, /* 000005D8 "IS.}PRQ0" */
+ 0x0A,0x80,0x50,0x52,0x51,0x30,0x14,0x3F, /* 000005E0 "..PRQ0.?" */
+ 0x5F,0x43,0x52,0x53,0x00,0x08,0x50,0x52, /* 000005E8 "_CRS..PR" */
+ 0x52,0x30,0x11,0x09,0x0A,0x06,0x23,0x02, /* 000005F0 "R0....#." */
+ 0x00,0x18,0x79,0x00,0x8B,0x50,0x52,0x52, /* 000005F8 "..y..PRR" */
+ 0x30,0x01,0x54,0x4D,0x50,0x5F,0x70,0x50, /* 00000600 "0.TMP_pP" */
+ 0x52,0x51,0x30,0x60,0xA0,0x0C,0x95,0x60, /* 00000608 "RQ0`...`" */
+ 0x0A,0x80,0x79,0x01,0x60,0x54,0x4D,0x50, /* 00000610 "..y.`TMP" */
+ 0x5F,0xA1,0x07,0x70,0x00,0x54,0x4D,0x50, /* 00000618 "_..p.TMP" */
+ 0x5F,0xA4,0x50,0x52,0x52,0x30,0x14,0x1B, /* 00000620 "_.PRR0.." */
+ 0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,0x01, /* 00000628 "_SRS..h." */
+ 0x54,0x4D,0x50,0x5F,0x82,0x54,0x4D,0x50, /* 00000630 "TMP_.TMP" */
+ 0x5F,0x60,0x76,0x60,0x70,0x60,0x50,0x52, /* 00000638 "_`v`p`PR" */
+ 0x51,0x30,0x5B,0x82,0x4F,0x0A,0x4C,0x4E, /* 00000640 "Q0[.O.LN" */
+ 0x4B,0x42,0x08,0x5F,0x48,0x49,0x44,0x0C, /* 00000648 "KB._HID." */
+ 0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,0x49, /* 00000650 "A...._UI" */
+ 0x44,0x0A,0x02,0x08,0x5F,0x50,0x52,0x53, /* 00000658 "D..._PRS" */
+ 0x11,0x09,0x0A,0x06,0x23,0xF8,0x1E,0x18, /* 00000660 "....#..." */
+ 0x79,0x00,0x14,0x1A,0x5F,0x53,0x54,0x41, /* 00000668 "y..._STA" */
+ 0x00,0x70,0x0A,0x0B,0x60,0xA0,0x0D,0x7B, /* 00000670 ".p..`..{" */
+ 0x0A,0x80,0x50,0x52,0x51,0x31,0x61,0x70, /* 00000678 "..PRQ1ap" */
+ 0x0A,0x09,0x60,0xA4,0x60,0x14,0x11,0x5F, /* 00000680 "..`.`.._" */
+ 0x44,0x49,0x53,0x00,0x7D,0x50,0x52,0x51, /* 00000688 "DIS.}PRQ" */
+ 0x31,0x0A,0x80,0x50,0x52,0x51,0x31,0x14, /* 00000690 "1..PRQ1." */
+ 0x3F,0x5F,0x43,0x52,0x53,0x00,0x08,0x50, /* 00000698 "?_CRS..P" */
+ 0x52,0x52,0x30,0x11,0x09,0x0A,0x06,0x23, /* 000006A0 "RR0....#" */
+ 0x02,0x00,0x18,0x79,0x00,0x8B,0x50,0x52, /* 000006A8 "...y..PR" */
+ 0x52,0x30,0x01,0x54,0x4D,0x50,0x5F,0x70, /* 000006B0 "R0.TMP_p" */
+ 0x50,0x52,0x51,0x31,0x60,0xA0,0x0C,0x95, /* 000006B8 "PRQ1`..." */
+ 0x60,0x0A,0x80,0x79,0x01,0x60,0x54,0x4D, /* 000006C0 "`..y.`TM" */
+ 0x50,0x5F,0xA1,0x07,0x70,0x00,0x54,0x4D, /* 000006C8 "P_..p.TM" */
+ 0x50,0x5F,0xA4,0x50,0x52,0x52,0x30,0x14, /* 000006D0 "P_.PRR0." */
+ 0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68, /* 000006D8 "._SRS..h" */
+ 0x01,0x54,0x4D,0x50,0x5F,0x82,0x54,0x4D, /* 000006E0 ".TMP_.TM" */
+ 0x50,0x5F,0x60,0x76,0x60,0x70,0x60,0x50, /* 000006E8 "P_`v`p`P" */
+ 0x52,0x51,0x31,0x5B,0x82,0x4F,0x0A,0x4C, /* 000006F0 "RQ1[.O.L" */
+ 0x4E,0x4B,0x43,0x08,0x5F,0x48,0x49,0x44, /* 000006F8 "NKC._HID" */
+ 0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55, /* 00000700 ".A...._U" */
+ 0x49,0x44,0x0A,0x03,0x08,0x5F,0x50,0x52, /* 00000708 "ID..._PR" */
+ 0x53,0x11,0x09,0x0A,0x06,0x23,0xF8,0x1E, /* 00000710 "S....#.." */
+ 0x18,0x79,0x00,0x14,0x1A,0x5F,0x53,0x54, /* 00000718 ".y..._ST" */
+ 0x41,0x00,0x70,0x0A,0x0B,0x60,0xA0,0x0D, /* 00000720 "A.p..`.." */
+ 0x7B,0x0A,0x80,0x50,0x52,0x51,0x32,0x61, /* 00000728 "{..PRQ2a" */
+ 0x70,0x0A,0x09,0x60,0xA4,0x60,0x14,0x11, /* 00000730 "p..`.`.." */
+ 0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,0x52, /* 00000738 "_DIS.}PR" */
+ 0x51,0x32,0x0A,0x80,0x50,0x52,0x51,0x32, /* 00000740 "Q2..PRQ2" */
+ 0x14,0x3F,0x5F,0x43,0x52,0x53,0x00,0x08, /* 00000748 ".?_CRS.." */
+ 0x50,0x52,0x52,0x30,0x11,0x09,0x0A,0x06, /* 00000750 "PRR0...." */
+ 0x23,0x02,0x00,0x18,0x79,0x00,0x8B,0x50, /* 00000758 "#...y..P" */
+ 0x52,0x52,0x30,0x01,0x54,0x4D,0x50,0x5F, /* 00000760 "RR0.TMP_" */
+ 0x70,0x50,0x52,0x51,0x32,0x60,0xA0,0x0C, /* 00000768 "pPRQ2`.." */
+ 0x95,0x60,0x0A,0x80,0x79,0x01,0x60,0x54, /* 00000770 ".`..y.`T" */
+ 0x4D,0x50,0x5F,0xA1,0x07,0x70,0x00,0x54, /* 00000778 "MP_..p.T" */
+ 0x4D,0x50,0x5F,0xA4,0x50,0x52,0x52,0x30, /* 00000780 "MP_.PRR0" */
+ 0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B, /* 00000788 ".._SRS.." */
+ 0x68,0x01,0x54,0x4D,0x50,0x5F,0x82,0x54, /* 00000790 "h.TMP_.T" */
+ 0x4D,0x50,0x5F,0x60,0x76,0x60,0x70,0x60, /* 00000798 "MP_`v`p`" */
+ 0x50,0x52,0x51,0x32,0x5B,0x82,0x4F,0x0A, /* 000007A0 "PRQ2[.O." */
+ 0x4C,0x4E,0x4B,0x44,0x08,0x5F,0x48,0x49, /* 000007A8 "LNKD._HI" */
+ 0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F, /* 000007B0 "D.A...._" */
+ 0x55,0x49,0x44,0x0A,0x04,0x08,0x5F,0x50, /* 000007B8 "UID..._P" */
+ 0x52,0x53,0x11,0x09,0x0A,0x06,0x23,0xF8, /* 000007C0 "RS....#." */
+ 0x1E,0x18,0x79,0x00,0x14,0x1A,0x5F,0x53, /* 000007C8 "..y..._S" */
+ 0x54,0x41,0x00,0x70,0x0A,0x0B,0x60,0xA0, /* 000007D0 "TA.p..`." */
+ 0x0D,0x7B,0x0A,0x80,0x50,0x52,0x51,0x33, /* 000007D8 ".{..PRQ3" */
+ 0x61,0x70,0x0A,0x09,0x60,0xA4,0x60,0x14, /* 000007E0 "ap..`.`." */
+ 0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50, /* 000007E8 "._DIS.}P" */
+ 0x52,0x51,0x33,0x0A,0x80,0x50,0x52,0x51, /* 000007F0 "RQ3..PRQ" */
+ 0x33,0x14,0x3F,0x5F,0x43,0x52,0x53,0x00, /* 000007F8 "3.?_CRS." */
+ 0x08,0x50,0x52,0x52,0x30,0x11,0x09,0x0A, /* 00000800 ".PRR0..." */
+ 0x06,0x23,0x02,0x00,0x18,0x79,0x00,0x8B, /* 00000808 ".#...y.." */
+ 0x50,0x52,0x52,0x30,0x01,0x54,0x4D,0x50, /* 00000810 "PRR0.TMP" */
+ 0x5F,0x70,0x50,0x52,0x51,0x33,0x60,0xA0, /* 00000818 "_pPRQ3`." */
+ 0x0C,0x95,0x60,0x0A,0x80,0x79,0x01,0x60, /* 00000820 "..`..y.`" */
+ 0x54,0x4D,0x50,0x5F,0xA1,0x07,0x70,0x00, /* 00000828 "TMP_..p." */
+ 0x54,0x4D,0x50,0x5F,0xA4,0x50,0x52,0x52, /* 00000830 "TMP_.PRR" */
+ 0x30,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01, /* 00000838 "0.._SRS." */
+ 0x8B,0x68,0x01,0x54,0x4D,0x50,0x5F,0x82, /* 00000840 ".h.TMP_." */
+ 0x54,0x4D,0x50,0x5F,0x60,0x76,0x60,0x70, /* 00000848 "TMP_`v`p" */
+ 0x60,0x50,0x52,0x51,0x33,0x08,0x5F,0x53, /* 00000850 "`PRQ3._S" */
+ 0x35,0x5F,0x12,0x06,0x04,0x00,0x00,0x00, /* 00000858 "5_......" */
+ 0x00,
};
Index: rombios.c
===================================================================
RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
retrieving revision 1.196
diff -u -r1.196 rombios.c
--- rombios.c 14 Jan 2008 19:10:37 -0000 1.196
+++ rombios.c 20 Jan 2008 13:11:11 -0000
@@ -181,15 +181,6 @@
#define IPL_TYPE_CDROM 0x03
#define IPL_TYPE_BEV 0x80
- // Define the application NAME
-#if defined(BX_QEMU)
-# define BX_APPNAME "QEMU"
-#elif defined(PLEX86)
-# define BX_APPNAME "Plex86"
-#else
-# define BX_APPNAME "Bochs"
-#endif
-
// Sanity Checks
#if BX_USE_ATADRV && BX_CPU<3
# error The ATA/ATAPI Driver can only to be used with a 386+ cpu
Index: rombios.h
===================================================================
RCS file: /cvsroot/bochs/bochs/bios/rombios.h,v
retrieving revision 1.4
diff -u -r1.4 rombios.h
--- rombios.h 20 Feb 2007 09:36:55 -0000 1.4
+++ rombios.h 20 Jan 2008 13:11:20 -0000
@@ -57,3 +57,12 @@
#define PM_IO_BASE 0xb000
#define SMB_IO_BASE 0xb100
#define CPU_COUNT_ADDR 0xf000
+
+ // Define the application NAME
+#if defined(BX_QEMU)
+# define BX_APPNAME "QEMU"
+#elif defined(PLEX86)
+# define BX_APPNAME "Plex86"
+#else
+# define BX_APPNAME "Bochs"
+#endif
Index: rombios32.c
===================================================================
RCS file: /cvsroot/bochs/bochs/bios/rombios32.c,v
retrieving revision 1.18
diff -u -r1.18 rombios32.c
--- rombios32.c 6 Jan 2008 20:57:24 -0000 1.18
+++ rombios32.c 20 Jan 2008 13:09:57 -0000
@@ -380,6 +380,7 @@
uint32_t cpuid_features;
uint32_t cpuid_ext_features;
unsigned long ram_size;
+uint8_t bios_uuid[16];
#ifdef BX_USE_EBDA_TABLES
unsigned long ebda_cur_addr;
#endif
@@ -389,6 +390,33 @@
unsigned long bios_table_cur_addr;
unsigned long bios_table_end_addr;
+void uuid_probe(void)
+{
+#ifdef BX_QEMU
+ uint32_t eax, ebx, ecx, edx;
+
+ // check if backdoor port exists
+ asm volatile ("outl %%eax, %%dx"
+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+ : "a" (0x564d5868), "c" (0xa), "d" (0x5658));
+ if (ebx == 0x564d5868) {
+ uint32_t *uuid_ptr = (uint32_t *)bios_uuid;
+ // get uuid
+ asm volatile ("outl %%eax, %%dx"
+ : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+ : "a" (0x564d5868), "c" (0x13), "d" (0x5658));
+ uuid_ptr[0] = eax;
+ uuid_ptr[1] = ebx;
+ uuid_ptr[2] = ecx;
+ uuid_ptr[3] = edx;
+ } else
+#endif
+ {
+ // UUID not set
+ memset(bios_uuid, 0, 16);
+ }
+}
+
void cpu_probe(void)
{
uint32_t eax, ebx, ecx, edx;
@@ -875,6 +903,11 @@
int ioapic_id, i, len;
int mp_config_table_size;
+#ifdef BX_QEMU
+ if (smp_cpus <= 1)
+ return;
+#endif
+
#ifdef BX_USE_EBDA_TABLES
mp_config_table = (uint8_t *)(ram_size - ACPI_DATA_SIZE - MPTABLE_MAX_SIZE);
#else
@@ -1035,7 +1068,7 @@
struct rsdt_descriptor_rev1
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
- uint32_t table_offset_entry [2]; /* Array of pointers to other */
+ uint32_t table_offset_entry [3]; /* Array of pointers to other */
/* ACPI tables */
};
@@ -1230,6 +1263,57 @@
h->checksum = acpi_checksum((void *)h, len);
}
+int acpi_build_processor_ssdt(uint8_t *ssdt)
+{
+ uint8_t *ssdt_ptr = ssdt;
+ int i, length;
+ int acpi_cpus = smp_cpus > 0xff ? 0xff : smp_cpus;
+
+ ssdt_ptr[9] = 0; // checksum;
+ ssdt_ptr += sizeof(struct acpi_table_header);
+
+ // caluculate the length of processor block and scope block excluding PkgLength
+ length = 0x0d * acpi_cpus + 4;
+
+ // build processor scope header
+ *(ssdt_ptr++) = 0x10; // ScopeOp
+ if (length <= 0x3e) {
+ *(ssdt_ptr++) = length + 1;
+ } else {
+ *(ssdt_ptr++) = 0x7F;
+ *(ssdt_ptr++) = (length + 2) >> 6;
+ }
+ *(ssdt_ptr++) = '_'; // Name
+ *(ssdt_ptr++) = 'P';
+ *(ssdt_ptr++) = 'R';
+ *(ssdt_ptr++) = '_';
+
+ // build object for each processor
+ for(i=0;i<acpi_cpus;i++) {
+ *(ssdt_ptr++) = 0x5B; // ProcessorOp
+ *(ssdt_ptr++) = 0x83;
+ *(ssdt_ptr++) = 0x0B; // Length
+ *(ssdt_ptr++) = 'C'; // Name (CPUxx)
+ *(ssdt_ptr++) = 'P';
+ if ((i & 0xf0) != 0)
+ *(ssdt_ptr++) = (i >> 4) < 0xa ? (i >> 4) + '0' : (i >> 4) + 'A' - 0xa;
+ else
+ *(ssdt_ptr++) = 'U';
+ *(ssdt_ptr++) = (i & 0xf) < 0xa ? (i & 0xf) + '0' : (i & 0xf) + 'A' - 0xa;
+ *(ssdt_ptr++) = i;
+ *(ssdt_ptr++) = 0x10; // Processor block address
+ *(ssdt_ptr++) = 0xb0;
+ *(ssdt_ptr++) = 0;
+ *(ssdt_ptr++) = 0;
+ *(ssdt_ptr++) = 6; // Processor block length
+ }
+
+ acpi_build_table_header((struct acpi_table_header *)ssdt,
+ "SSDT", ssdt_ptr - ssdt, 1);
+
+ return ssdt_ptr - ssdt;
+}
+
/* base_addr must be a multiple of 4KB */
void acpi_bios_init(void)
{
@@ -1238,8 +1322,8 @@
struct fadt_descriptor_rev1 *fadt;
struct facs_descriptor_rev1 *facs;
struct multiple_apic_table *madt;
- uint8_t *dsdt;
- uint32_t base_addr, rsdt_addr, fadt_addr, addr, facs_addr, dsdt_addr;
+ uint8_t *dsdt, *ssdt;
+ uint32_t base_addr, rsdt_addr, fadt_addr, addr, facs_addr, dsdt_addr, ssdt_addr;
uint32_t acpi_tables_size, madt_addr, madt_size;
int i;
@@ -1273,6 +1357,10 @@
dsdt = (void *)(addr);
addr += sizeof(AmlCode);
+ ssdt_addr = addr;
+ ssdt = (void *)(addr);
+ addr += acpi_build_processor_ssdt(ssdt);
+
addr = (addr + 7) & ~7;
madt_addr = addr;
madt_size = sizeof(*madt) +
@@ -1302,6 +1390,7 @@
memset(rsdt, 0, sizeof(*rsdt));
rsdt->table_offset_entry[0] = cpu_to_le32(fadt_addr);
rsdt->table_offset_entry[1] = cpu_to_le32(madt_addr);
+ rsdt->table_offset_entry[2] = cpu_to_le32(ssdt_addr);
acpi_build_table_header((struct acpi_table_header *)rsdt,
"RSDT", sizeof(*rsdt), 1);
@@ -1366,6 +1455,516 @@
}
}
+/* SMBIOS entry point -- must be written to a 16-bit aligned address
+ between 0xf0000 and 0xfffff.
+ */
+struct smbios_entry_point {
+ char anchor_string[4];
+ uint8_t checksum;
+ uint8_t length;
+ uint8_t smbios_major_version;
+ uint8_t smbios_minor_version;
+ uint16_t max_structure_size;
+ uint8_t entry_point_revision;
+ uint8_t formatted_area[5];
+ char intermediate_anchor_string[5];
+ uint8_t intermediate_checksum;
+ uint16_t structure_table_length;
+ uint32_t structure_table_address;
+ uint16_t number_of_structures;
+ uint8_t smbios_bcd_revision;
+};
+
+/* This goes at the beginning of every SMBIOS structure. */
+struct smbios_structure_header {
+ uint8_t type;
+ uint8_t length;
+ uint16_t handle;
+};
+
+/* SMBIOS type 0 - BIOS Information */
+struct smbios_type_0 {
+ struct smbios_structure_header header;
+ uint8_t vendor_str;
+ uint8_t bios_version_str;
+ uint16_t bios_starting_address_segment;
+ uint8_t bios_release_date_str;
+ uint8_t bios_rom_size;
+ uint8_t bios_characteristics[8];
+ uint8_t bios_characteristics_extension_bytes[2];
+ uint8_t system_bios_major_release;
+ uint8_t system_bios_minor_release;
+ uint8_t embedded_controller_major_release;
+ uint8_t embedded_controller_minor_release;
+};
+
+/* SMBIOS type 1 - System Information */
+struct smbios_type_1 {
+ struct smbios_structure_header header;
+ uint8_t manufacturer_str;
+ uint8_t product_name_str;
+ uint8_t version_str;
+ uint8_t serial_number_str;
+ uint8_t uuid[16];
+ uint8_t wake_up_type;
+ uint8_t sku_number_str;
+ uint8_t family_str;
+};
+
+/* SMBIOS type 3 - System Enclosure (v2.3) */
+struct smbios_type_3 {
+ struct smbios_structure_header header;
+ uint8_t manufacturer_str;
+ uint8_t type;
+ uint8_t version_str;
+ uint8_t serial_number_str;
+ uint8_t asset_tag_number_str;
+ uint8_t boot_up_state;
+ uint8_t power_supply_state;
+ uint8_t thermal_state;
+ uint8_t security_status;
+ uint32_t oem_defined;
+ uint8_t height;
+ uint8_t number_of_power_cords;
+ uint8_t contained_element_count;
+ // contained elements follow
+};
+
+/* SMBIOS type 4 - Processor Information (v2.0) */
+struct smbios_type_4 {
+ struct smbios_structure_header header;
+ uint8_t socket_designation_str;
+ uint8_t processor_type;
+ uint8_t processor_family;
+ uint8_t processor_manufacturer_str;
+ uint32_t processor_id[2];
+ uint8_t processor_version_str;
+ uint8_t voltage;
+ uint16_t external_clock;
+ uint16_t max_speed;
+ uint16_t current_speed;
+ uint8_t status;
+ uint8_t processor_upgrade;
+};
+
+/* SMBIOS type 16 - Physical Memory Array
+ * Associated with one type 17 (Memory Device).
+ */
+struct smbios_type_16 {
+ struct smbios_structure_header header;
+ uint8_t location;
+ uint8_t use;
+ uint8_t error_correction;
+ uint32_t maximum_capacity;
+ uint16_t memory_error_information_handle;
+ uint16_t number_of_memory_devices;
+};
+
+/* SMBIOS type 17 - Memory Device
+ * Associated with one type 19
+ */
+struct smbios_type_17 {
+ struct smbios_structure_header header;
+ uint16_t physical_memory_array_handle;
+ uint16_t memory_error_information_handle;
+ uint16_t total_width;
+ uint16_t data_width;
+ uint16_t size;
+ uint8_t form_factor;
+ uint8_t device_set;
+ uint8_t device_locator_str;
+ uint8_t bank_locator_str;
+ uint8_t memory_type;
+ uint16_t type_detail;
+};
+
+/* SMBIOS type 19 - Memory Array Mapped Address */
+struct smbios_type_19 {
+ struct smbios_structure_header header;
+ uint32_t starting_address;
+ uint32_t ending_address;
+ uint16_t memory_array_handle;
+ uint8_t partition_width;
+};
+
+/* SMBIOS type 20 - Memory Device Mapped Address */
+struct smbios_type_20 {
+ struct smbios_structure_header header;
+ uint32_t starting_address;
+ uint32_t ending_address;
+ uint16_t memory_device_handle;
+ uint16_t memory_array_mapped_address_handle;
+ uint8_t partition_row_position;
+ uint8_t interleave_position;
+ uint8_t interleaved_data_depth;
+};
+
+/* SMBIOS type 32 - System Boot Information */
+struct smbios_type_32 {
+ struct smbios_structure_header header;
+ uint8_t reserved[6];
+ uint8_t boot_status;
+};
+
+/* SMBIOS type 127 -- End-of-table */
+struct smbios_type_127 {
+ struct smbios_structure_header header;
+};
+
+static void
+smbios_entry_point_init(void *start,
+ uint16_t max_structure_size,
+ uint16_t structure_table_length,
+ uint32_t structure_table_address,
+ uint16_t number_of_structures)
+{
+ uint8_t sum;
+ int i;
+ struct smbios_entry_point *ep = (struct smbios_entry_point *)start;
+
+ memcpy(ep->anchor_string, "_SM_", 4);
+ ep->length = 0x1f;
+ ep->smbios_major_version = 2;
+ ep->smbios_minor_version = 4;
+ ep->max_structure_size = max_structure_size;
+ ep->entry_point_revision = 0;
+ memset(ep->formatted_area, 0, 5);
+ memcpy(ep->intermediate_anchor_string, "_DMI_", 5);
+
+ ep->structure_table_length = structure_table_length;
+ ep->structure_table_address = structure_table_address;
+ ep->number_of_structures = number_of_structures;
+ ep->smbios_bcd_revision = 0x24;
+
+ ep->checksum = 0;
+ ep->intermediate_checksum = 0;
+
+ sum = 0;
+ for (i = 0; i < 0x10; i++)
+ sum += ((int8_t *)start)[i];
+ ep->checksum = -sum;
+
+ sum = 0;
+ for (i = 0x10; i < ep->length; i++)
+ sum += ((int8_t *)start)[i];
+ ep->intermediate_checksum = -sum;
+ }
+
+/* Type 0 -- BIOS Information */
+#define RELEASE_DATE_STR "01/01/2007"
+static void *
+smbios_type_0_init(void *start)
+{
+ struct smbios_type_0 *p = (struct smbios_type_0 *)start;
+
+ p->header.type = 0;
+ p->header.length = sizeof(struct smbios_type_0);
+ p->header.handle = 0;
+
+ p->vendor_str = 1;
+ p->bios_version_str = 1;
+ p->bios_starting_address_segment = 0xe800;
+ p->bios_release_date_str = 2;
+ p->bios_rom_size = 0; /* FIXME */
+
+ memset(p->bios_characteristics, 0, 7);
+ p->bios_characteristics[7] = 0x08; /* BIOS characteristics not supported */
+ p->bios_characteristics_extension_bytes[0] = 0;
+ p->bios_characteristics_extension_bytes[1] = 0;
+
+ p->system_bios_major_release = 1;
+ p->system_bios_minor_release = 0;
+ p->embedded_controller_major_release = 0xff;
+ p->embedded_controller_minor_release = 0xff;
+
+ start += sizeof(struct smbios_type_0);
+ memcpy((char *)start, BX_APPNAME, sizeof(BX_APPNAME));
+ start += sizeof(BX_APPNAME);
+ memcpy((char *)start, RELEASE_DATE_STR, sizeof(RELEASE_DATE_STR));
+ start += sizeof(RELEASE_DATE_STR);
+ *((uint16_t *)start) = 0;
+
+ return start+2;
+}
+
+/* Type 1 -- System Information */
+static void *
+smbios_type_1_init(void *start)
+{
+ struct smbios_type_1 *p = (struct smbios_type_1 *)start;
+ p->header.type = 1;
+ p->header.length = sizeof(struct smbios_type_1);
+ p->header.handle = 0x100;
+
+ p->manufacturer_str = 0;
+ p->product_name_str = 0;
+ p->version_str = 0;
+ p->serial_number_str = 0;
+
+ memcpy(p->uuid, bios_uuid, 16);
+
+ p->wake_up_type = 0x06; /* power switch */
+ p->sku_number_str = 0;
+ p->family_str = 0;
+
+ start += sizeof(struct smbios_type_1);
+ *((uint16_t *)start) = 0;
+
+ return start+2;
+}
+
+/* Type 3 -- System Enclosure */
+static void *
+smbios_type_3_init(void *start)
+{
+ struct smbios_type_3 *p = (struct smbios_type_3 *)start;
+
+ p->header.type = 3;
+ p->header.length = sizeof(struct smbios_type_3);
+ p->header.handle = 0x300;
+
+ p->manufacturer_str = 0;
+ p->type = 0x01; /* other */
+ p->version_str = 0;
+ p->serial_number_str = 0;
+ p->asset_tag_number_str = 0;
+ p->boot_up_state = 0x03; /* safe */
+ p->power_supply_state = 0x03; /* safe */
+ p->thermal_state = 0x03; /* safe */
+ p->security_status = 0x02; /* unknown */
+ p->oem_defined = 0;
+ p->height = 0;
+ p->number_of_power_cords = 0;
+ p->contained_element_count = 0;
+
+ start += sizeof(struct smbios_type_3);
+ *((uint16_t *)start) = 0;
+
+ return start+2;
+}
+
+/* Type 4 -- Processor Information */
+static void *
+smbios_type_4_init(void *start, unsigned int cpu_number)
+{
+ struct smbios_type_4 *p = (struct smbios_type_4 *)start;
+
+ p->header.type = 4;
+ p->header.length = sizeof(struct smbios_type_4);
+ p->header.handle = 0x400 + cpu_number;
+
+ p->socket_designation_str = 1;
+ p->processor_type = 0x03; /* CPU */
+ p->processor_family = 0x01; /* other */
+ p->processor_manufacturer_str = 2;
+
+ p->processor_id[0] = cpuid_signature;
+ p->processor_id[1] = cpuid_features;
+
+ p->processor_version_str = 0;
+ p->voltage = 0;
+ p->external_clock = 0;
+
+ p->max_speed = 0; /* unknown */
+ p->current_speed = 0; /* unknown */
+
+ p->status = 0x41; /* socket populated, CPU enabled */
+ p->processor_upgrade = 0x01; /* other */
+
+ start += sizeof(struct smbios_type_4);
+
+ memcpy((char *)start, "CPU " "\0" "" "\0" "", 7);
+ ((char *)start)[4] = cpu_number + '0';
+
+ return start+7;
+}
+
+/* Type 16 -- Physical Memory Array */
+static void *
+smbios_type_16_init(void *start, uint32_t memsize)
+{
+ struct smbios_type_16 *p = (struct smbios_type_16*)start;
+
+ p->header.type = 16;
+ p->header.handle = 0x1000;
+ p->header.length = sizeof(struct smbios_type_16);
+
+ p->location = 0x01; /* other */
+ p->use = 0x03; /* system memory */
+ p->error_correction = 0x01; /* other */
+ p->maximum_capacity = memsize * 1024;
+ p->memory_error_information_handle = 0xfffe; /* none provided */
+ p->number_of_memory_devices = 1;
+
+ start += sizeof(struct smbios_type_16);
+ *((uint16_t *)start) = 0;
+
+ return start + 2;
+}
+
+/* Type 17 -- Memory Device */
+static void *
+smbios_type_17_init(void *start, uint32_t memory_size_mb)
+{
+ struct smbios_type_17 *p = (struct smbios_type_17 *)start;
+
+ p->header.type = 17;
+ p->header.length = sizeof(struct smbios_type_17);
+ p->header.handle = 0x1100;
+
+ p->physical_memory_array_handle = 0x1000;
+ p->total_width = 64;
+ p->data_width = 64;
+ /* truncate memory_size_mb to 16 bits and clear most significant
+ bit [indicates size in MB] */
+ p->size = (uint16_t) memory_size_mb & 0x7fff;
+ p->form_factor = 0x09; /* DIMM */
+ p->device_set = 0;
+ p->device_locator_str = 1;
+ p->bank_locator_str = 0;
+ p->memory_type = 0x07; /* RAM */
+ p->type_detail = 0;
+
+ start += sizeof(struct smbios_type_17);
+ memcpy((char *)start, "DIMM 1", 7);
+ start += 7;
+ *((uint8_t *)start) = 0;
+
+ return start+1;
+}
+
+/* Type 19 -- Memory Array Mapped Address */
+static void *
+smbios_type_19_init(void *start, uint32_t memory_size_mb)
+{
+ struct smbios_type_19 *p = (struct smbios_type_19 *)start;
+
+ p->header.type = 19;
+ p->header.length = sizeof(struct smbios_type_19);
+ p->header.handle = 0x1300;
+
+ p->starting_address = 0;
+ p->ending_address = (memory_size_mb-1) * 1024;
+ p->memory_array_handle = 0x1000;
+ p->partition_width = 1;
+
+ start += sizeof(struct smbios_type_19);
+ *((uint16_t *)start) = 0;
+
+ return start + 2;
+}
+
+/* Type 20 -- Memory Device Mapped Address */
+static void *
+smbios_type_20_init(void *start, uint32_t memory_size_mb)
+{
+ struct smbios_type_20 *p = (struct smbios_type_20 *)start;
+
+ p->header.type = 20;
+ p->header.length = sizeof(struct smbios_type_20);
+ p->header.handle = 0x1400;
+
+ p->starting_address = 0;
+ p->ending_address = (memory_size_mb-1)*1024;
+ p->memory_device_handle = 0x1100;
+ p->memory_array_mapped_address_handle = 0x1300;
+ p->partition_row_position = 1;
+ p->interleave_position = 0;
+ p->interleaved_data_depth = 0;
+
+ start += sizeof(struct smbios_type_20);
+
+ *((uint16_t *)start) = 0;
+ return start+2;
+}
+
+/* Type 32 -- System Boot Information */
+static void *
+smbios_type_32_init(void *start)
+{
+ struct smbios_type_32 *p = (struct smbios_type_32 *)start;
+
+ p->header.type = 32;
+ p->header.length = sizeof(struct smbios_type_32);
+ p->header.handle = 0x2000;
+ memset(p->reserved, 0, 6);
+ p->boot_status = 0; /* no errors detected */
+
+ start += sizeof(struct smbios_type_32);
+ *((uint16_t *)start) = 0;
+
+ return start+2;
+}
+
+/* Type 127 -- End of Table */
+static void *
+smbios_type_127_init(void *start)
+{
+ struct smbios_type_127 *p = (struct smbios_type_127 *)start;
+
+ p->header.type = 127;
+ p->header.length = sizeof(struct smbios_type_127);
+ p->header.handle = 0x7f00;
+
+ start += sizeof(struct smbios_type_127);
+ *((uint16_t *)start) = 0;
+
+ return start + 2;
+}
+
+void smbios_init(void)
+{
+ unsigned cpu_num, nr_structs = 0, max_struct_size = 0;
+ char *start, *p, *q;
+ int memsize = ram_size / (1024 * 1024);
+
+#ifdef BX_USE_EBDA_TABLES
+ ebda_cur_addr = align(ebda_cur_addr, 16);
+ start = (void *)(ebda_cur_addr);
+#else
+ bios_table_cur_addr = align(bios_table_cur_addr, 16);
+ start = (void *)(bios_table_cur_addr);
+#endif
+
+ p = (char *)start + sizeof(struct smbios_entry_point);
+
+#define add_struct(fn) { \
+ q = (fn); \
+ nr_structs++; \
+ if ((q - p) > max_struct_size) \
+ max_struct_size = q - p; \
+ p = q; \
+}
+
+ add_struct(smbios_type_0_init(p));
+ add_struct(smbios_type_1_init(p));
+ add_struct(smbios_type_3_init(p));
+ for (cpu_num = 1; cpu_num <= smp_cpus; cpu_num++)
+ add_struct(smbios_type_4_init(p, cpu_num));
+ add_struct(smbios_type_16_init(p, memsize));
+ add_struct(smbios_type_17_init(p, memsize));
+ add_struct(smbios_type_19_init(p, memsize));
+ add_struct(smbios_type_20_init(p, memsize));
+ add_struct(smbios_type_32_init(p));
+ add_struct(smbios_type_127_init(p));
+
+#undef add_struct
+
+ smbios_entry_point_init(
+ start, max_struct_size,
+ (p - (char *)start) - sizeof(struct smbios_entry_point),
+ (uint32_t)(start + sizeof(struct smbios_entry_point)),
+ nr_structs);
+
+#ifdef BX_USE_EBDA_TABLES
+ ebda_cur_addr += (p - (char *)start);
+#else
+ bios_table_cur_addr += (p - (char *)start);
+#endif
+
+ BX_INFO("SMBIOS table addr=0x%08lx\n", (unsigned long)start);
+}
+
void rombios32_init(void)
{
BX_INFO("Starting rombios32\n");
@@ -1375,12 +1974,16 @@
cpu_probe();
smp_probe();
+
+ uuid_probe();
pci_bios_init();
if (bios_table_cur_addr != 0) {
mptable_init();
+
+ smbios_init();
if (acpi_enabled)
acpi_bios_init();
[-- Attachment #3: BIOS-bochs-latest --]
[-- Type: application/octet-stream, Size: 131072 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-20 13:17 ` Filip Navara
@ 2008-01-20 14:25 ` Paul Brook
2008-01-20 15:26 ` Filip Navara
2008-01-20 16:20 ` [kvm-devel] " Alexander Graf
1 sibling, 1 reply; 16+ messages in thread
From: Paul Brook @ 2008-01-20 14:25 UTC (permalink / raw)
To: qemu-devel
On Sunday 20 January 2008, Filip Navara wrote:
> Hello,
>
> attached is a patch that implements the SMBIOS within the Bochs BIOS code.
> Complete list of changes:
This should be submitted to the Bochs list.
Paul
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-20 14:25 ` Paul Brook
@ 2008-01-20 15:26 ` Filip Navara
0 siblings, 0 replies; 16+ messages in thread
From: Filip Navara @ 2008-01-20 15:26 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 408 bytes --]
http://sourceforge.net/tracker/index.php?func=detail&aid=1864692&group_id=12580&atid=312580
- Filip
On Jan 20, 2008 3:25 PM, Paul Brook <paul@codesourcery.com> wrote:
> On Sunday 20 January 2008, Filip Navara wrote:
> > Hello,
> >
> > attached is a patch that implements the SMBIOS within the Bochs BIOS
> code.
> > Complete list of changes:
>
> This should be submitted to the Bochs list.
>
> Paul
>
>
>
[-- Attachment #2: Type: text/html, Size: 860 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-20 13:17 ` Filip Navara
2008-01-20 14:25 ` Paul Brook
@ 2008-01-20 16:20 ` Alexander Graf
2008-01-20 16:37 ` Filip Navara
1 sibling, 1 reply; 16+ messages in thread
From: Alexander Graf @ 2008-01-20 16:20 UTC (permalink / raw)
To: Filip Navara; +Cc: kvm-devel, Ryan Harper, qemu-devel
On Jan 20, 2008, at 2:17 PM, Filip Navara wrote:
> Hello,
>
> attached is a patch that implements the SMBIOS within the Bochs BIOS
> code. Complete list of changes:
>
> - Added generation of SSDT ACPI table that contains definitions for
> available processors.
> - Added basic implementation of SMBIOS.
> - Added querying of BIOS UUID using VMware backdoor I/O port (enable
> only if BX_QEMU is defined).
> - Added RTC device to ACPI DSDT table.
>
This is great news. I was eagerly waiting for this. It looks like this
fixes most problems I had with running Mac OS X as a guest OS. I will
definitely try this tomorrow and tell you the results.
Is the VMWare I/O backdoor implemented already or is this patch meant
to be applied on top of another patch?
Regards,
Alex
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-20 16:20 ` [kvm-devel] " Alexander Graf
@ 2008-01-20 16:37 ` Filip Navara
2008-01-20 16:53 ` Alexander Graf
0 siblings, 1 reply; 16+ messages in thread
From: Filip Navara @ 2008-01-20 16:37 UTC (permalink / raw)
To: Alexander Graf; +Cc: kvm-devel, Ryan Harper, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]
The specific VMware backdoor call isn't implemented, but the framework is
there and it wouldn't be hard to add support for it. The BIOS can fallback
to some "reasonable" value if the backdoor isn't available.
Best regards,
Filip Navara
On Jan 20, 2008 5:20 PM, Alexander Graf <alex@csgraf.de> wrote:
>
> On Jan 20, 2008, at 2:17 PM, Filip Navara wrote:
>
> > Hello,
> >
> > attached is a patch that implements the SMBIOS within the Bochs BIOS
> > code. Complete list of changes:
> >
> > - Added generation of SSDT ACPI table that contains definitions for
> > available processors.
> > - Added basic implementation of SMBIOS.
> > - Added querying of BIOS UUID using VMware backdoor I/O port (enable
> > only if BX_QEMU is defined).
> > - Added RTC device to ACPI DSDT table.
> >
>
> This is great news. I was eagerly waiting for this. It looks like this
> fixes most problems I had with running Mac OS X as a guest OS. I will
> definitely try this tomorrow and tell you the results.
>
> Is the VMWare I/O backdoor implemented already or is this patch meant
> to be applied on top of another patch?
>
> Regards,
>
> Alex
>
>
[-- Attachment #2: Type: text/html, Size: 1507 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-20 16:37 ` Filip Navara
@ 2008-01-20 16:53 ` Alexander Graf
2008-01-20 17:01 ` Filip Navara
0 siblings, 1 reply; 16+ messages in thread
From: Alexander Graf @ 2008-01-20 16:53 UTC (permalink / raw)
To: Filip Navara; +Cc: kvm-devel, Ryan Harper, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]
On Jan 20, 2008, at 5:37 PM, Filip Navara wrote:
> The specific VMware backdoor call isn't implemented, but the
> framework is there and it wouldn't be hard to add support for it.
> The BIOS can fallback to some "reasonable" value if the backdoor
> isn't available.
>
+ memset(bios_uuid, 0, 16);
This value? Why not put something more "reasonable" in there? Does a
uuid have to meet specific criteria (checksums)? If not, why not
simply put something like "QEMU" in here? If I remember correctly OSX
needs a value in the uuid or it fails to boot, so it might be a good
idea to give it something better than an empty string.
> Best regards,
> Filip Navara
>
> On Jan 20, 2008 5:20 PM, Alexander Graf <alex@csgraf.de> wrote:
>
> On Jan 20, 2008, at 2:17 PM, Filip Navara wrote:
>
> > Hello,
> >
> > attached is a patch that implements the SMBIOS within the Bochs BIOS
> > code. Complete list of changes:
> >
> > - Added generation of SSDT ACPI table that contains definitions for
> > available processors.
> > - Added basic implementation of SMBIOS.
> > - Added querying of BIOS UUID using VMware backdoor I/O port (enable
> > only if BX_QEMU is defined).
> > - Added RTC device to ACPI DSDT table.
> >
>
> This is great news. I was eagerly waiting for this. It looks like this
> fixes most problems I had with running Mac OS X as a guest OS. I will
> definitely try this tomorrow and tell you the results.
>
> Is the VMWare I/O backdoor implemented already or is this patch meant
> to be applied on top of another patch?
>
> Regards,
>
> Alex
>
>
[-- Attachment #2: Type: text/html, Size: 2311 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [kvm-devel] [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present
2008-01-20 16:53 ` Alexander Graf
@ 2008-01-20 17:01 ` Filip Navara
0 siblings, 0 replies; 16+ messages in thread
From: Filip Navara @ 2008-01-20 17:01 UTC (permalink / raw)
To: Alexander Graf; +Cc: kvm-devel, Ryan Harper, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]
On Jan 20, 2008 5:53 PM, Alexander Graf <alex@csgraf.de> wrote:
>
> On Jan 20, 2008, at 5:37 PM, Filip Navara wrote:
>
> The specific VMware backdoor call isn't implemented, but the framework is
> there and it wouldn't be hard to add support for it. The BIOS can fallback
> to some "reasonable" value if the backdoor isn't available.
>
>
> + memset(bios_uuid, 0, 16);
>
> This value? Why not put something more "reasonable" in there? Does a uuid
> have to meet specific criteria (checksums)? If not, why not simply put
> something like "QEMU" in here? If I remember correctly OSX needs a value in
> the uuid or it fails to boot, so it might be a good idea to give it
> something better than an empty string.
>
Yes, this value. All zeroes means that UUID is not present in the system.
The value has to follow the criteria of SMBIOS specification, section
3.3.2.1, namely it has to be formatted like this:
DWORD time_low;
WORD time_mid;
WORD time_high_and_version;
BYTE clock_seq_hi_and_reserved;
BYTE clock_seq_low;
BYTE node_number[6];
I doubt any driver really checks the value, except maybe for the all-0xFF or
all-0x00 case.
- Filip
[-- Attachment #2: Type: text/html, Size: 1650 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2008-01-20 17:01 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 20:08 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 1 of 3] export SMBIOS/DMI tables to PC machines Ryan Harper
2007-12-11 20:08 ` [Qemu-devel] [PATCH 2 of 3] Optionally link against libuuid if present Ryan Harper
2007-12-11 21:19 ` Filip Navara
2007-12-12 22:51 ` Fabrice Bellard
2008-01-03 19:55 ` Ryan Harper
2008-01-20 13:17 ` Filip Navara
2008-01-20 14:25 ` Paul Brook
2008-01-20 15:26 ` Filip Navara
2008-01-20 16:20 ` [kvm-devel] " Alexander Graf
2008-01-20 16:37 ` Filip Navara
2008-01-20 16:53 ` Alexander Graf
2008-01-20 17:01 ` Filip Navara
2007-12-11 21:21 ` Filip Navara
2007-12-11 20:08 ` [Qemu-devel] [PATCH 3 of 3] Add -uuid command line flag Ryan Harper
-- strict thread matches above, loose matches on Subject: below --
2007-12-07 20:45 [Qemu-devel] [PATCH 0 of 3] Add SMBIOS/DMI table generation to PC machine Ryan Harper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).