david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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.
This commit is contained in:
Michael Brown 2008-08-25 23:36:24 +01:00
parent f58cc3fca8
commit de7be480d6
1 changed files with 28 additions and 27 deletions

View File

@ -11,6 +11,7 @@
#define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) ) #define PCI_SIGNATURE ( 'P' + ( 'C' << 8 ) + ( 'I' << 16 ) + ( ' ' << 24 ) )
#define STACK_MAGIC ( 'L' + ( 'R' << 8 ) + ( 'E' << 16 ) + ( 'T' << 24 ) ) #define STACK_MAGIC ( 'L' + ( 'R' << 8 ) + ( 'E' << 16 ) + ( 'T' << 24 ) )
#define PNP_GET_BBS_VERSION 0x60 #define PNP_GET_BBS_VERSION 0x60
#define PMM_ALLOCATE 0x0000
.text .text
.code16 .code16
@ -83,7 +84,7 @@ pnpheader:
.byte 0x02 /* Device base type code */ .byte 0x02 /* Device base type code */
.byte 0x00 /* Device sub-type code */ .byte 0x00 /* Device sub-type code */
.byte 0x00 /* Device interface type code */ .byte 0x00 /* Device interface type code */
.byte 0x54 /* Device indicator */ .byte 0xf4 /* Device indicator */
.word 0x0000 /* Boot connection vector */ .word 0x0000 /* Boot connection vector */
.word 0x0000 /* Disconnect vector */ .word 0x0000 /* Disconnect vector */
.word bev_entry /* Boot execution vector */ .word bev_entry /* Boot execution vector */
@ -203,14 +204,13 @@ init:
/* Check for PnP BIOS */ /* Check for PnP BIOS */
testw $0x0f, %bx /* PnP signature must be aligned - bochs */ testw $0x0f, %bx /* PnP signature must be aligned - bochs */
jnz hook_int19 /* uses unalignment to indicate 'fake' PnP. */ jnz no_bbs /* uses unalignment to indicate 'fake' PnP. */
cmpl $PNP_SIGNATURE, %es:0(%bx) cmpl $PNP_SIGNATURE, %es:0(%bx)
jne hook_int19 jne no_bbs
/* Is PnP: print PnP message */ /* Is PnP: print PnP message */
movw $init_message_pnp, %si movw $init_message_pnp, %si
xorw %di, %di xorw %di, %di
call print_message call print_message
/* Check for BBS */ /* Check for BBS */
pushw %es:0x1b(%bx) /* Real-mode data segment */ pushw %es:0x1b(%bx) /* Real-mode data segment */
pushw %ds /* &(bbs_version) */ pushw %ds /* &(bbs_version) */
@ -219,13 +219,8 @@ init:
lcall *%es:0xd(%bx) lcall *%es:0xd(%bx)
addw $8, %sp addw $8, %sp
testw %ax, %ax testw %ax, %ax
jne hook_int19 je got_bbs
movw $init_message_bbs, %si no_bbs: /* Not BBS-compliant - must hook INT 19 */
xorw %di, %di
call print_message
jmp hook_bbs
/* Not BBS-compliant - must hook INT 19 */
hook_int19:
movw $init_message_int19, %si movw $init_message_int19, %si
xorw %di, %di xorw %di, %di
call print_message call print_message
@ -236,7 +231,12 @@ hook_int19:
pushw %gs /* %gs contains runtime %cs */ pushw %gs /* %gs contains runtime %cs */
pushw $int19_entry pushw $int19_entry
popl %es:( 0x19 * 4 ) popl %es:( 0x19 * 4 )
hook_bbs: jmp bbs_done
got_bbs: /* BBS compliant - no need to hook INT 19 */
movw $init_message_bbs, %si
xorw %di, %di
call print_message
bbs_done:
/* Check for PMM */ /* Check for PMM */
movw $( 0xe000 - 1 ), %bx movw $( 0xe000 - 1 ), %bx
@ -261,22 +261,20 @@ pmm_scan:
pushw $0x0006 /* Aligned, extended memory */ pushw $0x0006 /* Aligned, extended memory */
pushl $0xffffffff /* No handle */ pushl $0xffffffff /* No handle */
pushl $( 0x00200000 / 16 ) /* 2MB in paragraphs */ pushl $( 0x00200000 / 16 ) /* 2MB in paragraphs */
pushw $0x0000 /* pmmAllocate */ pushw $PMM_ALLOCATE
lcall *%es:7 lcall *%es:7
addw $12, %sp addw $12, %sp
testw %dx, %dx /* %ax==0 even on success, since align=2MB */ movw %dx, %ax
jnz gotpmm
movb $'-', %al
xorw %di, %di xorw %di, %di
call print_character call print_hex_word
jmp no_pmm movw %dx, ( image_source + 2 )
gotpmm: /* PMM allocation succeeded: copy ROM to PMM block */ testw %dx, %dx /* %ax==0 even on success, since align=2MB */
jz no_pmm
/* PMM allocation succeeded: copy ROM to PMM block */
pushal /* PMM presence implies 1kB stack */ pushal /* PMM presence implies 1kB stack */
movw %ax, %es /* %ax=0 already - see above */ xorw %ax, %ax
pushw %dx movw %ax, %es
pushw %ax movl image_source, %edi
popl %edi
movl %edi, image_source
xorl %esi, %esi xorl %esi, %esi
movzbl romheader_size, %ecx movzbl romheader_size, %ecx
shll $9, %ecx shll $9, %ecx
@ -373,7 +371,7 @@ no_key_pressed:
.size init, . - init .size init, . - init
init_message: init_message:
.asciz "gPXE (http://etherboot.org) - PCI " .asciz "gPXE (http://etherboot.org) - "
.size init_message, . - init_message .size init_message, . - init_message
init_message_pci: init_message_pci:
.asciz " PCI" .asciz " PCI"
@ -419,6 +417,7 @@ decompress_to:
*/ */
bbs_version: bbs_version:
.word 0 .word 0
.size bbs_version, . - bbs_version
/* Boot Execution Vector entry point /* Boot Execution Vector entry point
* *
@ -459,9 +458,11 @@ exec: /* Set %ds = %cs */
popw %ds popw %ds
/* Print message as soon as possible */ /* Print message as soon as possible */
movw $exec_message, %si movw $prodstr, %si
xorw %di, %di xorw %di, %di
call print_message call print_message
movw $exec_message, %si
call print_message
/* Store magic word on BIOS stack and remember BIOS %ss:sp */ /* Store magic word on BIOS stack and remember BIOS %ss:sp */
pushl $STACK_MAGIC pushl $STACK_MAGIC
@ -509,7 +510,7 @@ exec: /* Set %ds = %cs */
.previous .previous
exec_message: exec_message:
.asciz "Entering gPXE\n" .asciz " starting execution\n"
.size exec_message, . - exec_message .size exec_message, . - exec_message
/* UNDI loader /* UNDI loader