All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: marc.mari.barcelo@gmail.com, Paolo Bonzini <pbonzini@redhat.com>,
	Kevin O'Connor <kevin@koconnor.net>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [Qemu-devel] Why is SeaBIOS used with -kernel?
Date: Fri, 1 Apr 2016 12:11:39 +0100	[thread overview]
Message-ID: <20160401111139.GK32728@redhat.com> (raw)
In-Reply-To: <1459508875.7011.62.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1807 bytes --]

On Fri, Apr 01, 2016 at 01:07:55PM +0200, Gerd Hoffmann wrote:
> On Fr, 2016-04-01 at 11:17 +0100, Richard W.M. Jones wrote:
> > On Fri, Apr 01, 2016 at 11:18:30AM +0200, Gerd Hoffmann wrote:
> > >   Hi,
> > > 
> > > > I wonder how we can make use of this in qemu and downstream distros?
> > > > Can we have a bios-min.bin which is used with -kernel boots?
> > > 
> > > We already build two seabios roms: one full featued and one slightly
> > > stripped down to keep it below 128k, for backward compatibility with old
> > > machine types.
> > > 
> > > Adding a third config for -kernel boot should be easy.  For that use
> > > case we can probably also turn on seabios logging to the serial console
> > > and drop sgabios.  We don't need input (no boot menu) and we also don't
> > > need to hook into int10 (no grub/ipxe using that for output).
> > 
> > SeaBIOS logging is slow (or more likely, serial output is slow).
> > And sgabios is useful for debugging.
> 
> Ah, I see.  debuglevel=1 prints too much and debuglevel=0 has no logging
> at all.  We'd need seabios log at least the version banner to serial
> even with debuglevel=0 to replace sgabios.
> 
> https://www.kraxel.org/cgit/qemu/log/?h=work/stripped-seabios
> 
> Not hooked into -kernel yet, so you have to use "-bios bios-kboot.bin".
> 
> Comments?

I think we were working on the same thing ...  Attached is my
version.

Note that you must enable at least CONFIG_MPTABLE else virtio-scsi
does not work in the guest.  I also enabled ACPI & SMBIOS & PIRTABLE.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org

[-- Attachment #2: 0001-bios-Add-fast-variant-of-SeaBIOS-for-use-with-kernel.patch --]
[-- Type: text/plain, Size: 2625 bytes --]

>From 2c9b45d9d03c05573e1dbfc35e6750b127896be6 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@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 <rjones@redhat.com>
---
 Makefile                 |  3 ++-
 roms/Makefile            |  4 +++-
 roms/config.seabios-fast | 12 ++++++++++++
 3 files changed, 17 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..98a4c27
--- /dev/null
+++ b/roms/config.seabios-fast
@@ -0,0 +1,12 @@
+# The most fastest SeaBIOS that can boot Linux using -kernel.
+CONFIG_USB=n
+CONFIG_DRIVES=n
+CONFIG_KEYBOARD=n
+CONFIG_MOUSE=n
+CONFIG_WRITABLE_UPPERMEMORY=y
+CONFIG_TCGBIOS=n
+CONFIG_PIRTABLE=y
+CONFIG_MPTABLE=y
+CONFIG_SMBIOS=y
+CONFIG_ACPI=y
+CONFIG_DEBUG_LEVEL=0
-- 
2.7.4


  reply	other threads:[~2016-04-01 11:11 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19 20:31 [Qemu-devel] Why is SeaBIOS used with -kernel? Richard W.M. Jones
2016-03-21  7:58 ` Gerd Hoffmann
2016-03-21  8:37   ` Richard W.M. Jones
2016-03-21  9:40     ` Gerd Hoffmann
2016-03-31  9:21 ` Stefan Hajnoczi
2016-03-31 16:22   ` Kevin O'Connor
     [not found]     ` <20160331221039.GA32728@redhat.com>
2016-03-31 22:17       ` Richard W.M. Jones
2016-03-31 22:44         ` Kevin O'Connor
2016-04-01  7:55           ` Richard W.M. Jones
2016-04-01  8:03             ` Paolo Bonzini
2016-04-01  8:47               ` Richard W.M. Jones
2016-04-01  8:51                 ` Paolo Bonzini
2016-04-01  8:57                   ` Richard W.M. Jones
2016-04-01  9:05                     ` Paolo Bonzini
2016-04-01  8:02           ` Richard W.M. Jones
2016-04-01  8:11             ` Paolo Bonzini
2016-04-01  8:14               ` Richard W.M. Jones
2016-04-01  8:24                 ` Paolo Bonzini
2016-04-01  8:44                   ` Richard W.M. Jones
2016-04-01  8:47                     ` Paolo Bonzini
2016-04-01  8:49                       ` Vasiliy Tolstov
2016-04-01  9:16                     ` Dr. David Alan Gilbert
2016-04-01  9:18                     ` Gerd Hoffmann
2016-04-01 10:17                       ` Richard W.M. Jones
2016-04-01 11:07                         ` Gerd Hoffmann
2016-04-01 11:11                           ` Richard W.M. Jones [this message]
2016-04-01 11:20                             ` Richard W.M. Jones
2016-04-01 11:21                               ` Paolo Bonzini
2016-04-01 11:26                                 ` Richard W.M. Jones
2016-04-05  4:38                               ` Kevin Wolf
2016-04-05  8:04                                 ` Richard W.M. Jones
2016-04-05  8:11                                   ` Kevin Wolf
2016-04-05  9:19                                     ` Richard W.M. Jones
2016-04-05  9:26                                       ` Kevin Wolf
2016-04-01 11:32                             ` Gerd Hoffmann
2016-04-01 11:49                               ` Richard W.M. Jones
2016-04-01 15:35                                 ` Kevin O'Connor
2016-04-01 16:03                                   ` Paolo Bonzini
2016-04-01 18:41                                   ` Richard W.M. Jones
2016-04-01 18:59                                     ` Richard W.M. Jones
2016-04-01 19:04                                       ` Kevin O'Connor
2016-04-01 19:10                                         ` Richard W.M. Jones
2016-04-01 19:15                                           ` Richard W.M. Jones
2016-04-01 19:44                                             ` Kevin O'Connor
2016-04-01 20:25                                               ` Richard W.M. Jones
2016-04-01 20:05                                     ` Kevin O'Connor
2016-04-01 20:46                                       ` Richard W.M. Jones
2016-04-01 22:25                                         ` Kevin O'Connor
2016-04-02  7:51                                           ` Richard W.M. Jones
2016-04-02  5:30                                       ` Paolo Bonzini
2016-04-01 15:08                           ` Kevin O'Connor
2016-04-01 14:58                     ` Kevin O'Connor
2016-04-01 15:06                       ` Richard W.M. Jones
2016-04-01 15:14                         ` Kevin O'Connor
2016-04-01  8:19               ` Richard W.M. Jones

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=20160401111139.GK32728@redhat.com \
    --to=rjones@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kraxel@redhat.com \
    --cc=marc.mari.barcelo@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.