Remove CONFIG_QEMU option - breakout into other options.
Define all the required app names in config.h directly.
Control UUID detection via new option - CONFIG_UUID_BACKDOOR.
Don't enable mptable on uniprocessor machines (check use to only be
done for qemu, but it is needed everywhere).
Also add new option CONFIG_SMBIOS.
diff --git a/src/acpi.c b/src/acpi.c
index c7d0430..18fc2d5 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -209,15 +209,9 @@
memcpy(h->signature, sig, 4);
h->length = cpu_to_le32(len);
h->revision = rev;
- if (CONFIG_QEMU) {
- memcpy(h->oem_id, "QEMU ", 6);
- memcpy(h->oem_table_id, "QEMU", 4);
- memcpy(h->asl_compiler_id, "QEMU", 4);
- } else {
- memcpy(h->oem_id, "BOCHS ", 6);
- memcpy(h->oem_table_id, "BXPC", 4);
- memcpy(h->asl_compiler_id, "BXPC", 4);
- }
+ memcpy(h->oem_id, CONFIG_APPNAME6, 6);
+ memcpy(h->oem_table_id, CONFIG_APPNAME4, 4);
+ memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4);
memcpy(h->oem_table_id + 4, sig, 4);
h->oem_revision = cpu_to_le32(1);
h->asl_compiler_revision = cpu_to_le32(1);
@@ -348,10 +342,7 @@
/* RSDP */
memset(rsdp, 0, sizeof(*rsdp));
memcpy(rsdp->signature, "RSD PTR ", 8);
- if (CONFIG_QEMU)
- memcpy(rsdp->oem_id, "QEMU ", 6);
- else
- memcpy(rsdp->oem_id, "BOCHS ", 6);
+ memcpy(rsdp->oem_id, CONFIG_APPNAME6, 6);
rsdp->rsdt_physical_address = cpu_to_le32(rsdt_addr);
rsdp->checksum = -checksum((void *)rsdp, 20);
diff --git a/src/config.h b/src/config.h
index f7d058c..f877101 100644
--- a/src/config.h
+++ b/src/config.h
@@ -3,15 +3,14 @@
// Configuration definitions.
-/* Dont support QEMU BIOS by default.
- * Change CONFIG_QEMU to 1 to support QEMU. */
-#define CONFIG_QEMU 0
-
-#if (QEMU_SUPPORT == 1)
-#define CONFIG_APPNAME "QEMU"
-#else
-#define CONFIG_APPNAME "Bochs"
-#endif
+//#define CONFIG_APPNAME "QEMU"
+//#define CONFIG_CPUNAME8 "QEMUCPU "
+//#define CONFIG_APPNAME6 "QEMU "
+//#define CONFIG_APPNAME4 "QEMU"
+#define CONFIG_APPNAME "Bochs"
+#define CONFIG_CPUNAME8 "BOCHSCPU"
+#define CONFIG_APPNAME6 "BOCHS "
+#define CONFIG_APPNAME4 "BXPC"
// Configure as a coreboot payload.
#define CONFIG_COREBOOT 0
@@ -55,6 +54,10 @@
#define CONFIG_PIRTABLE 1
// Support generation of MPTable (for emulators)
#define CONFIG_MPTABLE 1
+// Support generation of SM BIOS tables (for emulators)
+#define CONFIG_SMBIOS 1
+// Support finding a UUID (for smbios) via "magic" outl sequence.
+#define CONFIG_UUID_BACKDOOR 1
// Support generation of ACPI tables (for emulators)
#define CONFIG_ACPI 1
// Support bios callbacks specific to via vgabios.
diff --git a/src/mptable.c b/src/mptable.c
index 5550fd2..7d85399 100644
--- a/src/mptable.c
+++ b/src/mptable.c
@@ -57,7 +57,8 @@
int mp_config_table_size;
int smp_cpus = smp_probe();
- if (CONFIG_QEMU && smp_cpus <= 1)
+ if (smp_cpus <= 1)
+ // Building an mptable on uniprocessor machines confuses some OSes.
return;
bios_table_cur_addr = ALIGN(bios_table_cur_addr, 16);
@@ -67,10 +68,7 @@
putle16(&q, 0); /* table length (patched later) */
putb(&q, 4); /* spec rev */
putb(&q, 0); /* checksum (patched later) */
- if (CONFIG_QEMU)
- putstr(&q, "QEMUCPU "); /* OEM id */
- else
- putstr(&q, "BOCHSCPU");
+ putstr(&q, CONFIG_CPUNAME8); /* OEM id */
putstr(&q, "0.1 "); /* vendor id */
putle32(&q, 0); /* OEM table ptr */
putle16(&q, 0); /* OEM table size */
diff --git a/src/smbios.c b/src/smbios.c
index 020d7c4..8026279 100644
--- a/src/smbios.c
+++ b/src/smbios.c
@@ -20,7 +20,7 @@
// Default to UUID not set
memset(bios_uuid, 0, 16);
- if (! CONFIG_QEMU)
+ if (! CONFIG_UUID_BACKDOOR)
return;
// check if backdoor port exists
@@ -506,6 +506,9 @@
void
smbios_init(void)
{
+ if (! CONFIG_SMBIOS)
+ return;
+
unsigned cpu_num, nr_structs = 0, max_struct_size = 0;
char *start, *p, *q;
int memsize = GET_EBDA(ram_size) / (1024 * 1024);