跳转至

日期: 2013-12-25

分类: ['cloud-infra']

Slic for qemu-kvm

This article is a howto for activation-ready of Windows. SLIC 2.0 is for 2003 & XP, and 2.1 for Win7 & 2008 Original seabios reads slic table from exactly the host. However, if your motherboard(not OEM) happen to own none, you will most probably make one by your self.

Seabios

You could get the lastest code from here.

git clone git://git.seabios.org/seabios.git seabios

Or, you can download from here.

seabios-1.7.2.2.tar.gz

SLIC-BIN

Here's a collection of various slic table. SLIC 2.1 BINS

Seaslic patch

This is patch for seabios to make it slic table enabled. Download from here.

Seaslic.tar.xz, seabios-1.7.2 compatible Here's the patch content.

--- a/src/acpi.c 2013-01-19 06:44:54.000000000 +0600 +++ b/src/acpi.c 2013-05-07 01:16:30.000000000 +0600 @@ -214,6 +214,11 @@

#include "acpi-dsdt.hex"

+#define CONFIG_OEM_SLIC +#ifdef CONFIG_OEM_SLIC +#include "acpi-slic.hex" +#endif + static void build_header(struct acpi_table_header *h, u32 sig, int len, u8 rev) { @@ -226,6 +231,10 @@ h->oem_revision = cpu_to_le32(1); memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4); h->asl_compiler_revision = cpu_to_le32(1); + #ifdef CONFIG_OEM_SLIC + if (sig == RSDT_SIGNATURE) // only RSDT is checked by win7 & vista + memcpy(h->oem_id, ((struct acpi_table_header*)SLIC)->oem_id, 14); + #endif h->checksum -= checksum(h, len); }

@@ -827,6 +836,15 @@ ACPI_INIT_TABLE(build_srat()); if (pci->device == PCI_DEVICE_ID_INTEL_ICH9_LPC) ACPI_INIT_TABLE(build_mcfg_q35()); + #ifdef CONFIG_OEM_SLIC + void *buf = malloc_high(sizeof(SLIC)); + if (!buf) + warn_noalloc(); + else { + memcpy(buf, SLIC, sizeof(SLIC)); + ACPI_INIT_TABLE(buf); + } + #endif

1
 u16 i, external\_tables = qemu\_cfg\_acpi\_additional\_tables();

Compile

You don't have to apply the seaslic patch with patch.sh, you can do that by hand. Before you start, do this:

xxd -i /sys/firmware/acpi/tables/SLIC | grep -v len | sed 's/unsigned ch ar.*/static char SLIC[] = {/' > seabios.submodule/src/acpi-slic.hex

Or,

xxd -i DELL.BIN | grep -v len | sed 's/unsigned ch ar.*/static char SLIC[] = {/' > seabios.submodule/src/acpi-slic.hex

After applying the patch, you can compile the bios.bin, and copy that to /usr/share/qemu-kvm/my-bios.bin or rewrite bios.bin instead. Here's my bios.bin with Dell[DELL-QA09-NVDA]2.1.BIN from SLIC BIN

my-bin.tar.xz

Qemu-cmd

qemu-kvm XXX -bios /usr/share/qemu-kvm/my-bios.bin -acpitable file=Dell[DELL-QA09-NVDA]2.1.BIN

In the guest, you could see that SLIC by /sys/firmware/acpi/tables/SLIC in Linux or SLIC_Toolkit in Windows.