Thanks for your information.
My concern is that FTW driver should be dispatched before variable driver to
handle any illegal case. For example, a power failure may just occur after
variable storage is erased to FF, but before the defragmented variable data
is programmed, during the process of variable reclaim. Then in the next boot
circle, the variable driver can¡¯t handle this case but simply return error
(refer to VariableCommonInitialize() in variable.c). Even FaultTolerant
driver just has capability to handle this case, but it may have no chance to
run as the dispatching may stopped.
·¢ŒþÈË: Andrew Fish [mailto:***@apple.com]
·¢ËÍÊ±Œä: 2012Äê3ÔÂ31ÈÕ 23:15
Ö÷Ìâ: Re: [edk2] Question about FaultTolerantWriteDxe and VariableRuntimeDxe
It looks like edk2 Variable driver registers an event called
FtwNotificationEvent() so it can detect when the FaultTolerantWrite protocol
If you look at the variable driver when it installs it publishes
gEfiVariableArchProtocolGuid, and this combined with a dependency expression
of TRUE this gives read access to variables early in the DXE phase. When the
FTW protocol is available the variable driver publishes
This means if your DXE driver needs to write to the variable store it should
depend on gEfiVariableWriteArchProtocolGuid. If your driver only needs read
access it should depend on gEfiVariableArchProtocolGuid. This is defined in
the latest PI spec.
On Mar 31, 2012, at 4:33 AM, Hawk wrote:
Here is one question about the dispatcher order of FaultTolerantWriteDxe and
VariableRuntimeDxe under MdeModulePkg\Universal\Variable\RuntimeDxe.
As you know VariableRuntime driver needs to use the protocol
¡°EFI_FAULT_TOLERANT_WRITE_PROTOCOL¡± to reclaim the storage space, which is
produced by FaultTolerantWriteDxe, when the variable storage is full. So our
understanding is FaultTolerantWriteDxe should be dispatched before
VariableRuntimeDxe to recover from illegal state in DXE phase, if there is
any unexpected failure occurs in reclaim process. But we observed this
requirement is not explicitly defined in dependency of VariableRuntimeDxe.
Is there any other consideration about this?
BTW, With EDK codebase, we can observed that this is just done in this way.
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here