瀏覽代碼

[romprefix] Allow BANNER_TIMEOUT to control banners in romprefix.S

In particular, allow BANNER_TIMEOUT=0 to inhibit the prompt banners
altogether.

Ironically, this request comes from the same OEM that originally
required the prompts to be present during POST.
tags/v0.9.4
Michael Brown 15 年之前
父節點
當前提交
539f94b980
共有 1 個檔案被更改,包括 26 行新增18 行删除
  1. 26
    18
      src/arch/i386/prefix/romprefix.S

+ 26
- 18
src/arch/i386/prefix/romprefix.S 查看文件

6
  * table so using a noticeable amount of stack space is a no-no.
6
  * table so using a noticeable amount of stack space is a no-no.
7
  */
7
  */
8
 
8
 
9
+#include <config/general.h>
10
+
9
 #define PNP_SIGNATURE ( '$' + ( 'P' << 8 ) + ( 'n' << 16 ) + ( 'P' << 24 ) )
11
 #define PNP_SIGNATURE ( '$' + ( 'P' << 8 ) + ( 'n' << 16 ) + ( 'P' << 24 ) )
10
 #define PMM_SIGNATURE ( '$' + ( 'P' << 8 ) + ( 'M' << 16 ) + ( 'M' << 24 ) )
12
 #define PMM_SIGNATURE ( '$' + ( 'P' << 8 ) + ( 'M' << 16 ) + ( 'M' << 24 ) )
11
 #define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) )
13
 #define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) )
13
 #define PNP_GET_BBS_VERSION 0x60
15
 #define PNP_GET_BBS_VERSION 0x60
14
 #define PMM_ALLOCATE 0x0000
16
 #define PMM_ALLOCATE 0x0000
15
 
17
 
18
+/* ROM banner timeout.  Based on the configurable BANNER_TIMEOUT in
19
+ * config.h, but converted to a number of (18Hz) timer ticks, and
20
+ * doubled to allow for BIOSes that switch video modes immediately
21
+ * beforehand, so rendering the message almost invisible to the user.
22
+ */
23
+#define ROM_BANNER_TIMEOUT ( 2 * ( 18 * BANNER_TIMEOUT ) / 10 )
24
+
16
 	.text
25
 	.text
17
 	.code16
26
 	.code16
18
 	.arch i386
27
 	.arch i386
318
 	/* Wait for Ctrl-B */
327
 	/* Wait for Ctrl-B */
319
 	movw	$0xff02, %bx
328
 	movw	$0xff02, %bx
320
 	call	wait_for_key
329
 	call	wait_for_key
330
+	/* Clear prompt */
331
+	pushf
332
+	movw	$clear_message, %si
333
+	xorw	%di, %di
334
+	call	print_message
335
+	popf
321
 	jnz	1f
336
 	jnz	1f
322
 	/* Ctrl-B was pressed: invoke gPXE.  The keypress will be
337
 	/* Ctrl-B was pressed: invoke gPXE.  The keypress will be
323
 	 * picked up by the initial shell prompt, and we will drop
338
 	 * picked up by the initial shell prompt, and we will drop
326
 	pushw	%cs
341
 	pushw	%cs
327
 	call	exec
342
 	call	exec
328
 1:
343
 1:
329
-	/* Print blank lines to terminate messages */
330
-	movw	$init_message_end, %si
331
-	xorw	%di, %di
332
-	call	print_message
333
-
334
 	/* Restore registers */
344
 	/* Restore registers */
335
 	popw	%gs
345
 	popw	%gs
336
 	popw	%fs
346
 	popw	%fs
364
 init_message_prompt:
374
 init_message_prompt:
365
 	.asciz	"\nPress Ctrl-B to configure gPXE..."
375
 	.asciz	"\nPress Ctrl-B to configure gPXE..."
366
 	.size	init_message_prompt, . - init_message_prompt
376
 	.size	init_message_prompt, . - init_message_prompt
367
-init_message_end:
368
-	.asciz	"\n\n\n"
369
-	.size	init_message_end, . - init_message_end
377
+clear_message:
378
+	.asciz	"\r                                     \n\n"
379
+	.size	clear_message, . - clear_message
370
 
380
 
371
 /* ROM image location
381
 /* ROM image location
372
  *
382
  *
421
 	call	print_message
431
 	call	print_message
422
 	movw	$0xdf42, %bx
432
 	movw	$0xdf42, %bx
423
 	call	wait_for_key
433
 	call	wait_for_key
434
+	pushf
435
+	movw	$clear_message, %si
436
+	xorw	%di, %di
437
+	call	print_message
438
+	popf
424
 	jnz	1f
439
 	jnz	1f
425
 	/* Leave keypress in buffer and start gPXE.  The keypress will
440
 	/* Leave keypress in buffer and start gPXE.  The keypress will
426
 	 * cause the usual initial Ctrl-B prompt to be skipped.
441
 	 * cause the usual initial Ctrl-B prompt to be skipped.
427
 	 */
442
 	 */
428
 	pushw	%cs
443
 	pushw	%cs
429
 	call	exec
444
 	call	exec
430
-1:	/* Print blank lines to terminate messages */
431
-	movw	$int19_message_end, %si
432
-	xorw	%di, %di
433
-	call	print_message
434
-	/* Try to call original INT 19 vector */
445
+1:	/* Try to call original INT 19 vector */
435
 	movl	%cs:orig_int19, %eax
446
 	movl	%cs:orig_int19, %eax
436
 	testl	%eax, %eax
447
 	testl	%eax, %eax
437
 	je	2f
448
 	je	2f
449
 int19_message_dots:
460
 int19_message_dots:
450
 	.asciz	"..."
461
 	.asciz	"..."
451
 	.size	int19_message_dots, . - int19_message_dots
462
 	.size	int19_message_dots, . - int19_message_dots
452
-int19_message_end:
453
-	.asciz	"\n\n\n"
454
-	.size	int19_message_end, . - int19_message_end
455
 	
463
 	
456
 /* Execute as a boot device
464
 /* Execute as a boot device
457
  *
465
  *
578
 	xorw	%ax, %ax
586
 	xorw	%ax, %ax
579
 	int	$0x16
587
 	int	$0x16
580
 	jmp	1b
588
 	jmp	1b
581
-2:	/* Wait for up to 5s for a key press */
582
-	movw	$(18 * 5), %cx	/* Approx 5s worth of timer ticks */
589
+2:	/* Wait for a key press */
590
+	movw	$ROM_BANNER_TIMEOUT, %cx
583
 3:	decw	%cx
591
 3:	decw	%cx
584
 	js	99f		/* Exit with ZF clear */
592
 	js	99f		/* Exit with ZF clear */
585
 	/* Wait for timer tick to be updated */
593
 	/* Wait for timer tick to be updated */

Loading…
取消
儲存