[ipxe-devel] [PATCH v2 3/3] [romprefix] Store boot bus:dev.fn

Alex Williamson alex.williamson at redhat.com
Tue Feb 25 23:00:44 UTC 2014


Per the BIOS Boot Specification, the initialization phase of the ROM
is called with the PFA (PCI Function Address) in the %ax register.
The intention is that the ROM code will store that device address
somewhere and use it for booting from that device when the Boot Entry
Vector (BEV) is called.  iPXE does store the PFA, but it doesn't use.
This mostly negates the benefit of the BIOS IPL as iPXE only provides
driver level granularity.

Use our previously defind BSS variables to relay device info to
protected mode code, which will then store it in autoboot settings
during initialization.

Signed-off-by: Alex Williamson <alex.williamson at redhat.com>
---
 src/arch/i386/prefix/romprefix.S |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
index 091673d..3a80a20 100644
--- a/src/arch/i386/prefix/romprefix.S
+++ b/src/arch/i386/prefix/romprefix.S
@@ -742,7 +742,18 @@ exec:	/* Set %ds = %cs */
 	pushw	$1f
 	lret
 	.section ".text16", "awx", @progbits
-1:	/* Call main() */
+1:
+	/* Retrieve PCI bus:dev.fn */
+	movw	init_pci_busdevfn, %cx
+
+	/* Set up %ds for access to .data16 */
+	movw	%bx, %ds
+
+	/* Store PCI bus:dev.fn */
+	movw	%cx, i386_pci_autoboot_bdf
+	movw	$1, i386_pci_autoboot_bdf_set
+
+	/* Call main() */
 	pushl	$main
 	pushw	%cs
 	call	prot_call




More information about the ipxe-devel mailing list