Re: [edk2] Booting an alternate BIOS

Subject: Re: [edk2] Booting an alternate BIOS

From: Wei Hu <wei@aristanetworks.com>

To: edk2-devel@lists.sourceforge.net

Date: 2012-06-29 07:06:34

Hi All,

I have yet another question. After I called the UEFI service function
SetVariable() to write a variable to the non-volatile variable storage
in the SPI flash, I would fail to read it back using GetVariable().

My theory is that I didn't update the cache setup and GetVariable() is
reading from CPU cache instead of the SPI flash itself. Is my theory
plausible, and usually where is cache setup done? I assume after
memory initialization is done, BIOS sets up cacheability for each
region in the entire memory space, doesn't it?


On Wed, Jun 27, 2012 at 7:00 AM, Brian J. Johnson  wrote:
> On 06/26/2012 08:41 PM, tey arn lee wrote:
>> For me, I will check the cache and cache-as-ram configuration.
>
> Specifically, make sure that the MTRRs are mapping the fallback PEI
> firmware volume as cacheable space. If they don't, the CPU defaults to
> fetching instructions uncached, which is really, really slow.
>
>> > From: wei@aristanetworks.com
>> > Date: Tue, 26 Jun 2012 16:53:55 -0700
>> > To: edk2-devel@lists.sourceforge.net
>> > Subject: [edk2] Booting an alternate BIOS
>> >
>> > Hello,
>> >
>> > My work is based on Intel proprietary BLDK, but its
>> > architecture-independent code is taken from the open source EDK II so
>> > I hope to find answers here.
>> >
>> > The goal is to ship two BIOS in a single flash image so that if the
>> > first broke the second one could still boot the system. I've been
>> > playing with the SEC and PEI modules to find a solution.
>> >
>> > I bundled a fallback BIOS and a normal BIOS into the final image file.
>> > The normal BIOS sits at the top of the memory and would just boot
>> > fine.
>> >
>> > Next I patched the last word of the image file, which holds the base
>> > address of the boot volume, to point to the boot volume in the
>> > fallback BIOS. This way when SecCore loads the PeiCore, it's tricked
>> > into searching for the module in the fallback BIOS instead of the
>> > normal BIOS. After the fallback PeiCore is loaded all code would be
>> > running from the fallback BIOS.
>> >
>> > The redirection worked, but for some reason the BIOS ran much slower,
>> > judging from the rate of the message printed to the serial console.
>> > Please advise what could have gone wrong and what changes need to be
>> > done besides simply patching the BFV base address. I'm new to the EDK
>> > II infrastructure. Any guide is appreciated!
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Live Security Virtual Conference
>> > Exclusive live event will cover all the ways today's security and
>> > threat landscape has changed and how IT managers can respond.
>> Discussions
>> > will include endpoint security, mobile security and the latest in
>> malware
>> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> > _______________________________________________
>> > edk2-devel mailing list
>> > edk2-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>
>>
>>
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>
>
> --
>
>                         Brian
>
> --------------------------------------------------------------------
>
>  "The answers we have found only serve to raise a whole set of new
>  questions. In some ways we feel we are as confused as ever, but we
>  are confused on a higher level and about more important things."
>                      -- Anonymous
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel