Eric -
See below:
From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Friday, August 22, 2014 12:40 AM
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: [edk2] HII ORDERED_LIST support
In DriverSampleDxe, the boot order item is listed in storage as:
UINT16 BootOrder[8];
And here is the ordered list which manipulates this item:
orderedlist
varid = MyIfrNVData.BootOrder,
prompt = STRING_TOKEN(0x006D),
help = STRING_TOKEN(0x0059),
option text = STRING_TOKEN(0x006F), value = 2, flags =
RESET_REQUIRED;
option text = STRING_TOKEN(0x006E), value = 1, flags =
RESET_REQUIRED;
option text = STRING_TOKEN(0x0070), value = 3, flags =
RESET_REQUIRED;
suppressif ideqval MyIfrNVData.BootOrderLarge == 0;
option text = STRING_TOKEN(0x0071), value = 4, flags =
RESET_REQUIRED;
endif
endlist;
This leads to a number of questions:
1) The BootOrder is defined as UINT16, but the UEFI specification clearly
states that an orderedlist will work on a buffer with one byte per container.
(See 29.2.5.4.8 where it says, "The set questions are stored as a Buffer with
one byte for each Container."
[[[Eric]]] Truly spec has this description but vfrcompile and browser not do
this check, also current code may already has samples which already violate
this rule, so I need more discussion to provide a good proposal for this case.
[TIM] I am not worried about the actual struct members. BootOrder is 16 bytes
(8 x sizeof(UINT16). So that means that MaxContainers will be 16, right? The
VFR spec says: "NOTE: maxcontainers is optional, and the default value depends
on the variable size defined by varid in vfrQuestionHeader" So it seems that,
even though the code will work, using UINT8 BootOrder[16] would be easier to
understand than UINT16 BootOrder[8]"
2) The option values are all integers. But the storage type of an ordered
list is a BUFFER. To me this implies (I haven't looked this up) that the value
an option is being used as the option for a single container. That makes sense,
but it is not the behavior described in the UEFI specification. Also, there
seems to be no way to create a value for a question of type buffer.
[[[Eric]]] no catch what's your mean is.
[TIM] For example, for "oneof" the value storage size is UINT8/UINT16/UINT32 or
UINT64. The value storage size for "checkbox" is BOOLEAN. But what is the value
storage size of "orderedlist" When I read the UEFI specification, the "value
storage size" of orderedlist is maxcontainers x sizeof(UINT8). So, if
maxcontainers is 16, then 16 bytes. BUT: the size of the value in an "option"
inside the "orderedlist" in these examples is sizeof(UINT8), not maxcontainers
x sizeof(UINT8).
According to the UEFI specification, as I read it today, the value in a
ONE_OF_OPTION is the value for the entire value storage, not just one byte of
the value storage. So every container in the ordered list value should be set
to 2 when the first "ONE_OF_OPTION" (in the example above) is selected by the
user.
But I do not believe this is what the EDK2 Form browser does today. I believe
that it only changes a single container to the value 2 (not the whole buffer).
3) Likewise, there seems to be no way to provide a default for an ordered
list.
[[[Eric]]] yes, ordered list opcode just base on the current option order to
set the default value. For your above example, the default value is 2,1,3,4.
[TIM] If I put a "default = 2" in the example above, will it set one container
to "2" or all containers to "2" Again, this is a problem with the way the
specification describes values for ordered list opcodes. It is fairly clear
that the EDK2 form browser takes a different approach than the current
specification.
Here is an example display:
Boot Order: [boot order 1] [boot order 2][boot order 3][boot order 4][boot
order 5][boot order 6][boot order 7][boot order 8]
Each [boot order x] is a container. If the user goes to [boot order 2] and uses
one of the ONE_OF_OPTION pre-defined values, does it change only [boot order 2]
or all [boot order x]? Now, what does the UEFI specification say should happen?
Tim
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel