[SeaBIOS] Saving a few bytes across a reboot
kevin at koconnor.net
Tue Jan 9 20:16:20 CET 2018
On Tue, Jan 09, 2018 at 02:02:52PM -0500, Stefan Berger wrote:
> On 01/09/2018 10:14 AM, Kevin O'Connor wrote:
> > On Tue, Jan 09, 2018 at 10:00:44AM -0500, Stefan Berger wrote:
> > > is it possible to save a few bytes, a pointer, across a reboot? I have
> > > tried to do this by allocating a memory chunk in the fsegement and storing
> > > the pointer there surrounded by 2 'magic' 32 bit values. When trying to find
> > > the magic values on reboot early in handle_post() it doesn't seem to find
> > > them anymore. Is there another memory segment where SeaBIOS could store the
> > > few bytes and find them again?
> > Didn't you have that implemented with the "Support Physical Presence
> > Interface Spec" patches you made back in 2015?
> Yes. Back then the bytes shared between BIOS and ACPI were located in a MMIO
> memory area of the TPM TIS, which was basically a hack to save the few bytes
> across reboot. This time we are trying to embed these bytes in the ACPI
> stream where it would be allocated similar to the log area for the TPM.
> Besides that there would be a QEMU ACPI table (with name 'QEMU') to get the
> address from for that memory area. An ACPI variable would also get that
> address and use it in the address field of OperationRegion().
I'm a bit confused by the above. QEMU dynamically generates the ACPI
tables today. So, why go through the hoops above - why not just
directly generate the ACPI table with whatever info you need? If you
need to have some storage across boots, why not create a virtual
device and have the ACPI code read/write to that virtual address? As
I understand it, this is already done for other devices in QEMU.
More information about the SeaBIOS