Browse Source

[pxe] Invoke INT 1a,564e when PXE stack is activated

Invoke INT 1a,564e whenever a PXE stack is activated, passing the
address of the PXENV+ structure in %es:%bx.  This is designed to allow
a BIOS to be notified when a PXE stack has been installed, providing
an opportunity for start-of-day commands such as setting the MAC
address according to a policy chosen by the BIOS.

PXE defines INT 1a,5650 as a means of locating the PXENV+ structure:
this call returns %ax=0x564e and the address of the PXENV+ structure
in %es:%bx.  We choose INT 1a,564e as a fairly natural notification
call, using the parameters as would be returned by INT 1a,5650.

The full calling convention (documented as per section 3.1 of the PXE
specification) is:

  INT 1a,564e - PXE installation notification
  Enter:
    %ax = 0x564e
    %es = 16-bit segment address of the PXENV+ structure
    %bx = 16-bit offset of the PXENV+ structure
  Exit:
    %edx may be trashed (as is the case for INT 1a,5650)
    All other register contents must be preserved
    CF is cleared
    IF is preserved
    All other flags are undefined

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
3b586c8e29
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      src/arch/i386/interface/pxe/pxe_call.c

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

@@ -265,6 +265,9 @@ struct init_fn pxe_init_fn __init_fn ( INIT_NORMAL ) = {
265 265
  * @v netdev		Net device to use as PXE net device
266 266
  */
267 267
 void pxe_activate ( struct net_device *netdev ) {
268
+	uint32_t discard_a;
269
+	uint32_t discard_b;
270
+	uint32_t discard_d;
268 271
 
269 272
 	/* Ensure INT 1A is hooked */
270 273
 	if ( ! int_1a_hooked ) {
@@ -276,6 +279,15 @@ void pxe_activate ( struct net_device *netdev ) {
276 279
 
277 280
 	/* Set PXE network device */
278 281
 	pxe_set_netdev ( netdev );
282
+
283
+	/* Notify BIOS of installation */
284
+	__asm__ __volatile__ ( REAL_CODE ( "pushw %%cs\n\t"
285
+					   "popw %%es\n\t"
286
+					   "int $0x1a\n\t" )
287
+			       : "=a" ( discard_a ), "=b" ( discard_b ),
288
+				 "=d" ( discard_d )
289
+			       : "0" ( 0x564e ),
290
+				 "1" ( __from_text16 ( &pxenv ) ) );
279 291
 }
280 292
 
281 293
 /**

Loading…
Cancel
Save