Reputation: 99
I used gnu-efi.
I do not understand how to simply read file.
I understand about using the BlockIOProtocol.
Could you tell us along with a simple example?
Upvotes: 3
Views: 2823
Reputation: 6735
I don't have a simple example handy, sorry. But in general you proceed like this
EfiMain
you have an IMAGE_HANDLE
of your loaded imageLOADED_IMAGE_PROTOCOL
on the image handle to obtain an device handle of the device this image was loaded from (= the EFI partition)SIMPLE_FILE_SYSTEM_PROTOCOL
on the device handle to call OpenVolume
, which will give you a EFI_FILE
of the filesystem rootOpen
on the root to open your file and Read
on the resulting handle to read from it.Hope this helps.
Upvotes: 6