Преглед на файлове

[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 преди 15 години
родител
ревизия
aaa26f3bd3
променени са 2 файла, в които са добавени 13 реда и са изтрити 8 реда
  1. 7
    6
      src/arch/i386/interface/pxe/pxe_call.c
  2. 6
    2
      src/arch/i386/interface/pxe/pxe_entry.S

+ 7
- 6
src/arch/i386/interface/pxe/pxe_call.c Целия файл

433
  * @ret rc		Return status code
433
  * @ret rc		Return status code
434
  */
434
  */
435
 int pxe_start_nbp ( void ) {
435
 int pxe_start_nbp ( void ) {
436
-	int discard_b, discard_c;
436
+	int discard_b, discard_c, discard_d;
437
 	uint16_t rc;
437
 	uint16_t rc;
438
 
438
 
439
 	/* Far call to PXE NBP */
439
 	/* Far call to PXE NBP */
444
 					   "lcall $0, $0x7c00\n\t"
444
 					   "lcall $0, $0x7c00\n\t"
445
 					   "addw $4, %%sp\n\t" )
445
 					   "addw $4, %%sp\n\t" )
446
 			       : "=a" ( rc ), "=b" ( discard_b ),
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
 	return rc;
454
 	return rc;
454
 }
455
 }

+ 6
- 2
src/arch/i386/interface/pxe/pxe_entry.S Целия файл

178
  * Returns:
178
  * Returns:
179
  *   %ax : 0x564e
179
  *   %ax : 0x564e
180
  *   %es:bx : Far pointer to the PXENV+ structure
180
  *   %es:bx : Far pointer to the PXENV+ structure
181
+ *   %edx : Physical address of the PXENV+ structure
181
  *   CF cleared
182
  *   CF cleared
182
  * Corrupts:
183
  * Corrupts:
183
  *   none
184
  *   none
191
 	cmpw	$0x5650, %ax
192
 	cmpw	$0x5650, %ax
192
 	jne	1f
193
 	jne	1f
193
 	/* INT 1A,5650 - PXE installation check */
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
 	movw	$pxenv, %bx
198
 	movw	$pxenv, %bx
199
+	shll	$4, %edx
200
+	addl	$pxenv, %edx
197
 	movw	$0x564e, %ax
201
 	movw	$0x564e, %ax
198
 	popfw
202
 	popfw
199
 	clc
203
 	clc

Loading…
Отказ
Запис