On Sun, 13 Sep 2015, Programmingkid wrote:
On Sep 13, 2015, at 5:50 PM, Bodo Eggert wrote:
> On Sun, 13 Sep 2015, Mark Cave-Ayland wrote:
>> On 11/09/15 19:01, Programmingkid wrote:
Mark, do you think it is possible for a QEMU command line option to
>> actually load the
>> saved OpenBIOS settings from a file and restore them into memory? I'm
>> thinking something
>> along the lines of -prom-memory <file name>.
>> From memory the reason this hasn't been done is because the NVRAM
> interface is used across multiple architectures and there hasn't been a
> solution devised that would work well enough for all of them. Then again
> as the BIOSs involved have continued to develop, it may be now that some
> of the issues can now be solved so it never hurts to ask on the -devel list.
I'm wondering, why wouldn't it be enough to memmap a nvram file instead of
mallocing (or whatever) the memory area?
What advantage does mmap() have over malloc()? I think malloc() is a lot more
familiar to use than mmap().
The advantage is that it's file-backed (optionally, but intended here).
Everything you write into that memory area will be automatically
saved and restored just like a nvram should be. At least, that's what the
documentation promises, I never used it myself, therefore I ask.
You make mmap() sound good. Maybe we should use it.