UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Rhodez
Member
Member
Posts: 33
Joined: Tue Jun 30, 2020 2:09 pm
Location: Langeskov, Denmark

UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Post by Rhodez »

Hi,

I'm trying to make some "simple" networking from UEFI.

I have tried using EFI_SIMPLE_NETWORK_PROTOCOL and EFI_UDP4_PROTOCOL.
When I try in QEMU it seems like I detect things correct, at least I am retrieving the correct MAC-Address that QEMU uses (I have not succeeded sending packages yet, but).

When I try the same code on hardware (on a Thinkpad x270) UEFI do not even locate any of these in the first place with the use of the LocateHandleBuffer() method.
It just return EFI_NOT_FOUND.

I have used a couple of days trying figuring it out, but it is very hard to find any information or examples.
Any idea why I cannot detect these on hardware?

Cheers Jørn
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Post by nullplan »

Maybe there is no Ethernet device in the system? Or it is not enabled? Or it doesn't have UEFI firmware? Is the device otherwise capable of PXE boot? Because if not, then the firmware doesn't know how to talk to the network card, and that means it can't give your bootloader methods to do so, either.
Carpe diem!
Rhodez
Member
Member
Posts: 33
Joined: Tue Jun 30, 2020 2:09 pm
Location: Langeskov, Denmark

Re: UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Post by Rhodez »

So yes, yes, yes and yes it has it all.

You post helped me out though. I haven't though more about "booting form LAN", so of course it should have a LAN cable in.
I plugged a cable into the laptop waited a moment for it to connect, loaded my module, and bam.. there it was...
Correct MAC and IP-address.

I did just assume that even if there was no cable it would still detect the "device", but it makes sense that it can only find the protocols if there actually is a connection.
Otherwise I should have looked directly after the network device itself. If that make sense.

- Jørn
Post Reply