[ipxe-devel] IPXE question: iPXE.efi can't detect network device

Daniel Li 354225989 at qq.com
Tue Sep 11 15:19:27 UTC 2012

Hi philip & ipxe owner,
Thanks for your helpful reply and hard work.
I have changed the code like your tip,and built snponly.efi,run snponly.efi under uefi shell,it  can detecte the network device  and chain the web http://boot.ipxe.org/demo/boot.php succeed,but loadimage failture because the file is not uefi image,how do you solve this problem.

I have some questions,could you help to answer?I really want to research ipxe and import to our project.
1.Do you know how to buid a uefi boot os image,i can't find the solution to buid a os image,i hope the os image can  boot via ipxe under uefi enviroment.
2.run snponly.efi and then run sanboot comand,"can't open san device " error was showed because ipxe have not implement under uefi,what is your solution.
3.ipxe.efi/$dirver.efi still can't detect network devcie under,what is your solution.
4.If you can provide your tips or solution will be best.
5.Do you know why ipxe.efi or $driver.efi can't open  pci protocol and then can't enum pci device.
the key code is efi_supported()->efi_create() in efi_pci.c.
	if ( ( efirc = bs->OpenProtocol ( device,
		DBGCP ( efipci, "EFIPCI device %p is not a PCI device\n",
			device );
		goto err_open_protocol;

Best Regards,Daniel Li 


------------------ 原始邮件 ------------------
发件人: "philip.lantz"<philip.lantz at intel.com>;
发送时间: 2012年9月11日(星期二) 上午7:45
收件人: "'??'"<354225989 at qq.com>; 

主题: RE: IPXE question: iPXE.efi can't detect network device

Here’s the change I made. I hope this helps.




diff a/src/drivers/net/efi/snponly.c b/src/drivers/net/efi/snponly.c

@@ -61,12 +61,28 @@ static int snpbus_probe ( struct root_device *rootdev ) {

        int rc;

        void *snp;


-       efirc = bs->OpenProtocol ( efi_loaded_image->DeviceHandle,

+       EFI_HANDLE DeviceHandles[8];

+       UINTN size = sizeof DeviceHandles;


+       efirc = bs->LocateHandle ( ByProtocol,

+                                  &efi_simple_network_protocol_guid,

+                                  NULL,

+                                  &size,

+                                  DeviceHandles );

+       if ( efirc  || size == 0 ) {

+               DBG ("Could not find Simple Network Protocol (%x)\n", efirc);

+               return -ENODEV;

+       }


+       int n = size / sizeof (EFI_HANDLE);

+       DBG ( "SNP probe: located %d handles\n", n );


+       efirc = bs->OpenProtocol ( DeviceHandles[0],


                                   &snp, efi_image_handle, NULL,

                                   EFI_OPEN_PROTOCOL_GET_PROTOCOL );

        if ( efirc ) {

-               DBG ( "Could not find Simple Network Protocol!\n" );

+               DBG ( "Could not open Simple Network Protocol!\n" );

                return -ENODEV;


        snponly_dev.snp = snp;




From: ?? [mailto:354225989 at qq.com] 
Sent: Friday, September 07, 2012 8:01 PM
To: philip.lantz
Subject: IPXE question: iPXE.efi can't detect network device


Hi Philip,

After read your topic about "Using iPXE with UNDI driver"  in UEFI enviroment,i think that you have built a *.efi file and the file can connect network device,so could you tell me your step,


In your topic,you said that "Thanks! This is what I did. I changed snpbus_probe to call LocateHandle to find a handle that supports SNP and it now connects to my driver",how you are call LocateHandle?

I will eagerly waitting for your reply,best your regeards.




------------------ 原始邮件 ------------------

发件人: "我自己的邮箱"<354225989 at qq.com>;

发送时间: 2012年9月7日(星期五) 晚上9:37

收件人: "ipxe-devel"<ipxe-devel at lists.ipxe.org>; 

主题: IPXE question: iPXE.efi can't detect network device


Dear IPXE owner,

Thanks for ipxe develop team hard work,after read ipxe code ,i found that ipxe code is very classic and helpful to me.

Our product will import ipxe,but efi file can't found network device,I built efi file according to the below steps.

1.I have undef PXE_STACK and  PXE_MENU in src\config\general.h.

2.Built EFI version as vendor/product specific:

$ make bin-x86-64/10222000.efi bin-x86-64/10222001.efi bin-x86-64/10222625.efi.(computer vendor is 1022 ,device id is 2001).

$make bin-x86-64-efi/80861502(computer vendor is 8086,device id is 1502).

3.insert usb drive and enter uefi shell.


5.run above efi file.

6.All commands are Show the tip "No more network devices".


My built enviroment like following:

OS:ubuntu 12





------------------ 原始邮件 ------------------

发件人: "Anton D. Kachalov"<mouse at yandex-team.ru>;

发送时间: 2012年9月6日(星期四) 晚上10:18

收件人: "化石"<354225989 at qq.com>; "ipxe-devel"<ipxe-devel at lists.ipxe.org>;

主题: Re: PXE question: iPXE.efi can't detect network device




It's better to address this question directly to the ipxe-devel at lists.ipxe.org mailing list. Michael Brown should be right person.


BTW, ipxe.iso is legacy bootable ISO image and it contains all supported network drivers including pcnet32.


Try to build EFI version as vendor/product specific:


$ make bin-x86-64/10222000.efi bin-x86-64/10222001.efi bin-x86-64/10222625.efi


One of them should work.


Please pay attention that EFI environment doesn't support PXE stack. You have to disable PXE_STACK and PXE_MENU in the config file.

06.09.2012, 17:32, "化石" <354225989 at qq.com>:

Dear Anton,

I have built ipxe.efi 64 bit,my network device card is pcnet32,but ipxe.efi can't attach network card,i only get the log "No more network devices".but if boot to ipxe via ipxe.iso,ipxe can detected the network device card.

We will add ipxe to our project,so I hurry to solve this problem.

After debug ipxe.efi,i found that only call efi_pci.c\efipci_driver_startup but not call efi_pci.c\efipci_start,so i think pci device not been attach,do you know that what time to call function efipci_start().

Although I have read a topic about "Using iPXE with UNDI driver",but i can't find the root cause,Do you know the root cause?

Thank you very much.

I have built via run command "make bin-x86-64/ipxe.efi DEBUG:efi_pci device,pci" and then run ipxe.efi,

unfortunately,the result like following figure,it means can't attach any pci device,do you know why?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20120911/c1e88744/attachment.htm>

More information about the ipxe-devel mailing list