Kaynağa Gözat

[romprefix] Display only one "Ctrl-B" prompt per PCI device during POST

If a multifunction PCI device exposes an iPXE ROM via each function,
then each function will display a "Press Ctrl-B to configure iPXE"
prompt, and delay for two seconds.  Since a single instance of iPXE
can drive all functions on the multifunction device, this simply adds
unnecessary delay to the boot process.

Fix by inhibiting the "Press Ctrl-B" prompt for all except the first
function on a PCI device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 yıl önce
ebeveyn
işleme
cb37d92ff6
1 değiştirilmiş dosya ile 11 ekleme ve 3 silme
  1. 11
    3
      src/arch/i386/prefix/romprefix.S

+ 11
- 3
src/arch/i386/prefix/romprefix.S Dosyayı Görüntüle

23
 	( PMM_HANDLE_BASE | 0x00001000 )
23
 	( PMM_HANDLE_BASE | 0x00001000 )
24
 #define PMM_HANDLE_BASE_DECOMPRESS_TO \
24
 #define PMM_HANDLE_BASE_DECOMPRESS_TO \
25
 	( PMM_HANDLE_BASE | 0x00002000 )
25
 	( PMM_HANDLE_BASE | 0x00002000 )
26
+#define PCI_FUNC_MASK 0x07
26
 
27
 
27
 /* ROM banner timeout.  Based on the configurable BANNER_TIMEOUT in
28
 /* ROM banner timeout.  Based on the configurable BANNER_TIMEOUT in
28
  * config.h, but converted to a number of (18Hz) timer ticks, and
29
  * config.h, but converted to a number of (18Hz) timer ticks, and
422
 	xorw	%di, %di
423
 	xorw	%di, %di
423
 	cs rep	movsb
424
 	cs rep	movsb
424
 
425
 
426
+	/* Skip prompt if this is not the first PCI function */
427
+	testb	$PCI_FUNC_MASK, init_pci_busdevfn
428
+	jnz	no_shell
425
 	/* Prompt for POST-time shell */
429
 	/* Prompt for POST-time shell */
426
 	movw	$init_message_prompt, %si
430
 	movw	$init_message_prompt, %si
427
 	xorw	%di, %di
431
 	xorw	%di, %di
440
 	movw	$init_message_done, %si
444
 	movw	$init_message_done, %si
441
 	call	print_message
445
 	call	print_message
442
 	popf
446
 	popf
443
-	jnz	2f
447
+	jnz	no_shell
444
 	/* Ctrl-B was pressed: invoke iPXE.  The keypress will be
448
 	/* Ctrl-B was pressed: invoke iPXE.  The keypress will be
445
 	 * picked up by the initial shell prompt, and we will drop
449
 	 * picked up by the initial shell prompt, and we will drop
446
 	 * into a shell.
450
 	 * into a shell.
448
 	xorl	%ebp, %ebp	/* Inhibit use of INT 15,e820 and INT 15,e801 */
452
 	xorl	%ebp, %ebp	/* Inhibit use of INT 15,e820 and INT 15,e801 */
449
 	pushw	%cs
453
 	pushw	%cs
450
 	call	exec
454
 	call	exec
451
-2:
455
+no_shell:
456
+	movb	$( '\n' ), %al
457
+	xorw	%di, %di
458
+	call	print_character
459
+
452
 	/* Restore registers */
460
 	/* Restore registers */
453
 	popw	%gs
461
 	popw	%gs
454
 	popw	%fs
462
 	popw	%fs
595
  *
603
  *
596
  */
604
  */
597
 init_pci_busdevfn:
605
 init_pci_busdevfn:
598
-	.word	0xffff
606
+	.word	0
599
 	.size	init_pci_busdevfn, . - init_pci_busdevfn
607
 	.size	init_pci_busdevfn, . - init_pci_busdevfn
600
 
608
 
601
 /* Image source area
609
 /* Image source area

Loading…
İptal
Kaydet