Browse Source

[romprefix] Allow ROM banner timeout to be configured independently

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>
tags/v1.20.1
Alex Williamson 10 years ago
parent
commit
27d1b40ee9
2 changed files with 18 additions and 11 deletions
  1. 3
    7
      src/arch/i386/prefix/romprefix.S
  2. 15
    4
      src/config/general.h

+ 3
- 7
src/arch/i386/prefix/romprefix.S View File

@@ -25,12 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
25 25
 	( PMM_HANDLE_BASE | 0x00002000 )
26 26
 #define PCI_FUNC_MASK 0x07
27 27
 
28
-/* ROM banner timeout.  Based on the configurable BANNER_TIMEOUT in
29
- * config.h, but converted to a number of (18Hz) timer ticks, and
30
- * doubled to allow for BIOSes that switch video modes immediately
31
- * beforehand, so rendering the message almost invisible to the user.
32
- */
33
-#define ROM_BANNER_TIMEOUT ( 2 * ( 18 * BANNER_TIMEOUT ) / 10 )
28
+/* ROM banner timeout, converted to a number of (18Hz) timer ticks. */
29
+#define ROM_BANNER_TIMEOUT_TICKS ( ( 18 * ROM_BANNER_TIMEOUT ) / 10 )
34 30
 
35 31
 /* Allow payload to be excluded from ROM size
36 32
  */
@@ -791,7 +787,7 @@ wait_for_key:
791 787
 	int	$0x16
792 788
 	jmp	1b
793 789
 2:	/* Wait for a key press */
794
-	movw	$ROM_BANNER_TIMEOUT, %cx
790
+	movw	$ROM_BANNER_TIMEOUT_TICKS, %cx
795 791
 3:	decw	%cx
796 792
 	js	99f		/* Exit with ZF clear */
797 793
 	/* Wait for timer tick to be updated */

+ 15
- 4
src/config/general.h View File

@@ -28,11 +28,22 @@ FILE_LICENCE ( GPL2_OR_LATER );
28 28
 #define PRODUCT_SHORT_NAME "iPXE"
29 29
 
30 30
 /*
31
- * Timer configuration
32
- *
31
+ * Banner timeout configuration
32
+ *
33
+ * This controls the timeout for the "Press Ctrl-B for the iPXE
34
+ * command line" banner displayed when iPXE starts up.  The value is
35
+ * specified in tenths of a second for which the banner should appear.
36
+ * A value of 0 disables the banner.
37
+ *
38
+ * ROM_BANNER_TIMEOUT controls the "Press Ctrl-B to configure iPXE"
39
+ * banner displayed only by ROM builds of iPXE during POST.  This
40
+ * defaults to being twice the length of BANNER_TIMEOUT, to allow for
41
+ * BIOSes that switch video modes immediately before calling the
42
+ * initialisation vector, thus rendering the banner almost invisible
43
+ * to the user.
33 44
  */
34
-#define BANNER_TIMEOUT	20	/* Tenths of a second for which the shell
35
-				   banner should appear */
45
+#define BANNER_TIMEOUT		20
46
+#define ROM_BANNER_TIMEOUT	( 2 * BANNER_TIMEOUT )
36 47
 
37 48
 /*
38 49
  * Network protocols

Loading…
Cancel
Save