Browse Source

[pxe] Fill in UNDIROMID pointer in !PXE structure

IBM's iSCSI Firmware Initiator checks the UNDIROMID pointer in the
!PXE structure that gets created by the UNDI loader.  We didn't
previously fill this value in.
tags/v0.9.4
Michael Brown 15 years ago
parent
commit
fc0c40a5b0

+ 3
- 0
src/arch/i386/interface/pxe/pxe_call.c View File

347
 	/* Copy parameter block from caller */
347
 	/* Copy parameter block from caller */
348
 	copy_from_user ( &params, uparams, 0, sizeof ( params ) );
348
 	copy_from_user ( &params, uparams, 0, sizeof ( params ) );
349
 
349
 
350
+	/* Fill in ROM segment address */
351
+	ppxe.UNDIROMID.segment = ix86->segs.ds;
352
+
350
 	/* Set default status in case child routine fails to do so */
353
 	/* Set default status in case child routine fails to do so */
351
 	params.Status = PXENV_STATUS_FAILURE;
354
 	params.Status = PXENV_STATUS_FAILURE;
352
 
355
 

+ 6
- 1
src/arch/i386/interface/pxe/pxe_entry.S View File

35
 	.byte 0				/* StructCksum */
35
 	.byte 0				/* StructCksum */
36
 	.byte 0				/* StructRev */
36
 	.byte 0				/* StructRev */
37
 	.byte 0				/* reserved_1 */
37
 	.byte 0				/* reserved_1 */
38
-	.word 0, 0			/* UNDIROMID */
38
+	.word undiheader, 0		/* UNDIROMID */
39
 	.word 0, 0			/* BaseROMID */
39
 	.word 0, 0			/* BaseROMID */
40
 	.word pxe_entry_sp, 0		/* EntryPointSP */
40
 	.word pxe_entry_sp, 0		/* EntryPointSP */
41
 	.word pxe_entry_esp, 0		/* EntryPointESP */
41
 	.word pxe_entry_esp, 0		/* EntryPointESP */
55
 	.equ	pxe_length, . - ppxe
55
 	.equ	pxe_length, . - ppxe
56
 	.size	ppxe, . - ppxe
56
 	.size	ppxe, . - ppxe
57
 
57
 
58
+	/* Define undiheader=0 as a weak symbol for non-ROM builds */
59
+	.section ".weak"
60
+	.weak	undiheader
61
+undiheader:
62
+
58
 /****************************************************************************
63
 /****************************************************************************
59
  * PXENV+ structure
64
  * PXENV+ structure
60
  ****************************************************************************
65
  ****************************************************************************

+ 11
- 5
src/arch/i386/prefix/romprefix.S View File

112
 prodstr_pci_id:
112
 prodstr_pci_id:
113
 	.asciz	"xx:xx.x)"		/* Filled in by init code */
113
 	.asciz	"xx:xx.x)"		/* Filled in by init code */
114
 	.size prodstr, . - prodstr
114
 	.size prodstr, . - prodstr
115
-	
115
+
116
+	.globl	undiheader	
116
 undiheader:
117
 undiheader:
117
 	.ascii	"UNDI"			/* Signature */
118
 	.ascii	"UNDI"			/* Signature */
118
 	.byte	undiheader_len		/* Length of structure */
119
 	.byte	undiheader_len		/* Length of structure */
524
 	/* Save registers */
525
 	/* Save registers */
525
 	pushl	%esi
526
 	pushl	%esi
526
 	pushl	%edi
527
 	pushl	%edi
528
+	pushw	%ds
527
 	pushw	%es
529
 	pushw	%es
528
 	pushw	%bx
530
 	pushw	%bx
531
+	/* ROM segment address to %ds */
532
+	pushw	%cs
533
+	popw	%ds
529
 	/* UNDI loader parameter structure address into %es:%di */
534
 	/* UNDI loader parameter structure address into %es:%di */
530
 	movw	%sp, %bx
535
 	movw	%sp, %bx
531
-	movw	%ss:16(%bx), %di
532
-	movw	%ss:18(%bx), %es
536
+	movw	%ss:18(%bx), %di
537
+	movw	%ss:20(%bx), %es
533
 	/* Install to specified real-mode addresses */
538
 	/* Install to specified real-mode addresses */
534
 	pushw	%di
539
 	pushw	%di
535
 	movw	%es:12(%di), %bx
540
 	movw	%es:12(%di), %bx
536
 	movw	%es:14(%di), %ax
541
 	movw	%es:14(%di), %ax
537
-	movl	%cs:image_source, %esi
538
-	movl	%cs:decompress_to, %edi
542
+	movl	image_source, %esi
543
+	movl	decompress_to, %edi
539
 	call	install_prealloc
544
 	call	install_prealloc
540
 	popw	%di
545
 	popw	%di
541
 	/* Call UNDI loader C code */
546
 	/* Call UNDI loader C code */
550
 	/* Restore registers and return */
555
 	/* Restore registers and return */
551
 	popw	%bx
556
 	popw	%bx
552
 	popw	%es
557
 	popw	%es
558
+	popw	%ds
553
 	popl	%edi
559
 	popl	%edi
554
 	popl	%esi
560
 	popl	%esi
555
 	lret
561
 	lret

+ 10
- 0
src/arch/i386/scripts/i386.lds View File

30
      *
30
      *
31
      */
31
      */
32
 
32
 
33
+    /*
34
+     * Weak symbols that need zero values if not otherwise defined
35
+     */
36
+
37
+    . = 0;
38
+    .weak : AT ( 0 ) {
39
+	*(.weak)
40
+    }
41
+    _assert = ASSERT ( ( . == 0 ), ".weak is non-zero length" );
42
+
33
     /*
43
     /*
34
      * The prefix
44
      * The prefix
35
      */
45
      */

Loading…
Cancel
Save