public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] Universal UEFI ELF payload for SBL
@ 2025-03-06  6:36 Stepan via groups.io
  2025-03-06  6:43 ` Stepan via groups.io
  0 siblings, 1 reply; 4+ messages in thread
From: Stepan via groups.io @ 2025-03-06  6:36 UTC (permalink / raw)
  To: devel


[-- Attachment #1.1: Type: text/plain, Size: 1705 bytes --]

Hello EDK II community,

We are currently trying to build universal payload in ELF format and load it by SBL. The changes that we have made to the platform description file are available in this topic ( https://edk2.groups.io/g/devel/topic/110868214 ).

We are following the following steps:

Building universal payload: python UefiPayloadPkg/UniversalPayloadBuild.py -a X64 -b DEBUG -t GCC5 (build log available in attachments).

Building SBL with ELF payload: python BuildLoader.py build adls -p "OsLoader.efi:LLDR:Lz4;UEFIPAYLOAD.elf:UEFI:Lzma" (build log available in attachments).

Stitching SBL bin and IFWI, flashing into chip and trying load.

We are use debugger and view that:
NormalBootPath() (/sbl/BootloaderCorePkg/Stage2/Stage2.c) loads payload ( Dst = (UINT32 *)(UINTN)PreparePayload (Stage2Param) ), check format ( IsElfFormat ((CONST UINT8 *)Dst) ) and jump into LoadElfPayload().
LoadElfPayload() (/sbl/BootloaderCommonPkg/Library/UniversalPayloadLib/UniversalPayloadLib.c) parses elf image by ParseElfImage() (/sbl/BootloaderCommonPkg/Library/ElfLib/ElfLib.c) and fills ELF_IMAGE_CONTEXT structure.

During the parsing, we noticed that ImageAddress and PreferredImageAdress are 0x0. This is the reason why LoadElfImage() returns EFI_INVALID_PARAMETER.

Can You help us understand what our mistake is?


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121154): https://edk2.groups.io/g/devel/message/121154
Mute This Topic: https://groups.io/mt/111543703/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #1.2: Type: text/html, Size: 3474 bytes --]

[-- Attachment #2: 01.png --]
[-- Type: image/png, Size: 77598 bytes --]

[-- Attachment #3: 02.png --]
[-- Type: image/png, Size: 58602 bytes --]

[-- Attachment #4: 11.png --]
[-- Type: image/png, Size: 101538 bytes --]

[-- Attachment #5: 12.png --]
[-- Type: image/png, Size: 89660 bytes --]

[-- Attachment #6: 13.png --]
[-- Type: image/png, Size: 101494 bytes --]

[-- Attachment #7: 14.png --]
[-- Type: image/png, Size: 72827 bytes --]

[-- Attachment #8: 03.png --]
[-- Type: image/png, Size: 57567 bytes --]

[-- Attachment #9: 04.png --]
[-- Type: image/png, Size: 52855 bytes --]

[-- Attachment #10: 05.png --]
[-- Type: image/png, Size: 57600 bytes --]

[-- Attachment #11: 06.png --]
[-- Type: image/png, Size: 58470 bytes --]

[-- Attachment #12: 07.png --]
[-- Type: image/png, Size: 59203 bytes --]

[-- Attachment #13: 08.png --]
[-- Type: image/png, Size: 61283 bytes --]

[-- Attachment #14: 09.png --]
[-- Type: image/png, Size: 55474 bytes --]

[-- Attachment #15: 10.png --]
[-- Type: image/png, Size: 55402 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [edk2-devel] Universal UEFI ELF payload for SBL
  2025-03-06  6:36 [edk2-devel] Universal UEFI ELF payload for SBL Stepan via groups.io
@ 2025-03-06  6:43 ` Stepan via groups.io
  2025-03-13  3:55   ` Guo Dong via groups.io
  0 siblings, 1 reply; 4+ messages in thread
From: Stepan via groups.io @ 2025-03-06  6:43 UTC (permalink / raw)
  To: Stepan, devel


[-- Attachment #1.1: Type: text/plain, Size: 483 bytes --]

Copy of this topic on SBL forum here: https://groups.io/g/slimbootloader/topic/universal_uefi_elf_payload/111543737


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121155): https://edk2.groups.io/g/devel/message/121155
Mute This Topic: https://groups.io/mt/111543703/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #1.2: Type: text/html, Size: 1029 bytes --]

[-- Attachment #2: edk2_build.log.gz --]
[-- Type: application/gzip, Size: 67919 bytes --]

[-- Attachment #3: sbl_build.log.gz --]
[-- Type: application/gzip, Size: 27778 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] Universal UEFI ELF payload for SBL
  2025-03-06  6:43 ` Stepan via groups.io
@ 2025-03-13  3:55   ` Guo Dong via groups.io
  2025-03-18  8:42     ` Stepan via groups.io
  0 siblings, 1 reply; 4+ messages in thread
From: Guo Dong via groups.io @ 2025-03-13  3:55 UTC (permalink / raw)
  To: Stepan, devel

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

The universal payload ELF image text segment alignment was changed from 0x40 to 0x1000. The default file load location could not meet this requirement. So SBL need reload it to a different place (Previous SBL tries to avoid reload it for performance).  Below SBL adds reload support. https://github.com/slimbootloader/slimbootloader/pull/2407
It would be great if universal payload could revert to use old aliment value.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121194): https://edk2.groups.io/g/devel/message/121194
Mute This Topic: https://groups.io/mt/111543703/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 1971 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] Universal UEFI ELF payload for SBL
  2025-03-13  3:55   ` Guo Dong via groups.io
@ 2025-03-18  8:42     ` Stepan via groups.io
  0 siblings, 0 replies; 4+ messages in thread
From: Stepan via groups.io @ 2025-03-18  8:42 UTC (permalink / raw)
  To: Guo Dong, devel

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

Hello EDK2 community,

This topic can be considered closed. I use old commit ( 1301e0b47eb3b4212da384a34f23b68edaf1911e ), commits b3bfb8f22d43bd9577df85bec20e75eb2f659990 and e5d95c786b6f25d81d754cb1d1b439a8b5c2340c ( 0664c4e3b979f3b5d1279be4c250ec57938c6af3 ) fix our problem with ELF payload.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121209): https://edk2.groups.io/g/devel/message/121209
Mute This Topic: https://groups.io/mt/111543703/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 1179 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-18  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06  6:36 [edk2-devel] Universal UEFI ELF payload for SBL Stepan via groups.io
2025-03-06  6:43 ` Stepan via groups.io
2025-03-13  3:55   ` Guo Dong via groups.io
2025-03-18  8:42     ` Stepan via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox