On Tue, Sep 09, 2025 at 08:25:34PM -0700, Randy Dunlap wrote:
On 9/9/25 6:57 PM, Bagas Sanjaya wrote:
quoted
+.. _pe-coff-entry-point:
+
+PE/COFF entry point
+===================
+
+When compiled with ``CONFIG_EFI_STUB=y``, the kernel can be executed as a
+regular PE/COFF binary. See Documentation/admin-guide/efi-stub.rst for
+implementation details.
+
+The stub loader can request the initrd via a UEFI protocol. For this to work,
+the firmware or bootloader needs to register a handle which implements the
+``EFI_LOAD_FILE2`` protocol with the ``LINUX_EFI_INITRD_MEDIA_GUID`` device
+path. In this case, a kernel booting via the EFI stub will use the ``LoadFile``
+function on the registered handle to obtain a reference to the initrd.
drivers/firmware/efi/libstub/efi-stub-helper.c (line 509) says LoadFile2
protocol. Is that the same as the LoadFile function?
https://github.com/u-boot/u-boot/commit/ec80b4735a593961fe701cc3a5d717d4739b0fd0
(the link below) also says LoadFile2() 4 times (and LoadFile 0 times).
From UEFI spec [1], both LoadFile and LoadFile2 protocol versions of LoadFile()
function has same prototype but somewhat different in behavior. To answer
your question, however, I think so.
EFI folks, what are your opinions?
Thanks.
[1]: https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html
--
An old man doll... just what I always wanted! - Clara