qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: bochs developers <bochs-developers@lists.sourceforge.net>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [RESEND][PATCH 2/2] qemu: bios: Make boot prompt optional
Date: Sat, 27 Jun 2009 10:11:29 +0200	[thread overview]
Message-ID: <4A45D431.80006@web.de> (raw)

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

[ Note: Applies on top of qemu's current patch series. ]

Check via QEMU's firmware configuration interface if the boot prompt
should be given. This allows to disable the prompt with its several
seconds long delay, speeding up the common boot case.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 bios/rombios.c   |   19 +++++++++++++++++++
 bios/rombios.h   |   11 +++++++++++
 bios/rombios32.c |   10 ----------
 3 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/bios/rombios.c b/bios/rombios.c
index 0f13b53..3b7a5f0 100644
--- a/bios/rombios.c
+++ b/bios/rombios.c
@@ -2015,6 +2015,21 @@ Bit16u i; ipl_entry_t *e;
 }
 
 #if BX_ELTORITO_BOOT
+#ifdef BX_QEMU
+int
+qemu_cfg_probe_bootkey()
+{
+  outw(QEMU_CFG_CTL_PORT, QEMU_CFG_SIGNATURE);
+  if (inb(QEMU_CFG_DATA_PORT) != 'Q' ||
+      inb(QEMU_CFG_DATA_PORT) != 'E' ||
+      inb(QEMU_CFG_DATA_PORT) != 'M' ||
+      inb(QEMU_CFG_DATA_PORT) != 'U') return 1;
+
+  outw(QEMU_CFG_CTL_PORT, QEMU_CFG_BOOT_INTERACTIVE);
+  return inb(QEMU_CFG_DATA_PORT);
+}
+#endif // BX_QEMU
+
   void
 interactive_bootkey()
 {
@@ -2026,6 +2041,10 @@ interactive_bootkey()
   Bit16u ss = get_SS();
   Bit16u valid_choice = 0;
 
+#ifdef BX_QEMU
+  if (!qemu_cfg_probe_bootkey()) return;
+#endif
+
   while (check_for_keystroke())
     get_keystroke();
 
diff --git a/bios/rombios.h b/bios/rombios.h
index 6f9cbb1..038b4a0 100644
--- a/bios/rombios.h
+++ b/bios/rombios.h
@@ -58,6 +58,17 @@
 #define SMB_IO_BASE       0xb100
 #define SMP_MSR_ADDR      0x0510
 
+#define QEMU_CFG_CTL_PORT         0x510
+#define QEMU_CFG_DATA_PORT        0x511
+#define QEMU_CFG_SIGNATURE        0x00
+#define QEMU_CFG_ID               0x01
+#define QEMU_CFG_UUID             0x02
+#define QEMU_CFG_NUMA             0x0d
+#define QEMU_CFG_BOOT_INTERACTIVE 0x0e
+#define QEMU_CFG_ARCH_LOCAL       0x8000
+#define QEMU_CFG_ACPI_TABLES      (QEMU_CFG_ARCH_LOCAL + 0)
+#define QEMU_CFG_SMBIOS_ENTRIES   (QEMU_CFG_ARCH_LOCAL + 1)
+
   // Define the application NAME
 #if defined(BX_QEMU)
 #  define BX_APPNAME "QEMU"
diff --git a/bios/rombios32.c b/bios/rombios32.c
index f861f81..3fe4e48 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -468,16 +468,6 @@ void wrmsr_smp(uint32_t index, uint64_t val)
 }
 
 #ifdef BX_QEMU
-#define QEMU_CFG_CTL_PORT 0x510
-#define QEMU_CFG_DATA_PORT 0x511
-#define QEMU_CFG_SIGNATURE  0x00
-#define QEMU_CFG_ID         0x01
-#define QEMU_CFG_UUID       0x02
-#define QEMU_CFG_NUMA       0x0D
-#define QEMU_CFG_ARCH_LOCAL     0x8000
-#define QEMU_CFG_ACPI_TABLES  (QEMU_CFG_ARCH_LOCAL + 0)
-#define QEMU_CFG_SMBIOS_ENTRIES  (QEMU_CFG_ARCH_LOCAL + 1)
-
 int qemu_cfg_port;
 
 void qemu_cfg_select(int f)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

             reply	other threads:[~2009-06-27  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-27  8:11 Jan Kiszka [this message]
2009-06-28 20:01 ` [Qemu-devel] Re: [Bochs-developers] [RESEND][PATCH 2/2] qemu: bios: Make boot promptoptional Sebastian Herbszt

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=4A45D431.80006@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=bochs-developers@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.org \
    /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).