Explorar el Código

[pxe] Initialize EDX on PXE NBP entry and INT 1Ah

The PXE 1.x spec specifies that on NBP entry or on return from INT
1Ah AX=5650h, EDX shall point to the physical address of the PXENV+
structure.  The PXE 2.x spec drops this requirement, simply stating
that EDX is clobbered.  Given the principle "be conservative in what
you send, liberal in what you accept", however, we should implement
this anyway.
tags/v0.9.7
H. Peter Anvin hace 15 años
padre
commit
aaa26f3bd3

+ 7
- 6
src/arch/i386/interface/pxe/pxe_call.c Ver fichero

@@ -433,7 +433,7 @@ void pxe_init_structures ( void ) {
433 433
  * @ret rc		Return status code
434 434
  */
435 435
 int pxe_start_nbp ( void ) {
436
-	int discard_b, discard_c;
436
+	int discard_b, discard_c, discard_d;
437 437
 	uint16_t rc;
438 438
 
439 439
 	/* Far call to PXE NBP */
@@ -444,11 +444,12 @@ int pxe_start_nbp ( void ) {
444 444
 					   "lcall $0, $0x7c00\n\t"
445 445
 					   "addw $4, %%sp\n\t" )
446 446
 			       : "=a" ( rc ), "=b" ( discard_b ),
447
-			         "=c" ( discard_c )
448
-			       :  "a" ( __from_text16 ( &ppxe ) ),
449
-			          "b" ( __from_text16 ( &pxenv ) ),
450
-			          "c" ( rm_cs )
451
-			       : "edx", "esi", "edi", "ebp", "memory" );
447
+				 "=c" ( discard_c ), "=d" ( discard_d )
448
+			       : "a" ( __from_text16 ( &ppxe ) ),
449
+			         "b" ( __from_text16 ( &pxenv ) ),
450
+			         "c" ( rm_cs ),
451
+			         "d" ( virt_to_phys ( &pxenv ) )
452
+			       : "esi", "edi", "ebp", "memory" );
452 453
 
453 454
 	return rc;
454 455
 }

+ 6
- 2
src/arch/i386/interface/pxe/pxe_entry.S Ver fichero

@@ -178,6 +178,7 @@ pxe_entry_common:
178 178
  * Returns:
179 179
  *   %ax : 0x564e
180 180
  *   %es:bx : Far pointer to the PXENV+ structure
181
+ *   %edx : Physical address of the PXENV+ structure
181 182
  *   CF cleared
182 183
  * Corrupts:
183 184
  *   none
@@ -191,9 +192,12 @@ pxe_int_1a:
191 192
 	cmpw	$0x5650, %ax
192 193
 	jne	1f
193 194
 	/* INT 1A,5650 - PXE installation check */
194
-	pushw	%cs
195
-	popw	%es
195
+	xorl	%edx, %edx
196
+	movw	%cs, %dx
197
+	movw	%dx, %es
196 198
 	movw	$pxenv, %bx
199
+	shll	$4, %edx
200
+	addl	$pxenv, %edx
197 201
 	movw	$0x564e, %ax
198 202
 	popfw
199 203
 	clc

Loading…
Cancelar
Guardar