This patch adds configuration for DMI configuration data. This is useful if you want to run SeaBIOS on real Hardware, and the OS selects drivers based on hw manufacturer/model.
Signed-off-by: Sven Schnelle svens@stackframe.org --- src/Kconfig | 26 ++++++++++++++++++++++++++ src/config.h | 1 - src/smbios.c | 15 +++++++-------- 3 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig index 6d55b23..db88e22 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -368,3 +368,29 @@ menu "Debugging" Send characters that SeaBIOS writes to the screen to the debug ports. endmenu + +menu "DMI data" + config DMI_BIOS_VENDOR + string "BIOS Vendor" + default "Bochs" + + config DMI_BIOS_VERSION + string "BIOS Version" + default "1.0" + + config DMI_BIOS_RELEASE_DATE + string "BIOS release date" + default "01/01/2007" + + config DMI_MANUFACTURER + string "Hardware Manufacturer" + default "Unknown" + + config DMI_PRODUCT_NAME + string "Hardware Product name" + default "Unknown" + + config DMI_PROCESSOR_VENDOR + string "Processor vendor" + default "Unknown" +endmenu diff --git a/src/config.h b/src/config.h index 5b40488..5249d0f 100644 --- a/src/config.h +++ b/src/config.h @@ -9,7 +9,6 @@ //#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" diff --git a/src/smbios.c b/src/smbios.c index 8df0f2d..df3b687 100644 --- a/src/smbios.c +++ b/src/smbios.c @@ -84,7 +84,6 @@ smbios_entry_point_init(u16 max_structure_size, } while (0)
/* Type 0 -- BIOS Information */ -#define RELEASE_DATE_STR "01/01/2007" static void * smbios_init_type_0(void *start) { @@ -97,12 +96,12 @@ smbios_init_type_0(void *start) p->header.length = sizeof(struct smbios_type_0); p->header.handle = 0;
- load_str_field_with_default(0, vendor_str, CONFIG_APPNAME); - load_str_field_with_default(0, bios_version_str, CONFIG_APPNAME); + load_str_field_with_default(0, vendor_str, CONFIG_DMI_BIOS_VENDOR); + load_str_field_with_default(0, bios_version_str, CONFIG_DMI_BIOS_VERSION);
p->bios_starting_address_segment = 0xe800;
- load_str_field_with_default(0, bios_release_date_str, RELEASE_DATE_STR); + load_str_field_with_default(0, bios_release_date_str, CONFIG_DMI_BIOS_RELEASE_DATE);
p->bios_rom_size = 0; /* FIXME */
@@ -146,8 +145,8 @@ smbios_init_type_1(void *start) p->header.length = sizeof(struct smbios_type_1); p->header.handle = 0x100;
- load_str_field_with_default(1, manufacturer_str, CONFIG_APPNAME); - load_str_field_with_default(1, product_name_str, CONFIG_APPNAME); + load_str_field_with_default(1, manufacturer_str, CONFIG_DMI_MANUFACTURER); + load_str_field_with_default(1, product_name_str, CONFIG_DMI_PRODUCT_NAME); load_str_field_or_skip(1, version_str); load_str_field_or_skip(1, serial_number_str);
@@ -184,7 +183,7 @@ smbios_init_type_3(void *start) p->header.length = sizeof(struct smbios_type_3); p->header.handle = 0x300;
- load_str_field_with_default(3, manufacturer_str, CONFIG_APPNAME); + load_str_field_with_default(3, manufacturer_str, CONFIG_DMI_MANUFACTURER); set_field_with_default(3, type, 0x01); /* other */
load_str_field_or_skip(3, version_str); @@ -240,7 +239,7 @@ smbios_init_type_4(void *start, unsigned int cpu_number) set_field_with_default(4, processor_type, 0x03); /* CPU */ set_field_with_default(4, processor_family, 0x01); /* other */
- load_str_field_with_default(4, processor_manufacturer_str, CONFIG_APPNAME); + load_str_field_with_default(4, processor_manufacturer_str, CONFIG_DMI_PROCESSOR_VENDOR);
if (!qemu_cfg_smbios_load_field(4, offsetof(struct smbios_type_4, processor_id), p->processor_id)) {