]> xenbits.xensource.com Git - xen.git/commitdiff
tools: support SeaBIOS. Use by default when upstream qemu is configured.
authorIan Campbell <ian.campbell@citrix.com>
Wed, 20 Apr 2011 16:13:06 +0000 (17:13 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 20 Apr 2011 16:13:06 +0000 (17:13 +0100)
The SeaBIOS integration here is only semi-complete and is targetted at
developers and very early adopters who can be expected to cope with
some rough edges. In particular the user must clone, patch as
necessary and compile SeaBIOS themselves since this patchset does not
cover any of that (in the same way we currently do not integrate
upstream qemu clone+build). Include a big comment to that effect next
to the Config.mk option.

Many of the bios_config callback functions are not yet used by
SeaBIOS.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Config.mk
tools/firmware/hvmloader/Makefile
tools/firmware/hvmloader/config-seabios.h [new file with mode: 0644]
tools/firmware/hvmloader/config.h
tools/firmware/hvmloader/hvmloader.c
tools/firmware/hvmloader/seabios.c [new file with mode: 0644]
tools/libxl/libxl_dm.c

index 0693b34c825df86ec2fabceca5c63b261925d6eb..97b8d5b23d1c5342724dead8f570fbb0e60b8903 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -184,6 +184,18 @@ QEMU_TAG := xen-4.1.0-rc6
 # Fri Feb 11 17:54:51 2011 +0000
 # qemu-xen: fix segfault with empty cdroms
 
+# Short answer -- do not enable this unless you know what you are
+# doing and are prepared for some pain.
+
+# SeaBIOS integration is a work in progress. Before enabling this
+# option you must clone git://git.qemu.org/seabios.git/, possibly add
+# some development patches and then build it yourself before pointing
+# this variable to it (using an absolute path).
+#
+# Note that using SeaBIOS requires the use the upstream qemu as the
+# device model.
+SEABIOS_DIR ?= 
+
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
index 9f121a469fd3b7e4a4116c3a48baf14af9f24458..b32954c79da18664c8f8e8a7984f953d3d903967 100644 (file)
@@ -40,9 +40,16 @@ CIRRUSVGA_DEBUG ?= n
 ROMBIOS_DIR := ../rombios
 ifneq ($(ROMBIOS_DIR),)
 OBJS += rombios.o
+CFLAGS += -DENABLE_ROMBIOS
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
 endif
 
+ifneq ($(SEABIOS_DIR),)
+OBJS += seabios.o
+CFLAGS += -DENABLE_SEABIOS
+SEABIOS_ROM := $(SEABIOS_DIR)/out/bios.bin
+endif
+
 STDVGA_ROM    := ../vgabios/VGABIOS-lgpl-latest.bin
 ifeq ($(CIRRUSVGA_DEBUG),y)
 CIRRUSVGA_ROM := ../vgabios/VGABIOS-lgpl-latest.cirrus.debug.bin
@@ -54,7 +61,7 @@ endif
 all: subdirs-all
        $(MAKE) hvmloader
 
-rombios.o hvmloader.o: roms.inc
+rombios.o seabios.o hvmloader.o: roms.inc
 smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""
 
 hvmloader: $(OBJS) acpi/acpi.a
@@ -62,7 +69,7 @@ hvmloader: $(OBJS) acpi/acpi.a
        $(OBJCOPY) hvmloader.tmp hvmloader
        rm -f hvmloader.tmp
 
-roms.inc: $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM) ../etherboot/eb-roms.h
+roms.inc: $(ROMBIOS_ROM) $(SEABIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM) ../etherboot/eb-roms.h
        echo "/* Autogenerated file. DO NOT EDIT */" > $@.new
 
 ifneq ($(ROMBIOS_ROM),)
@@ -71,6 +78,12 @@ ifneq ($(ROMBIOS_ROM),)
        echo "#endif" >> $@.new
 endif
 
+ifneq ($(SEABIOS_ROM),)
+       echo "#ifdef ROM_INCLUDE_SEABIOS" >> $@.new
+       sh ./mkhex seabios $(SEABIOS_ROM) >> $@.new
+       echo "#endif" >> $@.new
+endif
+
 ifneq ($(STDVGA_ROM),)
        echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
        sh ./mkhex vgabios_stdvga $(STDVGA_ROM) >> $@.new
diff --git a/tools/firmware/hvmloader/config-seabios.h b/tools/firmware/hvmloader/config-seabios.h
new file mode 100644 (file)
index 0000000..864e4e8
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __HVMLOADER_CONFIG_SEABIOS_H__
+#define __HVMLOADER_CONFIG_SEABIOS_H__
+
+#define OPTIONROM_PHYSICAL_ADDRESS  0x000C8000
+#define OPTIONROM_PHYSICAL_END      0x000E0000
+
+#define SEABIOS_PHYSICAL_ADDRESS    0x000E0000
+
+#endif /* __HVMLOADER_CONFIG_SEABIOS_H__ */
index 296d500af034c13a131e6cbbf52105ab35e0003c..8599adae1a425fa593246dd73d39c9e2db114f62 100644 (file)
@@ -40,6 +40,7 @@ struct bios_config {
 };
 
 extern struct bios_config rombios_config;
+extern struct bios_config seabios_config;
 
 #define PAGE_SHIFT 12
 #define PAGE_SIZE  (1ul << PAGE_SHIFT)
index 855087499d20c1757fa69a72be26fb0d7c5586f8..6964f5084d61c3edeead433f5cfa8b468104d160 100644 (file)
@@ -341,7 +341,12 @@ struct bios_info {
     const char *key;
     const struct bios_config *bios;
 } bios_configs[] = {
+#ifdef ENABLE_ROMBIOS
     { "rombios", &rombios_config, },
+#endif
+#ifdef ENABLE_SEABIOS
+    { "seabios", &seabios_config, },
+#endif
     { NULL, NULL }
 };
 
diff --git a/tools/firmware/hvmloader/seabios.c b/tools/firmware/hvmloader/seabios.c
new file mode 100644 (file)
index 0000000..534b421
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * HVM SeaBIOS support.
+ *
+ * Leendert van Doorn, leendert@watson.ibm.com
+ * Copyright (c) 2005, International Business Machines Corporation.
+ * Copyright (c) 2006, Keir Fraser, XenSource Inc.
+ * Copyright (c) 2011, Citrix Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ */
+
+#include "config.h"
+#include "config-seabios.h"
+
+#include "util.h"
+
+#define ROM_INCLUDE_SEABIOS
+#include "roms.inc"
+
+static void seabios_pci_setup(void)
+{
+    virtual_vga = VGA_cirrus;
+}
+
+//BUILD_BUG_ON(sizeof(seabios) > (0x00100000U - SEABIOS_PHYSICAL_ADDRESS));
+
+struct bios_config seabios_config = {
+       .name = "SeaBIOS",
+
+    .image = seabios,
+    .image_size = sizeof(seabios),
+
+    .bios_address = SEABIOS_PHYSICAL_ADDRESS,
+
+    .smbios_start = 0,
+    .smbios_end = 0,
+
+    .optionrom_start = OPTIONROM_PHYSICAL_ADDRESS,
+    .optionrom_end = OPTIONROM_PHYSICAL_END,
+
+    .acpi_start = 0,
+
+    .bios_info_setup = NULL,
+
+    .apic_setup = NULL,
+    .pci_setup = seabios_pci_setup,
+    .smp_setup = NULL,
+
+    .vm86_setup = NULL,
+    .e820_setup = NULL,
+
+    .acpi_build_tables = NULL,
+    .create_mp_tables = NULL,
+};
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
index b24fd0383ce7b75ec4ce09a7a2c4002b7ad3f755..5e80bbd1e1d031986b0451225dc5a47e225bff79 100644 (file)
@@ -65,7 +65,6 @@ const char *libxl__domain_device_model(libxl__gc *gc,
             break;
         }
     }
-
     return dm;
 }
 
@@ -74,7 +73,7 @@ static char *libxl__domain_bios(libxl__gc *gc,
 {
     switch (info->device_model_version) {
     case 1: return libxl__strdup(gc, "rombios");
-    case 2: return libxl__strdup(gc, "rombios");
+    case 2: return libxl__strdup(gc, "seabios");
     default:return NULL;
     }
 }