Procházet zdrojové kódy

[romprefix] Add more diagnostic messages to ROM prefix

Include PMM allocation result in POST banner.

Include full product string in "starting execution" message.

Also mark ourselves as supporting DDIM in PnP header, for
completeness.
tags/v0.9.4
Michael Brown před 15 roky
rodič
revize
de7be480d6
1 změnil soubory, kde provedl 28 přidání a 27 odebrání
  1. 28
    27
      src/arch/i386/prefix/romprefix.S

+ 28
- 27
src/arch/i386/prefix/romprefix.S Zobrazit soubor

11
 #define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) )
11
 #define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) )
12
 #define STACK_MAGIC ( 'L' + ( 'R' << 8 ) + ( 'E' << 16 ) + ( 'T' << 24 ) )
12
 #define STACK_MAGIC ( 'L' + ( 'R' << 8 ) + ( 'E' << 16 ) + ( 'T' << 24 ) )
13
 #define PNP_GET_BBS_VERSION 0x60
13
 #define PNP_GET_BBS_VERSION 0x60
14
+#define PMM_ALLOCATE 0x0000
14
 
15
 
15
 	.text
16
 	.text
16
 	.code16
17
 	.code16
83
 	.byte	0x02			/* Device base type code */
84
 	.byte	0x02			/* Device base type code */
84
 	.byte	0x00			/* Device sub-type code */
85
 	.byte	0x00			/* Device sub-type code */
85
 	.byte	0x00			/* Device interface type code */
86
 	.byte	0x00			/* Device interface type code */
86
-	.byte	0x54			/* Device indicator */
87
+	.byte	0xf4			/* Device indicator */
87
 	.word	0x0000			/* Boot connection vector */
88
 	.word	0x0000			/* Boot connection vector */
88
 	.word	0x0000			/* Disconnect vector */
89
 	.word	0x0000			/* Disconnect vector */
89
 	.word	bev_entry		/* Boot execution vector */
90
 	.word	bev_entry		/* Boot execution vector */
203
 
204
 
204
 	/* Check for PnP BIOS */
205
 	/* Check for PnP BIOS */
205
 	testw	$0x0f, %bx	/* PnP signature must be aligned - bochs    */
206
 	testw	$0x0f, %bx	/* PnP signature must be aligned - bochs    */
206
-	jnz	hook_int19	/* uses unalignment to indicate 'fake' PnP. */
207
+	jnz	no_bbs		/* uses unalignment to indicate 'fake' PnP. */
207
 	cmpl	$PNP_SIGNATURE, %es:0(%bx)
208
 	cmpl	$PNP_SIGNATURE, %es:0(%bx)
208
-	jne	hook_int19
209
+	jne	no_bbs
209
 	/* Is PnP: print PnP message */
210
 	/* Is PnP: print PnP message */
210
 	movw	$init_message_pnp, %si
211
 	movw	$init_message_pnp, %si
211
 	xorw	%di, %di
212
 	xorw	%di, %di
212
 	call	print_message
213
 	call	print_message
213
-
214
 	/* Check for BBS */
214
 	/* Check for BBS */
215
 	pushw	%es:0x1b(%bx)	/* Real-mode data segment */
215
 	pushw	%es:0x1b(%bx)	/* Real-mode data segment */
216
 	pushw	%ds		/* &(bbs_version) */
216
 	pushw	%ds		/* &(bbs_version) */
219
 	lcall	*%es:0xd(%bx)
219
 	lcall	*%es:0xd(%bx)
220
 	addw	$8, %sp
220
 	addw	$8, %sp
221
 	testw	%ax, %ax
221
 	testw	%ax, %ax
222
-	jne	hook_int19
223
-	movw	$init_message_bbs, %si
224
-	xorw	%di, %di
225
-	call	print_message
226
-	jmp	hook_bbs
227
-	/* Not BBS-compliant - must hook INT 19 */
228
-hook_int19:
222
+	je	got_bbs
223
+no_bbs:	/* Not BBS-compliant - must hook INT 19 */
229
 	movw	$init_message_int19, %si
224
 	movw	$init_message_int19, %si
230
 	xorw	%di, %di
225
 	xorw	%di, %di
231
 	call	print_message
226
 	call	print_message
236
 	pushw	%gs /* %gs contains runtime %cs */
231
 	pushw	%gs /* %gs contains runtime %cs */
237
 	pushw	$int19_entry
232
 	pushw	$int19_entry
238
 	popl	%es:( 0x19 * 4 )
233
 	popl	%es:( 0x19 * 4 )
