Skip to content

Commit 27d1b40

Browse files
awilliammcb30
authored andcommittedMar 3, 2014
[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>
1 parent f22c19f commit 27d1b40

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed
 

‎src/arch/i386/prefix/romprefix.S

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
2525
( PMM_HANDLE_BASE | 0x00002000 )
2626
#define PCI_FUNC_MASK 0x07
2727

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

3531
/* Allow payload to be excluded from ROM size
3632
*/
@@ -791,7 +787,7 @@ wait_for_key:
791787
int $0x16
792788
jmp 1b
793789
2: /* Wait for a key press */
794-
movw $ROM_BANNER_TIMEOUT, %cx
790+
movw $ROM_BANNER_TIMEOUT_TICKS, %cx
795791
3: decw %cx
796792
js 99f /* Exit with ZF clear */
797793
/* Wait for timer tick to be updated */

‎src/config/general.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@ FILE_LICENCE ( GPL2_OR_LATER );
2828
#define PRODUCT_SHORT_NAME "iPXE"
2929

3030
/*
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.
3344
*/
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 )
3647

3748
/*
3849
* Network protocols

0 commit comments

Comments
 (0)
Please sign in to comment.