VFR 1 9
VFR 1 9
Revision 1.9
THIS SPECIFICATION IS PROVIDED “AS IS” WITH NO WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF
MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANY WARRANTY OTHERWISE
ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. Except for a limited copyright license to copy this
specification for internal use only, no license, express or implied, by estoppel or otherwise, to any intellectual property
rights is granted herein.
Intel disclaims all liability, including liability for infringement of any proprietary rights, relating to implementation of
information in this specification. Intel does not warrant or represent that such implementation(s) will not infringe such
rights.
Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or
“undefined.” Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or
incompatibilities arising from future changes to them.
This document is an intermediate draft for comment only and is subject to change without notice. Readers should not
design products based on this document.
Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United
States and other countries.
*Other names and brands may be claimed as the property of others.
Copyright © 2007 – 2015 Intel Corporation. All rights reserved.
2
Contents
1 Introduction ...................................................................................................... 1
1.1 Overview ............................................................................................... 1
1.2 Assumed Knowledge ................................................................................ 1
1.3 Related Information ................................................................................. 1
1.4 Terms .................................................................................................... 1
2 VFR Description in BNF ....................................................................................... 3
2.1 VFR Programming Keywords ..................................................................... 4
2.2 VFR Program .......................................................................................... 4
2.3 VFR Data Struct Definition ...................................................................... 5
2.4 VFR FormSet Definition .......................................................................... 8
2.5 VFR FormSet List Definition ...................................................................... 9
2.6 VFR Default Stores Definition .................................................................. 9
2.7 VFR Variable Store Definition ...................................................................10
2.7.1 VFR Buffer Store Definition ....................................................... 10
2.7.2 VFR EFI Variable Store Definition ................................................10
2.7.3 VFR Variable Name Store Definition ............................................ 11
2.8 VFR FormSet DisableIf Definition............................................................. 11
2.9 VFR FormSet SuppressIf Definition .......................................................... 11
2.10 VFR General Token Definition ................................................................. 12
2.10.1 GUID Definition ....................................................................... 12
2.10.2 String & String Identifier Definition ..............................................12
2.10.3 Number Definition ................................................................... 12
2.10.4 VFR Statement Header Definition ............................................... 13
2.10.5 VFR Question Header Definition ................................................. 13
2.10.6 VFR Constant Value Definition ................................................... 14
2.10.7 VFR Statement Image & Locked Tag Definition ..............................14
2.11 VFR Form Definition .............................................................................. 15
2.11.1 VFR Form Map Definition .......................................................... 15
2.11.2 VFR Image Statement Definition ................................................ 16
2.11.3 VFR Locked Statement Definition.................................................16
2.11.4 VFR Rule Statement Definition ................................................... 16
2.11.5 VFR Statement Definition .......................................................... 16
2.11.6 VFR Question Type Statements Definition .................................... 23
2.11.7 VFR Conditional Type Statements Definition ................................. 42
2.11.8 VFR GUID Statement Definition ................................................. 43
2.11.9 VFR Modal Statement Definition ................................................. 46
2.12 VFR Expression Statement Definition ....................................................... 48
2.12.1 OR ........................................................................................ 48
2.12.2 AND ........................................................................................48
2.12.3 bitwiseor ................................................................................ 48
2.12.4 bitwiseand ...............................................................................48
2.12.5 equal .......................................................................................49
2.12.6 compare ..................................................................................49
2.12.7 shift ........................................................................................49
2.12.8 add/minus ...............................................................................49
2.12.9 multiply/divide/modulo ..............................................................50
2.12.10 cast terms .............................................................................. 50
3
2.12.11 atom terms ............................................................................ 51
4
Revision History
1.1 Update some syntax and fix some February 20, 2008
literal issues
1.5 Update efi varstore syntax, add modal, August 31, 2011
refresh event group and REF5 opcode,
and add EFI_HII_REF data type to
support UEFI 2.3.1 HII IFR opcodes,
corrects Time statement example.
Minor editing and formatting
1.7 Clarify restriction that enum type and May 18, 2012
struct data filed with more than one
dimensions array are not supported.
5
6
1
Introduction
1.1 Overview
Internal Forms Representation (IFR) is a binary encoding. This encoding is designed to
be comparatively easy to parse and to manipulate programmatically.
This document is a reference manual for developers adopting the VFR language to
create products compliant with current UEFI Specification. It offers enough material to
create infrastructure files for the user interface, and to create a driver to export setup-
related information to the Human Interface Infrastructure programming interface.
1.4 Terms
The following terms are used throughout this document to describe varying aspects of
input localization:
BNF
BNF is an acronym for “Backus Naur Form.” John Backus and
Peter Naur introduced for the first time a formal notation to
describe the syntax of a given language.
HII
Human Interface Infrastructure. This generally refers to the
database that contains string, font, and IFR information along with
other pieces that use one of the database components.
1
Introduction
IFR
Internal Forms Representation. This is the binary encoding that is
used for the representation of user interface pages.
VFR
Visual Forms Representation. This is the source code format that is
used by developers to create a user interface with varying pieces
of data or questions. This is later compiled into a binary encoding
2
2
VFR Description in BNF
This section describes a language for developers to use when writing forms. This
language is compiled into an architectural form (i.e., IFR) described in the UEFI
Specification. Each section describes a different language terminal or non-terminal.
Note: The text formatting of the VFR statements and examples in this
document are consistent with BNF-style conventions rather than with
EFI or UEFI conventions.
VFR forms consist of a series of VFR statements. The subsections in this chapter
designate the base definitions of the different VFR statements by specifying the
keyword “Statement” in the section title, followed by the BNF non-terminal name
enclosed in parentheses.
Subsections without the “Statement” keyword in the title are non-terminal definitions
referenced by one or more of the VFR statement definitions.
• Terms are case-sensitive. VFR comments start with “//” and end at the end of
the line.
Example: a comment line:
// this is a typical comment marker
• If the parenthesis is followed by a plus “+” sign, then the term must be present
one or more times.
3
VFR Description in BNF
ideqvallistExp ::=
"ideqvallist"
vfrQuestionDataFieldName "==" ( Number )+
• A superscript number,” n”, followed by a comma “,“ and another number, “m”,
such as item{n, m} is used to indicate that the number of occurrences can be from
n to m occurrences of the item, inclusive.
Example: there could be 1 to 8 hexadecimal characters in “Hex8”:
Hex8 ::=
"0x"["0"-"9""A"-"F""a"-"f"]{1,8}
// (comment marker)
This allows a programmer to leave comments in the VFR file. They have no effect on
the IFR binary that is generated. Example:
// this is a typical comment marker
#define
This command is used to assign a meaningful name to a constant, and is very similar
in function to the ‘C’ style. Example:
#define FORMSET_GUID \
{0xA04A27f4,0xDF00,0x4D42,0xB5,0x52,0x39,0x51,0x13,0x02,0x11,0x3D}
#include
This command tells the VFR compiler to use the contents of a file as part of the source
to compile.
Example:
#include “C:\Source\ DriverSampleStrDefs.h”
10
VFR Description in BNF
vfrProgram ::=
(
vfrPragmaPackDefinition
| vfrDataStructDefinition
)*
vfrFormSetDefinition
vfrPragmaPackDefinition ::=
"#pragma" "pack" "(" vfrPragmaPackType ")"
vfrPragmaPackType ::=
{
"show"
| ( "push" | "pop" ) { "," StringIdentifier } { "," Number }
| { Number }
}
The data structure must be defined before formset statements. The pragma pack
number must be the second power of 2.
Example: None.
vfrDataStructFields ::=
(
dataStructField64
| dataStructField32
| dataStructField16
| dataStructField8
| dataStructFieldBool
| dataStructFieldString
| dataStructFieldDate
| dataStructFieldTime
| dataStructFieldRef
| dataStructFieldUser
)*
dataStructField64 ::=
"UINT64"
StringIdentifier { "[" Number "]" } ";"
5
VFR Description in BNF
dataStructField32 ::=
"UINT32"
StringIdentifier { "[" Number "]" } ";"
dataStructField16 ::=
"UINT16"
StringIdentifier { "[" Number "]" } ";"
dataStructField8 ::=
"UINT8"
StringIdentifier { "[" Number "]" } ";"
dataStructFieldBool ::=
"BOOLEAN"
StringIdentifier { "[" Number "]" } ";"
dataStructFieldString ::=
"EFI_STRING_ID"
StringIdentifier { "[" Number "]" } ";"
dataStructFieldDate ::=
"EFI_HII_DATE"
StringIdentifier { "[" Number "]" } ";"
dataStructFieldTime ::=
"EFI_HII_TIME"
StringIdentifier { "[" Number "]" } ";"
dataStructFieldRef ::=
"EFI_HII_REF"
StringIdentifier { "[" Number "]" } ";"
dataStructFieldUser ::=
StringIdentifier StringIdentifier { "[" Number "]" } ";"
The data structure definition is in C-style language. enum type is not supported. The
keyword of the fields’ type must be a user defined data structure or one of these
types: UINT8 UINT16 UINT32 UINT64 BOOLEAN EFI_STRING_ID EFI_HII_DATA
EFI_HII_TIME EFI_HII_REF, and at most one-dimensional array is permitted
Example:
typedef struct {
UINT8 mU8;
UINT16 mU16;
UINT32 mU32[10];
UINT64 mU64;
} MyData;
6
VFR Description in BNF
typedef enum {
MyEnumValue1,
MyEnumValue2,
MyEnumValueMax
} MyEnum;
7
VFR Description in BNF
typedef struct {
UINT8 mU8;
UINT32 mU32[10][20];
} MyUnsupportedData;
classguidDefinition ::=
guidDefinition { "|" guidDefinition } { "|" guidDefinition }
classDefinition ::=
validClassNames ( "|" validClassNames )*
validClassNames ::=
"NON_DEVICE"
| "DISK_DEVICE"
| "VIDEO_DEVICE"
| "NETWORK_DEVICE"
| "INPUT_DEVICE"
| "ONBOARD_DEVICE"
| "OTHER_DEVICE"
| Number
subclassDefinition ::=
"SETUP_APPLICATION"
| "GENERAL_APPLICATION"
| "FRONT_PAGE"
| "SINGLE_USE"
| Number
8
VFR Description in BNF
In the formset, there can be more than one form of variable stores and default stores.
The formset can control whether to process an individual form by nesting it inside of
an EFI_IFR_DISABLE_IF expression.
The variable stores and default stores must be defined before being referenced.
Example: None.
9
VFR Description in BNF
Note: name and guid are used jointly to specify the variable store.
Example:
varstore MyData, name = RefName, guid = FORMSET_GUID;
Note: name and guid are used jointly to specify the efi variable store.
1
VFR Description in BNF
Example:
efivarstore EfiDataStructure
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS,
name = EfiData,
guid = GUID;
Example:
namevaluevarstore NameValueVarStore,
name = STRING_TOKEN(STR_NAMEVALUE_TABLE_ITEM1),
name = STRING_TOKEN(STR_NAMEVALUE_TABLE_ITEM2),
name = STRING_TOKEN(STR_NAMEVALUE_TABLE_ITEM3),
guid = GUID;
11
VFR Description in BNF
Hex4 ::=
"0x"["0"-"9""A"-"F""a"-"f"]{1,4}
Hex2 ::=
"0x"["0"-"9""A"-"F""a"-"f"]{1,2}
guidSubDefinition ::=
Hex2 "," Hex2 "," Hex2 "," Hex2 ","
Hex2 "," Hex2 "," Hex2 "," Hex2
guidDefinition ::=
"{"
Hex8 "," Hex4 "," Hex4 ","
(
"{" guidSubDefinition "}"
| guidSubDefinition
)
"}"
In practice, the VFR only supports GUIDs in a C-style language structure. It is defined
as two 32-bit values, followed by two 16-bit values, followed by eight 1-byte values.
getStringId ::=
"STRING_TOKEN" "(" Number ")"
1
VFR Description in BNF
questionheaderFlagsField ::=
"READ_ONLY"
| "INTERACTIVE"
| "RESET_REQUIRED"
| "OPTIONS_ONLY"
vfrStorageVarId ::=
( StringIdentifier "[" Number "]" )
|
(
StringIdentifier
(
"." StringIdentifier { "[" Number "]" }
)*
)
Note: questionid is used to specify the question ID. If it is not defined, the
compiler automatically assigns a unique ID.
Example: None.
13
VFR Description in BNF
vfrLockedTag ::=
"locked"
vfrStatementStatTag ::=
vfrImageTag | vfrLockedTag
vfrStatementStatTagList ::=
vfrStatementStatTag ( "," vfrStatementStatTag )*
1
VFR Description in BNF
Note: formid must be unique for each form statement in a given formset.
Example:
None.
Note: formid must be unique for each form statement in a given formset.
Example:
15
VFR Description in BNF
None.
Example:
rule MyRule, 1 + 2
endrule;
1
VFR Description in BNF
vfrSubtitleFlags ::=
subtitleFlagsField ( "|" subtitleFlagsField )* ";"
subtitleFlagsField ::=
Number
| "HORIZONTAL"
Example:
17
VFR Description in BNF
subtitle
text = STRING_TOKEN(STR_SUBTITLE_TEXT),
flags = HORIZONTAL;
subtitle
text = STRING_TOKEN(STR_SUBTITLE_TEXT),
text
help = STRING_TOKEN(STR_TEXT_TEXT),
text = STRING_TOKEN(STR_TEXT_TEXT);
flags = RESET_REQUIRED,
key = 0x0001;
endsubtitle;
staticTextFlagsField ::=
Number
| questionheaderFlagsField
Example:
Generates EFI_IFR_TEXT:
text
help = STRING_TOKEN(STR_TEXT_TEXT),
text = STRING_TOKEN(STR_TEXT_TEXT);
Generates EFI_IFR_ACTION:
1
VFR Description in BNF
text
help = STRING_TOKEN(STR_TEXT_TEXT),
text = STRING_TOKEN(STR_TEXT_TEXT);
flags = RESET_REQUIRED,
key = 0x0001;
19
VFR Description in BNF
vfrGotoFlags ::=
gotoFlagsField ( "|" gotoFlagsField )*
gotoFlagsField ::=
Number
| questionheaderFlagsField
2
VFR Description in BNF
goto 1,
prompt = STRING_TOKEN(STR_GOTO_PROMPT),
help = STRING_TOKEN(STR_GOTO_HELP);
key = 0x1234;
Generate EFI_IFR_REF2
goto
formid = 1,
question = QuesttionRef,
prompt = STRING_TOKEN(STR_GOTO_PROMPT),
help = STRING_TOKEN(STR_GOTO_HELP);
Generate EFI_IFR_REF3
goto
formsetguid = FORMSET_GUID,
formid = 1,
question = QuesttionRef,
prompt = STRING_TOKEN(STR_GOTO_PROMPT),
help = STRING_TOKEN(STR_GOTO_HELP);
Generate EFI_IFR_REF4
goto
devicepath = STRING_TOKEN(STR_DEVICE_PATH),
formsetguid = FORMSET_GUID,
formid = 1,
question = QuesttionRef,
prompt = STRING_TOKEN(STR_GOTO_PROMPT),
help = STRING_TOKEN(STR_GOTO_HELP);
21
VFR Description in BNF
goto 1,
prompt = STRING_TOKEN(STR_GOTO_PROMPT),
help = STRING_TOKEN(STR_GOTO_HELP),
refresh interval = 3
;
2
VFR Description in BNF
Example:
resetbutton
defaultstore = DefaultStoreRef,
prompt = STRING_TOKEN(STR_RESET_BUTTON_PROMPT),
help = STRING_TOKEN(STR_RESET_BUTTON_HELP),
endresetbutton;
23
VFR Description in BNF
Example:
checkbox
name = MyCheckBox,
varid = MySTestData.mField1,
questionid = 0xcb,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT | INTERACTIVE,
inconsistentif
prompt = STRING_TOKEN(STR_INCONSISTENT_IF),
ideqval MySTestData.mField1 == 2007
endif
endcheckbox;
Example:
checkbox
name = MyCheckBox,
varid = MySTestData.mField1,
questionid = 0xcb,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT | INTERACTIVE,
None.
2
VFR Description in BNF
Example:
checkbox
name = MyCheckBox,
varid = MySTestData.mField1,
questionid = 0xcb,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT | INTERACTIVE,
disableif
ideqvallist MySTestData.mField1 == 1 3 5 7;
refresh interval = 1
endif
endcheckbox;
Example:
25
VFR Description in BNF
Example:
checkbox
name = MyCheckBox,
varid = MySTestData.mField1,
questionid = 0xcb,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT | INTERACTIVE,
varstoredevice = STRING_TOKEN(STR_VARSTOREDEVICE),
endcheckbox;
Example:
numeric
varid = MySTestData.mField2,
prompt = STRING_TOKEN(STR_NUMERIC_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP),
flags = DISPLAY_UINT_HEX,
minimum = 0,
maximum = 300,
step = 0,
refreshguid = EFI_IFR_REFRESH_ID_OP_GUID,
default = 175,
endnumeric;
2
VFR Description in BNF
Example:
checkbox
name = MyCheckBox,
varid = MySTestData.mField1,
questionid = 0xcb,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT | INTERACTIVE,
27
VFR Description in BNF
Example:
default = 1,
default value = 1 + 2,
default = {1,2,3},
None.
Example:
Value = 0;
2
VFR Description in BNF
vfrOneOfOptionFlags ::=
oneofoptionFlagsField ( "|" oneofoptionFlagsField )*
oneofoptionFlagsField ::=
Number
| "OPTION_DEFAULT"
| "OPTION_DEFAULT_MFG"
| "INTERACTIVE"
| "RESET_REQUIRED"
| "DEFAULT"
These statements can be used to give the possible value and set the default value for
questions. In other words, they are not questions, but they influence the questions
they embellish. Therefore, the options’ flags are treated as question flags and can
accept all values of question flags.
Options with the DEFAULT flags can be used to set the default value for questions.
Example:
None.
Example:
None
None.
29
VFR Description in BNF
Example:
None
vfrCheckBoxFlags ::=
checkboxFlagsField ( "|" checkboxFlagsField )*
checkboxFlagsField ::=
Number
| "CHECKBOX_DEFAULT"
| "CHECKBOX_DEFAULT_MFG"
| questionheaderFlagsField
3
VFR Description in BNF
Example:
checkbox
name = MyCheckBox,
varid = MySTestData.mField1,
prompt = STRING_TOKEN(STR_CHECK_BOX_PROMPT),
help = STRING_TOKEN(STR_CHECK_BOX_HELP),
flags = CHECKBOX_DEFAULT | INTERACTIVE,
default = TRUE,
endcheckbox;
vfrActionFlags ::=
actionFlagsField ( "|" actionFlagsField )*
actionFlagsField ::=
Number
| questionheaderFlagsField
31
VFR Description in BNF
Example:
action
prompt = STRING_TOKEN(STR_ACTION_PROMPT),
help = STRING_TOKEN(STR_ACTION_HELP),
flags = INTERACTIVE,
config = STRING_TOKEN(STR_ACTION_CONFIG),
endaction;
vfrSetMinMaxStep ::=
"minimum" "=" Number ","
"maximum" "=" Number ","
{ "step" "=" Number "," }
vfrNumericFlags ::=
numericFlagsField ( "|" numericFlagsField )*
numericFlagsField ::=
Number
| "NUMERIC_SIZE_1"
| "NUMERIC_SIZE_2"
| "NUMERIC_SIZE_4"
| "NUMERIC_SIZE_8"
| "DISPLAY_INT_DEC"
| "DISPLAY_UINT_DEC"
| "DISPLAY_UINT_HEX"
| questionheaderFlagsField
Note: flags is optional, and the default value partly depends on the size of
varid defined in vfrQuestionHeader.
3
VFR Description in BNF
Example:
numeric
varid = STestData.mField2,
prompt = STRING_TOKEN(STR_NUMERIC_PROMPT),
help = STRING_TOKEN(STR_NUMERIC_HELP),
flags = DISPLAY_UINT_HEX,
minimum = 0,
maximum = 300,
step = 0,
default = 175,
endnumeric;
vfrOneofFlagsField ::=
numericFlagsField ( "|" numericFlagsField )*
Note: flags is optional, and the default value partly depends on the size of
varid defined in vfrQuestionHeader syntax.
Example:
33
VFR Description in BNF
oneof
varid = STestData.mField3[0],
prompt = STRING_TOKEN(STR_ONE_OF_PROMPT),
help = STRING_TOKEN(STR_ONE_OF_HELP),
flags = DISPLAY_UINT_DEC,
vfrStringFlagsField ::=
stringFlagsField ( "|" stringFlagsField )*
stringFlagsField ::=
Number
| "MULTI_LINE"
| questionheaderFlagsField
Example:
3
VFR Description in BNF
string
varid = STestData.mField1,
prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
help = STRING_TOKEN(STR_MY_STRING_HELP),
flags = MULTI_LINE,
minsize = 6,
maxsize = 0x14,
endstring;
vfrPasswordFlagsField ::=
passwordFlagsField ( "|" passwordFlagsField )*
passwordFlagsField ::=
Number
| questionheaderFlagsField
35
VFR Description in BNF
Example:
password
varid = STestData.mPrivate.mField2,
prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
help = STRING_TOKEN(STR_PASSWORD_HELP),
minsize = 6,
maxsize = 20,
endpassword;
vfrOrderedListFlags ::=
orderedlistFlagsField ( "|" orderedlistFlagsField )*
orderedlistFlagsField ::=
Number
| "UNIQUE"
| "NOEMPTY"
| questionheaderFlagsField
Example:
orderedlist
varid = STestPriData.mField3,
prompt = STRING_TOKEN(STR_BOOT_OPTIONS),
help = STRING_TOKEN(STR_BOOT_OPTIONS),
3
VFR Description in BNF
( vfrStatementInconsistentIf )*
)
)
"enddate" ";"
minMaxDateStepDefault ::=
"minimum" "=" Number ","
"maximum" "=" Number ","
{ "step" "=" Number "," }
{ "default" "=" Number "," }
vfrDateFlags ::=
dateFlagsField ( "|" dateFlagsField )*
dateFlagsField ::=
Number
| "YEAR_SUPPRESS"
| "MONTH_SUPPRESS"
| "DAY_SUPPRESS"
| "STORAGE_NORMAL"
| "STORAGE_TIME"
| "STORAGE_WAKEUP"
There are old and new syntax of the VFR Date statement, but they are incompatible.
The old VFR Date only uses EFI Date/Time Storage, instead of normal question value
storage. The new VFR Date can use either the normal question value storage or EFI
Date/Time Storage.
37
VFR Description in BNF
For the new syntax of VFR, flags is optional, and the default value is 0. Examples
follow.
3
VFR Description in BNF
39
VFR Description in BNF
( vfrStatementInconsistentIf )*
)
)
"endtime" ";"
minMaxTimeStepDefault ::=
"minimum" "=" Number ","
"maximum" "=" Number ","
{ "step" "=" Number "," }
{ "default" "=" Number "," }
vfrTimeFlags ::=
timeFlagsField ( "|" timeFlagsField )*
timeFlagsField ::=
Number
| "HOUR_SUPPRESS"
| "MINUTE_SUPPRESS"
| "SECOND_SUPPRESS"
| "STORAGE_NORMAL"
| "STORAGE_TIME"
| "STORAGE_WAKEUP"
There are old and new syntax of VFR Time statements. They are incompatible.
• New: VFR Time can use either the normal question value storage or EFI
Date/Time Storage.
4
VFR Description in BNF
• Old: VFR Date can use only EFI Date/Time Storage, instead of normal question
value storage.
In the new syntax of VFR, flags is optional, and the default value is 0. Example:
41
VFR Description in BNF
4
VFR Description in BNF
43
VFR Description in BNF
4
VFR Description in BNF
Example:
label LABEL_START;
label LABEL_END;
Example:
banner
title = STRING_TOKEN(STR_BANNER_TITLE),
line 1,
align center;
45
VFR Description in BNF
vfrExtensionData ::=
(
"," "data" { "[" Number "]" }
(
"." StringIdentifier { "[" Number "]" }
)*
"=" Number
)*
The generic guidop statement is used to specify user extension opcodes. By default,
unassigned byte will be zero. The array number in the "data" part cannot be equal to
or larger than the one in the "datatype" part. That is, the array index starts from zero.
Example:
guidop
guid = GUID,
datatype = UINT32,
data = 0x12345678;
4
VFR Description in BNF
47
VFR Description in BNF
Example:
modal;
The syntax of VFR expression is defined as a tree. The positions in the tree are
determined according to the priority of the operator (for example: + - * /). At the root
of it are the terms of OR, followed by the terms of AND, because the priority of
operator OR is lower than the operator AND(s). The leaves of the tree are sub-
expressions of built-in-functions, unary operators, ternary operators, and constants.
2.12.1 OR
vfrStatementExpression ::=
andTerm ( "OR" andTerm )*
2.12.2 AND
andTerm ::=
bitwiseorTerm ( "AND" bitwiseorTerm )*
2.12.3 bitwiseor
bitwiseorTerm ::=
bitwiseandTerm ( "|" bitwiseandTerm )*
2.12.4 bitwiseand
bitwiseandTerm ::=
equalTerm ( "&" equalTerm )*
4
VFR Description in BNF
2.12.5 equal
equalTerm ::=
compareTerm
(
"==" compareTerm
| "!=" compareTerm
)*
2.12.6 compare
compareTerm ::=
shiftTerm
(
"<" shiftTerm
| "<=" shiftTerm
| ">" shiftTerm
| ">=" shiftTerm
)*
2.12.7 shift
shiftTerm ::=
addMinusTerm
(
"<<" addMinusTerm
| ">>" addMinusTerm
)*
2.12.8 add/minus
addMinusTerm ::=
multdivmodTerm
(
"+" multdivmodTerm
| "-" multdivmodTerm
)*
49
VFR Description in BNF
2.12.9 multiply/divide/modulo
multdivmodTerm ::=
castTerm
(
"*" castTerm
| "/" castTerm
| "%" castTerm
)*
The VFR supports the C-style type conversion. The values can be converted into one of
the following types: BOOLEAN UINT64 UINT32 UINT16 UINT8.
5
VFR Description in BNF
2.12.11.1 catenate
vfrExpressionCatenate ::=
"catenate"
"(" vfrStatementExpression "," vfrStatementExpression ")"
51
VFR Description in BNF
Example:
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
inconsistentif prompt = STRING_TOKEN(STR_CHECK),
pushthis != catenate(stringref(STRING_TOKEN(STR_STRING_RIGHT)),
stringref(STRING_TOKEN(STR_STRING_LEFT))),
endif
endstring;
2.12.11.2 match
vfrExpressionMatch ::=
"match"
"(" vfrStatementExpression "," vfrStatementExpression ")"
Example:
grayoutif match (stringref(STRING_TOKEN(STR_PATTERN)),
stringref(STRING_TOKEN(STR_STRING)))
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 243,
endnumeric;
endif;
2.12.11.3 parenthesis
vfrExpressionParen ::=
"(" vfrStatementExpression ")"
5
VFR Description in BNF
2.12.11.4.1 dup
dupExp ::=
"dup"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 0xf0,
default value = 2 + dup,
endnumeric;
2.12.11.4.2 ideqval
ideqvalExp ::=
"ideqval"
vfrQuestionDataFieldName "==" Number
Example:
53
VFR Description in BNF
2.12.11.4.3 ideqid
ideqidExp ::=
"ideqid"
vfrQuestionDataFieldName "==" vfrQuestionDataFieldName
Example:
grayoutif ideqid MyData.Data2 == MyData.Data3;
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 0xf0,
endnumeric;
endif;
2.12.11.4.4 ideqvallist
ideqvallistExp ::=
"ideqvallist"
vfrQuestionDataFieldName "==" ( Number )+
5
VFR Description in BNF
Example:
grayoutif ideqvallist MyData.Data1 == 1 3;
numeric name = MyNumeric,
varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 0xf0,
endnumeric;
endif;
2.12.11.4.5 questionref
questionref1Exp ::=
"questionref"
"(" StringIdentifier | Number ")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 0xf0,
default value = questionref (MyNumeric),
endnumeric;
2.12.11.4.6 ruleref
rulerefExp ::=
"ruleref" "(" StringIdentifier ")"
Example:
55
VFR Description in BNF
grayoutif ruleref(MyRule) == 1;
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
endstring;
endif;
2.12.11.4.7 stringref
stringref1Exp ::=
"stringref" "(" getStringId ")"
5
VFR Description in BNF
Example:
grayoutif stringref(STRING_TOKEN(STR_STRING)) == 1;
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
endstring;
endif;
2.12.11.4.8 pushthis
pushthisExp ::=
"pushthis"
Example:
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
inconsistentif prompt = STRING_TOKEN(STR_CHECK),
pushthis != stringref(STRING_TOKEN(STR_STRING))
endif
endstring;
2.12.11.4.9 security
securityExp ::=
"security" "(" guidDefinition ")"
Example:
grayoutif NOT security (EFI_GUID);
text
help = STRING_TOKEN(STR_HELP),
text = STRING_TOKEN(STR_TEXT);
endif;
2.12.11.4.10 get
getExp ::=
"get" "(" vfrStorageVarId { "|" "flags" "=" vfrNumericFlags } ")"
57
VFR Description in BNF
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
read get(MyData.Data1);
endnumeric;
2.12.11.5 constant
vfrExpressionConstant ::=
"TRUE"
| "FALSE"
| "ONE"
| "ONES"
| "ZERO"
| "UNDEFINED"
| "VERSION"
| Number
2.12.11.6.1 length
lengthExp ::=
"length" "(" vfrStatementExpression ")"
5
VFR Description in BNF
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value =
length(stringref(STRING_TOKEN(STR_STRING))),
endnumeric;
2.12.11.6.2 bitwisenot
bitwisenotExp ::=
"~" "(" vfrStatementExpression ")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value =
~(length(stringref(STRING_TOKEN(STR_STRING)))),
endnumeric;
2.12.11.6.3 questionrefval
question23refExp ::=
"questionrefval"
"("
{
DevicePath "=" "STRING_TOKEN" "\(" S:Number "\)" ","
}
{
Uuid "=" guidDefinition[Guid] ","
}
vfrStatementExpression
")"
59
VFR Description in BNF
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = questionrefval(QuestionID),
endnumeric;
2.12.11.6.4 stringrefval
stringref2Exp ::=
"stringrefval" "(" vfrStatementExpression ")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = length(stringrefval(STR_STRING)),
endnumeric;
2.12.11.6.5 boolval
toboolExp ::=
"boolval" "(" vfrStatementExpression ")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = boolval(12),
endnumeric;
2.12.11.6.6 stringval
tostringExp ::=
"stringval" { "format" "=" Number "," }
"(" vfrStatementExpression ")"
6
VFR Description in BNF
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = length(stringval(format = 8, 12)),
endnumeric;
2.12.11.6.7 unintval
unintExp ::=
"unintval" "(" vfrStatementExpression ")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = unintval(12 * 3),
endnumeric;
2.12.11.6.8 toupper
toupperExp ::=
"toupper" "(" vfrStatementExpression ")"
Example:
grayoutif length(toupper(stringref(STRING_TOKEN(STR_STRING))))==1;
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
endstring;
endif;
2.12.11.6.9 tolower
tolwerExp ::=
"tolower" "(" vfrStatementExpression ")"
61
VFR Description in BNF
Example:
grayoutif length(tolower(stringref(STRING_TOKEN(STR_STRING))))==2;
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
endstring;
endif;
2.12.11.6.10 set
setExp ::=
"set"
"("
vfrStorageVarId { "|" "flags" "=" vfrNumericFlags } ","
vfrStatementExpression
")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
write set(MyData.Data1,10);
endnumeric;
2.12.11.7.1 cond
conditionalExp ::=
"cond"
"("
vfrStatementExpression1
"?"
vfrStatementExpression2
":"
vfrStatementExpression3
")"
6
VFR Description in BNF
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = cond(2 == 1 ? 5 : 10),
endnumeric;
2.12.11.7.2 find
findExp ::=
"find"
"("
findFormat ( "|" findFormat )*
","
vfrStatementExpression
","
vfrStatementExpression
","
vfrStatementExpression
")"
findFormat ::=
"SENSITIVE"
| "INSENSITIVE"
Example:
63
VFR Description in BNF
2.12.11.7.3 mid
midExp ::=
"mid"
"("
vfrStatementExpression
","
vfrStatementExpression
","
vfrStatementExpression
")"
6
VFR Description in BNF
Example:
grayoutif length(mid(stringref(STRING_TOKEN(STR_STRING)),6,8))==1;
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
endstring;
endif;
2.12.11.7.4 tok
tokenExp ::=
"token"
"("
vfrStatementExpression
","
vfrStatementExpression
","
vfrStatementExpression
")"
Example:
65
VFR Description in BNF
grayoutif length(token(stringref(STRING_TOKEN(STR_STRING1)),
stringref(STRING_TOKEN(STR_STRING2)), 0)) == 2;
string varid = MyData.String,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minsize = 6,
maxsize = 40,
endstring;
endif;
2.12.11.7.5 span
spanExp ::=
"span"
"("
"flags" "=" spanFlags ( "|" spanFlags )*
","
vfrStatementExpression
","
vfrStatementExpression
","
vfrStatementExpression
")"
spanFlags ::=
Number
| "LAST_NON_MATCH"
| "FIRST_NON_MATCH"
6
VFR Description in BNF
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = span(flags = LAST_NON_MATCH,
stringref(STRING_TOKEN(STR_STRING1)),
stringref(STRING_TOKEN(STR_STRING2)),0),
endnumeric;
2.12.11.8 map
vfrExpressionMap ::=
"map"
"("
vfrStatementExpression
":"
(
vfrStatementExpression
","
vfrStatementExpression
";"
)*
")"
Example:
numeric varid = MyData.Data,
prompt = STRING_TOKEN(STR_PROMPT),
help = STRING_TOKEN(STR_HELP),
minimum = 0,
maximum = 255,
default value = map(pushthis:0,10;1,2;3,5;6,8;),
endnumeric;
2.12.11.9 match2
vfrExpressionMatch ::=
"match2"
"(" vfrStatementExpressionPattern ","
vfrStatementExpressionString ","
guidDefinition[Guid] ")"
Example:
67
VFR Description in BNF