Date
1 - 4 of 4
EFI_UNSUPPORTED for async read/write to disk
petermeier2525@...
Dear EDK2 community
We're developing an application and need to write asynchronously to disk. This fails on all machines we are using with the error message EFI_UNSUPPORTED.
Maybe you can help in two areas:
- what does EFI_UNSUPPORTED mean in this context? I couldn't find it in the documentation for the file protocol.
- can you gather any insights from the code below which would help us to fix this?
A snippet of the code we're using (not sure if only this helps to analyse the situation:
if (status = root->OpenEx(root, (void**)&systemFile, (CHAR16*)SYSTEM_DATA_FILE_NAME, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0, &systemFileIOToken))
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
and another one:
if (systemSavingStage)
{
if (systemFileIOToken.Status != -1)
{
switch (systemSavingStage)
{
case 1:
{
if (systemFileIOToken.Status)
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
systemSavingStage = 0;
}
Thanks a lot
Peter
We're developing an application and need to write asynchronously to disk. This fails on all machines we are using with the error message EFI_UNSUPPORTED.
Maybe you can help in two areas:
- what does EFI_UNSUPPORTED mean in this context? I couldn't find it in the documentation for the file protocol.
- can you gather any insights from the code below which would help us to fix this?
A snippet of the code we're using (not sure if only this helps to analyse the situation:
if (status = root->OpenEx(root, (void**)&systemFile, (CHAR16*)SYSTEM_DATA_FILE_NAME, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0, &systemFileIOToken))
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
and another one:
if (systemSavingStage)
{
if (systemFileIOToken.Status != -1)
{
switch (systemSavingStage)
{
case 1:
{
if (systemFileIOToken.Status)
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
systemSavingStage = 0;
}
Thanks a lot
Peter
Brian J. Johnson
Peter,
I'm not sure what programming environment or API you're using... it would help if you could report what UEFI protocols are being used at the bottom of your implementation. "root->OpenEx()" is not a UEFI interface.
In general, you need to be on a system which implements the EFI_BLOCK_IO2_PROTOCOL to write asynchronously to disk. The older EFI_BLOCK_IO_PROTOCOL is synchronous. It looks like that was added in UEFI spec 2.3.1. If your machines implement an older spec version, or don't implement EFI_BLOCK_IO2_PROTOCOL for some other reason, then asynchronous disk I/O won't be possible.
Running "dh -p BlockIo2" from the shell should show you if you have any EFI_BLOCK_IO2_PROTOCOL handlers on the devices you're using. If not, then that's your problem. If so, you'll have to debug it through your programming environment.
Hope that helps.
Brian J. Johnson
toggle quoted message
Show quoted text
I'm not sure what programming environment or API you're using... it would help if you could report what UEFI protocols are being used at the bottom of your implementation. "root->OpenEx()" is not a UEFI interface.
In general, you need to be on a system which implements the EFI_BLOCK_IO2_PROTOCOL to write asynchronously to disk. The older EFI_BLOCK_IO_PROTOCOL is synchronous. It looks like that was added in UEFI spec 2.3.1. If your machines implement an older spec version, or don't implement EFI_BLOCK_IO2_PROTOCOL for some other reason, then asynchronous disk I/O won't be possible.
Running "dh -p BlockIo2" from the shell should show you if you have any EFI_BLOCK_IO2_PROTOCOL handlers on the devices you're using. If not, then that's your problem. If so, you'll have to debug it through your programming environment.
Hope that helps.
Brian J. Johnson
-------- Original Message --------
From: petermeier2525@...
Sent: Thursday, September 22, 2022, 7:25 AM
To: discuss@edk2.groups.io
Subject: [edk2-discuss] EFI_UNSUPPORTED for async read/write to disk
Dear EDK2 community
We're developing an application and need to write asynchronously to disk. This fails on all machines we are using with the error message EFI_UNSUPPORTED.
Maybe you can help in two areas:
- what does EFI_UNSUPPORTED mean in this context? I couldn't find it in the documentation for the file protocol.
- can you gather any insights from the code below which would help us to fix this?
A snippet of the code we're using (not sure if only this helps to analyse the situation:
if (status = root->OpenEx(root, (void**)&systemFile, (CHAR16*)SYSTEM_DATA_FILE_NAME, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0, &systemFileIOToken))
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
and another one:
if (systemSavingStage)
{
if (systemFileIOToken.Status != -1)
{
switch (systemSavingStage)
{
case 1:
{
if (systemFileIOToken.Status)
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
systemSavingStage = 0;
}
Thanks a lot
Peter
From: petermeier2525@...
Sent: Thursday, September 22, 2022, 7:25 AM
To: discuss@edk2.groups.io
Subject: [edk2-discuss] EFI_UNSUPPORTED for async read/write to disk
Dear EDK2 community
We're developing an application and need to write asynchronously to disk. This fails on all machines we are using with the error message EFI_UNSUPPORTED.
Maybe you can help in two areas:
- what does EFI_UNSUPPORTED mean in this context? I couldn't find it in the documentation for the file protocol.
- can you gather any insights from the code below which would help us to fix this?
A snippet of the code we're using (not sure if only this helps to analyse the situation:
if (status = root->OpenEx(root, (void**)&systemFile, (CHAR16*)SYSTEM_DATA_FILE_NAME, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0, &systemFileIOToken))
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
and another one:
if (systemSavingStage)
{
if (systemFileIOToken.Status != -1)
{
switch (systemSavingStage)
{
case 1:
{
if (systemFileIOToken.Status)
{
logStatus(L"EFI_FILE_PROTOCOL.OpenEx() fails", status);
systemSavingStage = 0;
}
Thanks a lot
Peter
Fabian Wabbel <fabian.wabbel@...>
Hi Lior
Thanks a lot for getting back to me.
This is part of the EFI_FILE_PROTOCOL:
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#efi-file-protocol
EFI_FILE_PROTOCOL.Open() (
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#efi-file-protocol-open
)
works well and
EFI_FILE_PROTOCOL.OpenEx() (
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#efi-file-protocol-openex
)
doesn't.
Conceptually, as the former works, that latter should as well, right?
Do you have any sources where I could go? Unfortunately, EFI is not
Javascript and one doesn't find many contacts and info on that matter.
(additionally, EFI_UNSUPPORTED is not documented as a status code for
EFI_FILE_PROTOCOL.OpenEx. Does it fall back to a standard massage?)
Thanks a lot
Peter
toggle quoted message
Show quoted text
Thanks a lot for getting back to me.
This is part of the EFI_FILE_PROTOCOL:
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#efi-file-protocol
EFI_FILE_PROTOCOL.Open() (
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#efi-file-protocol-open
)
works well and
EFI_FILE_PROTOCOL.OpenEx() (
https://uefi.org/specs/UEFI/2.10/13_Protocols_Media_Access.html#efi-file-protocol-openex
)
doesn't.
Conceptually, as the former works, that latter should as well, right?
Do you have any sources where I could go? Unfortunately, EFI is not
Javascript and one doesn't find many contacts and info on that matter.
(additionally, EFI_UNSUPPORTED is not documented as a status code for
EFI_FILE_PROTOCOL.OpenEx. Does it fall back to a standard massage?)
Thanks a lot
Peter
On Fri, 23 Sept 2022 at 10:18, lior <liorshalmay1@...> wrote:
Hello Peter,
Probably 'EFI_UNSUPPORTED' means that there is no driver on the system
that handles the protocol.
If that is the case, try to load a driver that supports this protocol,
using the `load` command in UEFI shell.
I am not familiar with this protocol so I cannot provide further help.
Lior