From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lvww8-0003Qs-M6 for qemu-devel@nongnu.org; Mon, 20 Apr 2009 13:05:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lvww4-0003PC-3Z for qemu-devel@nongnu.org; Mon, 20 Apr 2009 13:05:40 -0400 Received: from [199.232.76.173] (port=57770 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lvww3-0003P1-S0 for qemu-devel@nongnu.org; Mon, 20 Apr 2009 13:05:35 -0400 Received: from lizzard.sbs.de ([194.138.37.39]:19940) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lvww3-00044u-2W for qemu-devel@nongnu.org; Mon, 20 Apr 2009 13:05:35 -0400 Message-ID: <49ECAB4F.9010509@siemens.com> Date: Mon, 20 Apr 2009 19:05:19 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 2/2] qemu: bios: Make boot prompt optional Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: bochs developers [ 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 --- bios/rombios.c | 19 +++++++++++++++++++ bios/rombios.h | 10 ++++++++++ bios/rombios32.c | 9 --------- 3 files changed, 29 insertions(+), 9 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..f02303c 100644 --- a/bios/rombios.h +++ b/bios/rombios.h @@ -58,6 +58,16 @@ #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_BOOT_INTERACTIVE 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) + // Define the application NAME #if defined(BX_QEMU) # define BX_APPNAME "QEMU" diff --git a/bios/rombios32.c b/bios/rombios32.c index 49dfd62..17dcb11 100644 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -463,15 +463,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_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)