public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Accessing global variables from Shell
@ 2017-07-03  7:18 Udit Kumar
  2017-07-03 18:13 ` Laszlo Ersek
  0 siblings, 1 reply; 3+ messages in thread
From: Udit Kumar @ 2017-07-03  7:18 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Dear Edk2, 

I am trying to create one global variables, and access that from shell. 
If I am using gEfiGlobalVariableGuid to create variable then I could access it perfectly ok ,  If I use other Guid (even vendor guid) then I couldn't access from shell. 

Original code 
STATIC CONST CHAR16           myVar[] = L"MacUniqueId";
Status = gRT->SetVariable ((CHAR16 *)myVar,
                    &gEfiCallerIdGuid,
                    EFI_VARIABLE_NON_VOLATILE |
                     EFI_VARIABLE_BOOTSERVICE_ACCESS |
                     EFI_VARIABLE_RUNTIME_ACCESS, Size,

On shell 
FS0:\> setvar MacUniqueId -guid C9DCF469-A7C4-11D5-87DA-00062945C3B9
setvar: Unable to get - C9DCF469-A7C4-11D5-87DA-00062945C3B9 - MacUniqueId
FS0:\> setvar MacUniqueId
setvar: Unable to get - 8BE4DF61-93CA-11D2-AA0D-00E098032B8C - Hello


When I changed the guid to gEfiGlobalVariableGuid
STATIC CONST CHAR16           myVar[] = L"MacUniqueId";
Status = gRT->SetVariable ((CHAR16 *)myVar,
                    &gEfiGlobalVariableGuid,
                    EFI_VARIABLE_NON_VOLATILE |
                     EFI_VARIABLE_BOOTSERVICE_ACCESS |
                     EFI_VARIABLE_RUNTIME_ACCESS, Size,
I could access it 
FS0:\> setvar MacUniqueId
8BE4DF61-93CA-11D2-AA0D-00E098032B8C - MacUniqueId - 0004 Bytes
42 FF 7A AF

Thanks for suggestion. 

Regards
Udit


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-04  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03  7:18 Accessing global variables from Shell Udit Kumar
2017-07-03 18:13 ` Laszlo Ersek
2017-07-04  4:33   ` Udit Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox