My patch, plus the configuration and comments from your patch,
combined.  Plus I tested it with libguestfs boot-analysis and it works
and is still fast.

Integrating this so it happens automatically when the user adds
-kernel on x86 seems quite complicated.  The only way I could do it
was by adding #ifdef defined(__x86_64__) etc to vl.c, which doesn't
seem very nice.  The problem is the machine type code doesn't know
that you're using -kernel.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
>From 28a442fdf8036bde075c75088f8dae8d8568243a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjo...@redhat.com>
Date: Fri, 1 Apr 2016 11:35:09 +0100
Subject: [PATCH] bios: Add fast variant of SeaBIOS for use with -kernel on
 x86.

This commit adds a fast variant of SeaBIOS called 'bios-fast.bin'.

It's designed to be the fastest (also the smallest, but that's not the
main aim) SeaBIOS that is just enough to boot a Linux kernel using the
-kernel option on i686 and x86_64.

This commit does not modify the -kernel option to use this.  You have
to specify it by doing something like this:

  -kernel vmlinuz -bios bios-fast.bin

Signed-off-by: Richard W.M. Jones <rjo...@redhat.com>
---
 Makefile                 |  3 ++-
 roms/Makefile            |  4 +++-
 roms/config.seabios-fast | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 roms/config.seabios-fast

diff --git a/Makefile b/Makefile
index 1d076a9..c4e939d 100644
--- a/Makefile
+++ b/Makefile
@@ -389,7 +389,8 @@ common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      
pt  sl     tr \
 bepo    cz
 
 ifdef INSTALL_BLOBS
-BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
+BLOBS=bios.bin bios-256k.bin bios-fast.bin \
+sgabios.bin vgabios.bin vgabios-cirrus.bin \
 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin \
 acpi-dsdt.aml \
 ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin 
QEMU,cgthree.bin \
diff --git a/roms/Makefile b/roms/Makefile
index 7bd1252..26b0586 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -61,9 +61,11 @@ default:
        @echo "  slof           -- update slof.bin"
        @echo "  u-boot.e500    -- update u-boot.e500"
 
-bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
+bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k \
+      build-seabios-config-seabios-fast
        cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
        cp seabios/builds/seabios-256k/bios.bin ../pc-bios/bios-256k.bin
+       cp seabios/builds/seabios-fast/bios.bin ../pc-bios/bios-fast.bin
 
 seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
 
diff --git a/roms/config.seabios-fast b/roms/config.seabios-fast
new file mode 100644
index 0000000..fbb1ef8
--- /dev/null
+++ b/roms/config.seabios-fast
@@ -0,0 +1,32 @@
+# The fastest SeaBIOS that can boot Linux using -kernel.
+
+# general stuff
+CONFIG_QEMU=y
+CONFIG_ROM_SIZE=128
+CONFIG_XEN=n
+CONFIG_THREADS=n
+CONFIG_WRITABLE_UPPERMEMORY=y
+
+# no input, no boot menu
+CONFIG_MOUSE=n
+CONFIG_KEYBOARD=n
+CONFIG_BOOTMENU=n
+CONFIG_BOOTSPLASH=n
+
+# hardware support we don't need
+CONFIG_LPT=n
+CONFIG_SERIAL=n
+CONFIG_USB=n
+CONFIG_DRIVES=n
+CONFIG_TCGBIOS=n
+CONFIG_VGAHOOKS=n
+
+# MPTABLE is required by Linux kernel, the others add only a
+# couple of milliseconds so we might as well have them
+CONFIG_PIRTABLE=y
+CONFIG_MPTABLE=y
+CONFIG_SMBIOS=y
+CONFIG_ACPI=y
+
+# no logging
+CONFIG_DEBUG_LEVEL=0
-- 
2.7.4

Reply via email to