SetupDesignGuide.pdf - Firmware Encoding Index
SetupDesignGuide.pdf - Firmware Encoding Index
SetupDesignGuide.pdf - Firmware Encoding Index
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Setup Design Guide<br />
DRAFT<br />
3<br />
Setup Build Infrastructure<br />
3.1 Setup Build Infrastructure Elements<br />
Many elements are involved in the building of a driver that uses the EFI Setup Infrastructure. No<br />
matter if the driver that is using EFI for configuration of a system board, a network device, or an<br />
embedded controller, they all will follow the same basic steps when assembling the components to<br />
leverage the EFI Setup Infrastructure.<br />
3.1.1 VFR Compiler<br />
Some of the things that the compiler is responsible for are the interpreting of the VFR keywords and<br />
converting them to IFR. The compiler is responsible for detecting situations in the VFR files that<br />
would otherwise cause an invalid binary format output.<br />
The command-line interface for the VFR compiler is:<br />
VFRCOMPILE [drive:][path]VfrSourceFile [drive:][path]StringFile<br />
The input to the compiler is the VFR source file and a Unicode string file. The VFR source file will<br />
contain VFR and likely make #include references to a separate global NVRAM mapping file. All of<br />
these are compiled into an output header file.<br />
The outputs of the compiler are header files that will be used by the driver which will export the data.<br />
3.1.2 NVRAM Mapping File<br />
Many of the op-codes associated with IFR are intended to save the user’s choice to some NV data<br />
location. To enable this feature, a map file must be created so that the EFI setup infrastructure knows<br />
where in an NVRAM variable the data must be stored. This map is also used by hardware specific<br />
drivers that might have configuration data stored in the NVRAM variable. For instance, when a driver<br />
has interest in the state of the SerialPortEnable setting, it will need to include this NVRAM<br />
mapping file to know at what offset this data is located.<br />
struct {<br />
UINT16<br />
SystemPassword[20];<br />
UINT16<br />
ModemInitializationString[60];<br />
UINT8<br />
SerialPortEnable;<br />
UINT16<br />
SamplePieceOfData;<br />
UINT32<br />
MyFavoriteNumber;<br />
} SystemNvRamMap;<br />
Note that the SystemNvRamMap is the name of the structure name that is used to reference data both<br />
for the drivers that are interested in their content and the VFR language itself. For instance, if a<br />
command to display the ModemInitializationString setting was to be written in VFR it might<br />
be done as follows:<br />
text<br />
text = SystemNvRamMap.ModemInitializationString;<br />
24