]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[romprefix] Allow ROM banner timeout to be configured independently
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Feb 2014 23:33:08 +0000 (16:33 -0700)
committerMichael Brown <mcb30@ipxe.org>
Mon, 3 Mar 2014 13:09:25 +0000 (13:09 +0000)
iPXE currently prints a "Press Ctrl-B" banner twice: once when the ROM
is first called for initialisation and again if we attempt to boot
from the ROM.  This slows boot, especially when the NIC is not the
primary boot device.  Tools such as libguestfs make use of QEMU VMs
for performing maintenance on disk images and may make use of NICs in
the VM for network support.  If iPXE introduces a static init-time
delay, that directly translates to increased runtime for the tools.

Fix by allowing the ROM banner timeout to be configured independently
of the main banner timeout.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/prefix/romprefix.S
src/config/general.h

index 091673d3c885e9301b0ab47baa438f5b47e1d39e..e061932d763138f83ccaa8eaec46bf6228428573 100644 (file)
@@ -25,12 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
        ( PMM_HANDLE_BASE | 0x00002000 )
 #define PCI_FUNC_MASK 0x07
 
-/* ROM banner timeout.  Based on the configurable BANNER_TIMEOUT in
- * config.h, but converted to a number of (18Hz) timer ticks, and
- * doubled to allow for BIOSes that switch video modes immediately
- * beforehand, so rendering the message almost invisible to the user.
- */
-#define ROM_BANNER_TIMEOUT ( 2 * ( 18 * BANNER_TIMEOUT ) / 10 )
+/* ROM banner timeout, converted to a number of (18Hz) timer ticks. */
+#define ROM_BANNER_TIMEOUT_TICKS ( ( 18 * ROM_BANNER_TIMEOUT ) / 10 )
 
 /* Allow payload to be excluded from ROM size
  */
@@ -791,7 +787,7 @@ wait_for_key:
        int     $0x16
        jmp     1b
 2:     /* Wait for a key press */
-       movw    $ROM_BANNER_TIMEOUT, %cx
+       movw    $ROM_BANNER_TIMEOUT_TICKS, %cx
 3:     decw    %cx
        js      99f             /* Exit with ZF clear */
        /* Wait for timer tick to be updated */
index a714a0af24edf731d81d16ca9cbd63119df38d67..589798fb20841b3cf39339d159c073d313fd3828 100644 (file)
@@ -28,11 +28,22 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #define PRODUCT_SHORT_NAME "iPXE"
 
 /*
- * Timer configuration
- *
+ * Banner timeout configuration
+ *
+ * This controls the timeout for the "Press Ctrl-B for the iPXE
+ * command line" banner displayed when iPXE starts up.  The value is
+ * specified in tenths of a second for which the banner should appear.
+ * A value of 0 disables the banner.
+ *
+ * ROM_BANNER_TIMEOUT controls the "Press Ctrl-B to configure iPXE"
+ * banner displayed only by ROM builds of iPXE during POST.  This
+ * defaults to being twice the length of BANNER_TIMEOUT, to allow for
+ * BIOSes that switch video modes immediately before calling the
+ * initialisation vector, thus rendering the banner almost invisible
+ * to the user.
  */
-#define BANNER_TIMEOUT 20      /* Tenths of a second for which the shell
-                                  banner should appear */
+#define BANNER_TIMEOUT         20
+#define ROM_BANNER_TIMEOUT     ( 2 * BANNER_TIMEOUT )
 
 /*
  * Network protocols