Date
1 - 7 of 7
Is there a way to include a custom binary in EDK2 and load it in a UEFI driver?
mzktsn@...
Hello,
i was wondering if there is a way to embed somehow in the build process of the edk2 a custom binary and then be able to load it (read it) from a UEFI driver from C code. |
|
Guomin Jiang
You can use PEI Firmware Volume PPI or Firmware Volume2 Protocol to access content from firmware.
toggle quoted message
Show quoted text
https://uefi.org/sites/default/files/resources/PI_Spec_1_7_final_Jan_2019.pdf contain the information you need, the section you need read to get the information is Volume 3, Section 3.3.1 PEI Firmware Volume PPI and Section 3.4.1 Firmware Volume2 Protocol. I suggest you to read Section 3 Firmware Storage Code Definitions carefully so you can know the storage format. If you just need sample and just want to support you project quickly, you can search edk2 repository and edk2-platform repository for it. -----Original Message----- |
|
mzktsn@...
Hello Guomin,
Thank you very much for the information, i am about to read the specifications, although i thought that the functions described are used to extract files from a specific FV(files that are already there),.. my questions were one step behind, in terms on how could someone be able to insert a raw binary (or a file) from a local filesystem inside a Firmware Volume. Thanks |
|
Guomin Jiang
Please search the *.fdf file and add below content in the FV section.
toggle quoted message
Show quoted text
FILE RAW = {GUID} { Align = {Alignment} {File Path} } Where {GUID} is the identifier of the file, format is XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, you can refer any inf for it's format. You can use ```guidgen.exe``` from Microsoft to generate new GUID. Where {Alignment} is the boundary, can be 4k, 64k, or others. Where {File Path} is the relative path from you project root path. This is not the only format, you can refer https://www.gitbook.com/read/book/edk2-docs/edk-ii-fdf-specification 3.6 [FV] Sections for more information about it. -----Original Message----- |
|
mzktsn@...
Thanks!
|
|
Laszlo Ersek
On 04/30/20 19:02, mzktsn@... wrote:
Hello!I probably won't have much time to spend on this thread, but I'd suggest posting a minimal / self-contained reproducer, complete with DSC / FDF / INF file(s). Independently, some of the functions in "MdePkg/Include/Library/DxeServicesLib.h" might prove useful. Laszlo |
|
Guomin Jiang
I am busy recently and won't spend time on the thread until July.
toggle quoted message
Show quoted text
I suggest that you can search the source code and figure out how to use ReadFile() function, I think it is better that use ReadSection service to get the file content. Best Regards Guomin -----Original Message----- |
|