Page 1 of 1

UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Posted: Thu Dec 17, 2020 5:13 am
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

Re: UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Posted: Thu Dec 17, 2020 9:38 am
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.

Re: UEFI - Cannot detect EFI_SIMPLE_NETWORK_PROTOCOL or UDP

Posted: Thu Dec 17, 2020 10:01 am
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