239
-hook_bbs:
234
+	jmp	bbs_done
235
+got_bbs: /* BBS compliant - no need to hook INT 19 */
236
+	movw	$init_message_bbs, %si
237
+	xorw	%di, %di
238
+	call	print_message
239
+bbs_done:
240
 
240
 
241
 	/* Check for PMM */
241
 	/* Check for PMM */
242
 	movw	$( 0xe000 - 1 ), %bx
242
 	movw	$( 0xe000 - 1 ), %bx
261
 	pushw	$0x0006		/* Aligned, extended memory */
261
 	pushw	$0x0006		/* Aligned, extended memory */
262
 	pushl	$0xffffffff	/* No handle */
262
 	pushl	$0xffffffff	/* No handle */
263
 	pushl	$( 0x00200000 / 16 ) /* 2MB in paragraphs */
263
 	pushl	$( 0x00200000 / 16 ) /* 2MB in paragraphs */
264
-	pushw	$0x0000		/* pmmAllocate */
264
+	pushw	$PMM_ALLOCATE
265
 	lcall	*%es:7
265
 	lcall	*%es:7
266
 	addw	$12, %sp
266
 	addw	$12, %sp
267
-	testw	%dx, %dx	/* %ax==0 even on success, since align=2MB */
268
-	jnz	gotpmm
269
-	movb	$'-', %al
267
+	movw	%dx, %ax
270
 	xorw	%di, %di
268
 	xorw	%di, %di
271
-	call	print_character
272
-	jmp	no_pmm
273
-gotpmm:	/* PMM allocation succeeded: copy ROM to PMM block */
269
+	call	print_hex_word
270
+	movw	%dx, ( image_source + 2 )
271
+	testw	%dx, %dx	/* %ax==0 even on success, since align=2MB */
272
+	jz	no_pmm
273
+	/* PMM allocation succeeded: copy ROM to PMM block */
274
 	pushal			/* PMM presence implies 1kB stack */
274
 	pushal			/* PMM presence implies 1kB stack */
275
-	movw	%ax, %es	/* %ax=0 already - see above */
276
-	pushw	%dx
277
-	pushw	%ax
278
-	popl	%edi
279
-	movl	%edi, image_source
275
+	xorw	%ax, %ax
276
+	movw	%ax, %es
277
+	movl	image_source, %edi
280
 	xorl	%esi, %esi
278
 	xorl	%esi, %esi
281
 	movzbl	romheader_size, %ecx
279
 	movzbl	romheader_size, %ecx
282
 	shll	$9, %ecx
280
 	shll	$9, %ecx
373
 	.size init, . - init
371
 	.size init, . - init
374
 
372
 
375
 init_message:
373
 init_message:
376
-	.asciz	"gPXE (http://etherboot.org) - PCI "
374
+	.asciz	"gPXE (http://etherboot.org) - "
377
 	.size	init_message, . - init_message
375
 	.size	init_message, . - init_message
378
 init_message_pci:
376
 init_message_pci:
379
 	.asciz	" PCI"
377
 	.asciz	" PCI"
419
  */
417
  */
420
 bbs_version:
418
 bbs_version:
421
 	.word	0
419
 	.word	0
420
+	.size	bbs_version, . - bbs_version
422
 
421
 
423
 /* Boot Execution Vector entry point
422
 /* Boot Execution Vector entry point
424
  *
423
  *
459
 	popw	%ds
458
 	popw	%ds
460
 
459
 
461
 	/* Print message as soon as possible */
460
 	/* Print message as soon as possible */
462
-	movw	$exec_message, %si
461
+	movw	$prodstr, %si
463
 	xorw	%di, %di
462
 	xorw	%di, %di
464
 	call	print_message
463
 	call	print_message
464
+	movw	$exec_message, %si
465
+	call	print_message
465
 
466
 
466
 	/* Store magic word on BIOS stack and remember BIOS %ss:sp */
467
 	/* Store magic word on BIOS stack and remember BIOS %ss:sp */
467
 	pushl	$STACK_MAGIC
468
 	pushl	$STACK_MAGIC
509
 	.previous
510
 	.previous
510
 
511
 
511
 exec_message:
512
 exec_message:
512
-	.asciz	"Entering gPXE\n"
513
+	.asciz	" starting execution\n"
513
 	.size exec_message, . - exec_message
514
 	.size exec_message, . - exec_message
514
 
515
 
515
 /* UNDI loader
516
 /* UNDI loader

Načítá se…
Zrušit
Uložit