qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/2] bochs-bios: Make boot prompt optional
@ 2009-07-01 22:11 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2009-07-01 22:11 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: bochs developers, qemu-devel

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

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 |    1 +
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/bios/rombios.c b/bios/rombios.c
index 0f13b53..560e6d5 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_MENU);
+  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 59ce19d..8ece2ee 100644
--- a/bios/rombios.h
+++ b/bios/rombios.h
@@ -64,6 +64,7 @@
 #define QEMU_CFG_ID               0x01
 #define QEMU_CFG_UUID             0x02
 #define QEMU_CFG_NUMA             0x0d
+#define QEMU_CFG_BOOT_MENU        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)


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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-01 22:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 22:11 [Qemu-devel] [PATCH 2/2] bochs-bios: Make boot prompt optional Jan Kiszka

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).