From: Udit Kumar <udit.kumar@nxp.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Accessing global variables from Shell
Date: Mon, 3 Jul 2017 07:18:44 +0000 [thread overview]
Message-ID: <DB3PR04MB0761C798CA38A3A82ABB8A7E91D60@DB3PR04MB0761.eurprd04.prod.outlook.com> (raw)
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
next reply other threads:[~2017-07-03 7:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-03 7:18 Udit Kumar [this message]
2017-07-03 18:13 ` Accessing global variables from Shell Laszlo Ersek
2017-07-04 4:33 ` Udit Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB3PR04MB0761C798CA38A3A82ABB8A7E91D60@DB3PR04MB0761.eurprd04.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox