From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 19 of 19] tools: support SeaBIOS. Use by default when upstream qemu is configured
Date: Tue, 12 Apr 2011 12:29:18 +0100 [thread overview]
Message-ID: <5caa03e080fc311891df.1302607758@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1302607739@localhost.localdomain>
# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1302607447 -3600
# Node ID 5caa03e080fc311891df6516caf4747f6557a749
# Parent deeb1b89d8fd0dbdd3929ed203ce8dd9c2cf50db
tools: support SeaBIOS. Use by default when upstream qemu is configured.
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>
diff -r deeb1b89d8fd -r 5caa03e080fc Config.mk
--- a/Config.mk Tue Apr 12 12:23:23 2011 +0100
+++ b/Config.mk Tue Apr 12 12:24:07 2011 +0100
@@ -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
diff -r deeb1b89d8fd -r 5caa03e080fc tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile Tue Apr 12 12:23:23 2011 +0100
+++ b/tools/firmware/hvmloader/Makefile Tue Apr 12 12:24:07 2011 +0100
@@ -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
@@ -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 */" > roms.inc
ifneq ($(ROMBIOS_ROM),)
@@ -71,6 +78,12 @@ ifneq ($(ROMBIOS_ROM),)
echo "#endif" >> roms.inc
endif
+ifneq ($(SEABIOS_ROM),)
+ echo "#ifdef ROM_INCLUDE_SEABIOS" >> roms.inc
+ sh ./mkhex seabios $(SEABIOS_ROM) >> roms.inc
+ echo "#endif" >> roms.inc
+endif
+
ifneq ($(STDVGA_ROM),)
echo "#ifdef ROM_INCLUDE_VGABIOS" >> roms.inc
sh ./mkhex vgabios_stdvga $(STDVGA_ROM) >> roms.inc
diff -r deeb1b89d8fd -r 5caa03e080fc tools/firmware/hvmloader/config-seabios.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/hvmloader/config-seabios.h Tue Apr 12 12:24:07 2011 +0100
@@ -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__ */
diff -r deeb1b89d8fd -r 5caa03e080fc tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Tue Apr 12 12:23:23 2011 +0100
+++ b/tools/firmware/hvmloader/config.h Tue Apr 12 12:24:07 2011 +0100
@@ -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)
diff -r deeb1b89d8fd -r 5caa03e080fc tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c Tue Apr 12 12:23:23 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c Tue Apr 12 12:24:07 2011 +0100
@@ -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 -r deeb1b89d8fd -r 5caa03e080fc tools/firmware/hvmloader/seabios.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/hvmloader/seabios.c Tue Apr 12 12:24:07 2011 +0100
@@ -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:
+ */
diff -r deeb1b89d8fd -r 5caa03e080fc tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Tue Apr 12 12:23:23 2011 +0100
+++ b/tools/libxl/libxl_dm.c Tue Apr 12 12:24:07 2011 +0100
@@ -62,7 +62,6 @@ const char *libxl__domain_device_model(l
break;
}
}
-
return dm;
}
@@ -71,7 +70,7 @@ static char *libxl__domain_bios(libxl__g
{
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;
}
}
prev parent reply other threads:[~2011-04-12 11:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 11:28 [PATCH 00 of 19] tools: SeaBIOS integration Ian Campbell
2011-04-12 11:29 ` [PATCH 01 of 19] tools: hvmloader: move ROMBIOS configuration into tools/firmware/rombios/ Ian Campbell
2011-04-12 11:29 ` [PATCH 02 of 19] tools: hvmloader: split e820 support into its own code module Ian Campbell
2011-04-12 11:29 ` [PATCH 03 of 19] tools: hvmloader: pass ACPI_PHYSICAL_ADDRESS as a runtime parameter Ian Campbell
2011-04-12 11:29 ` [PATCH 04 of 19] tools: hvmloader: pass SMBIOS location " Ian Campbell
2011-04-12 11:29 ` [PATCH 05 of 19] tools: hvmloader: pass option ROM end address around as a parameter Ian Campbell
2011-04-12 11:29 ` [PATCH 06 of 19] tools: hvmloader: split scratch and hypercall addressing from ROMBIOS low heap Ian Campbell
2011-04-12 11:29 ` [PATCH 07 of 19] tools: hvmloader: refactor Makefile to move ROM filenames into variables Ian Campbell
2011-04-12 11:29 ` [PATCH 08 of 19] tools: hvmloader: remove rombios_sz, just use sizeof(rombios) Ian Campbell
2011-04-12 11:29 ` [PATCH 09 of 19] tools: hvmloader: rename roms.h to roms.inc Ian Campbell
2011-04-12 11:29 ` [PATCH 10 of 19] tools: hvmloader: Define $(OBJS) directly instead of via $(SRCS) Ian Campbell
2011-04-12 11:29 ` [PATCH 11 of 19] tools: hvmloader: add bios_config data structure Ian Campbell
2011-04-12 11:29 ` [PATCH 12 of 19] tools: hvmloader: Refactor APIC, PCI and SMP setup into struct bios_config Ian Campbell
2011-04-12 11:29 ` [PATCH 13 of 19] tools: hvmloader: refactor highbios and bios_info " Ian Campbell
2011-04-12 11:29 ` [PATCH 14 of 19] tools: hvmloader: Refactor VM86 and E820 " Ian Campbell
2011-04-12 11:29 ` [PATCH 15 of 19] tools: hvmloader: Refactor ACPI table " Ian Campbell
2011-04-12 11:29 ` [PATCH 16 of 19] tools: hvmloader: Refactor MP " Ian Campbell
2011-04-12 11:29 ` [PATCH 17 of 19] tools: libxl: hide selection of device-model, hvmloader and BIOS by default Ian Campbell
2011-04-14 18:09 ` Ian Jackson
2011-04-15 7:53 ` Ian Campbell
2011-04-12 11:29 ` [PATCH 18 of 19] tools: hvmloader: select BIOS through xenstore Ian Campbell
2011-04-12 11:29 ` Ian Campbell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5caa03e080fc311891df.1302607758@localhost.localdomain \
--to=ian.campbell@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).