On 05/20/15 05:29, lidonglin wrote:
> Hi all:
> I want to know what's the differece between FD_SIZE_1MB and
> FD_SIZE_2MB. For example, I build release ovmf whose size is 1MB
> default. It can work. That's just as I should be. And I build release
> ovmf with additional parameter -D FD_SIZE_2MB. It also can work. Who
> can explain the difference between them?

The difference between the two flags is that the various firmware
volumes, and the final flash device image that contains them,
accordingly, will have twice as much room with FD_SIZE_2MB than with
FD_SIZE_1MB. The double room is / may be necessary due to various
build-time decisions, such as:

- "-b DEBUG" vs. "-b RELEASE" -- driver binaries are larger when built
  for DEBUG,

- "-a IA32        -p OvmfPkg/OvmfPkgIa32.dsc" vs.
  "-a IA32 -a X64 -p OvmfPkg/OvmfPkgIa32X64.ds" vs.
  "-a X64         -p OvmfPkg/OvmfPkgX64.dsc" -- 64-bit binaries are
  larger than 32-bit binaries,

- build time feature flags:
  "-D SOURCE_DEBUG_ENABLE",
  "-D SECURE_BOOT_ENABLE",
  "-D NETWORK_IP6_ENABLE",
  "-D CSM_ENABLE", etc -- additional features imply additional drivers
  and libraries, taking up more space.

So, the only reasonable *form* I can imagine for your question is:

  "why would I want the 1MB size flash device image, rather than the
  2MB one, ever?"

The answer is, "you wouldn't".

I don't remember why we still make the 1MB flash device image size the
default under some circumstances -- probably out of basic frugality.

Historically, only the 1MB FD size had been supported. Occasionally it
proved too little -- as the features listed above were being introduced
and were simultaneously enabled at build time, we sometimes ran out of
space in the firmware volumes. So a decision was made to allow a 2MB FD
size, but we didn't change the default (for all configs) at once.

(You can run "git blame" and "git log" on the FDF files...)

Personally, I never bother to build (except maybe for testing the build
itself) with "-b RELEASE", which implies that all my builds end up with
a 2MB FD size.

If you'd like to understand the details of the FD structure, please see:

- EDK II FDF File Spec
  http://tianocore.sourceforge.net/wiki/EDK_II_Specifications

- OvmfPkg/OvmfPkg.fdf.inc,

- OvmfPkg/OvmfPkg*.fdf (any one of those will be sufficient to look at),

- section "Firmware image structure" in
  http://www.linux-kvm.org/downloads/lersek/ovmf-whitepaper-c770f8c.txt

Thanks
Laszlo

> 
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to