On 2014-10-31 00:16:07, Gao, Liming wrote: > Yes. EDKII variable assumes the variable storage at a physically map > location. This is a limitation. > > To work with current EDKII variable drivers, for Variable Read, PEI phase > also require to support it. So, you need to read variable storage to > memory in PEI Phase, and share it to DXE phase. For Variable Write, only > DXE phase requires it. So, you can implement FVB protocol to handle the > write operation in the cached memory and storage.
Well, we worked around this pretty nicely in OVMF when we wanted to serialize variables to/from the FAT parition. OvmfPkg/EmuVariableFvbRuntimeDxe creates the FVB in RAM. It uses to 'hooks' for reading/writing the FVB via this library: OvmfPkg/Include/Library/PlatformFvbLib.h When a write happens to the variable store, OVMF uses the FVB write hook to signal that the variables need to be serialized to the FAT FS. I'm disappointed that I was not able to make this system replace MdeModulePkg/Universal/Variable/EmuRuntimeDxe and DuetPkg/FSVariable because then we could always just use the single variable driver: MdeModulePkg/Universal/Variable/RuntimeDxe Now that QEMU/KVM has real flash support, I suppose that some parts of this code now has an expiration date in OVMF... (The desire to actually serialize the variables to/from disk is greatly diminished.) -Jordan > From: Narinder Dhillon [mailto:[email protected]] > Sent: Friday, October 31, 2014 12:12 PM > To: [email protected] > Subject: [edk2] Non-Volatile Variable Storage > > > > Hi All, > > > > I am attempting to implement a non-volatile variable storage in an eMMC > device. After about a week of looking around, I have come to the > realization that there is no such feature in edk2. > > Is this correct ? > > > > Looking at 'variable' drivers, it seems that the variable storage for both > volatile and non are assumed to be at a physically mapped location. I can > try to load this physical address by reading the block flash device and > copying its contents to this location before the 'variable' driver starts. > I will have to implement some shell command to save the changed contents > back to flash device. > > > > Does this sound reasonable or is there an easier way ? > > > > Where can I implement this driver to load the non-volatile variable store > before 'variable' driver starts ? > > > > Thanx. ------------------------------------------------------------------------------ _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
