Date   

Re: Compile EDK2 to set boot order to PXE EFI_LOAD_OPTION

Andrew Fish
 

Werner,

From a UEFI Specification point of view the boot policy is controlled by NVRAM variables. The variables in EFI have a GUID/UUID and a Unicode string name. The variables owned by the UEFI Spec use the gEfiGlobalVariableGuid [1] namespace. The BootOrder variable is an array of UINT16 values that map into Boot##### variables. The ##### is the hex values of the BootOrder Entry. The Boot#### use an EFI_LOAD_OPTION [2] that contains an EFI_DEVICE_PATH_PROTOCOL. The EFI_DEVICE_PATH_PROTOCOL will point to the boot device and then a path for the file to boot.

The common way this works is an OS is installed on a system and the OS installer writes the nvram variable to point to the OS loader on the EFI System Partition. The Firmware BDS will carry some defaults (platform defined) and will typically default the variables based on some platform policy. The UI you launch from the BDS to boot likely will write the BootOrder (or reorder it) and add the Boot#### variables.

Also the old style PXE boot was more about telling the network what kind of device you are and the UUID and have the server send you back something useful. In this case the EFI_DEVICE_PATH_PROTOCOL is just going to point to the MAC address of the NIC. I think booting from files is more of an iPXE iSCSI kind of thing.

If you `git grep BootOrder` it looks like the ArmVirtPkg and OvmfPkg are doing work to set boot defaults that might be interesting for your work. The BootMaintenanceManagerUiLib is the UI to set the variables/boot policy.

Sorry this is just generic background and not the specific answer to your problem but the products I work on use a custom BDS so I don’t know the open source answer off the top of my mind. Maybe some one else will have a more specific answer.

Feel free to ask questions if you get stuck on specific bits of the solution like how to create the EFI_DEVICE_PATH_PROTOCOL.

[1] #define EFI_GLOBAL_VARIABLE \
{0x8BE4DF61,0x93CA,0x11d2,\
{0xAA,0x0D,0x00,0xE0,0x98,0x03,0x2B,0x8C}}

[2] This is a variable sized structure that you may need to lookup in the UEFI Spec see 3.1.3 : https://uefi.org/sites/default/files/resources/UEFI%20Spec%202.8B%20May%202020.pdf

Good Luck,

Andrew Fish

On Jan 29, 2021, at 2:45 PM, wernerbuck@gmail.com wrote:

Hi,

I am network booting the raspberry pi firmware. Unfortunately as its loaded from TFTP it does not retain settings nor do I believe I can give it settings.
I am already compiling my own version of RPi4 uefi with edk-platforms/../Rpi4/.dsc edited for some better defaults like setting higher memory.
However, I can't find an option to force a particular boot option as a default. Right now it tries to boot an .efi locally but that efi is not able to be found because we are booting from TFTP.
Instead I would like it to boot to PXE again where I can boot iPXE and control the boot process further. The end goal here is that I can boot UEFI -> iPXE without an SD card.

Could you help me find out what option/variable I can set in the platform dsc? I think the option should be in MdePkg.dec but I can't find any "DefaultBootOption" or override variable.

Kind regards,

Werner Buck





Re: [EXTERNAL] [edk2-discuss] Compile EDK2 to set boot order to PXE

Bret Barkelew
 

I think it’s actually going to be in MdeModulePkg under BDS (maybe MdeModulePkg/Universal/BdsDxe?). There’s also the BootManagerPolicyDxe and a few other libs that get used, but I’d have to dig into the code to name the exact place.

- Bret

From: wernerbuck via groups.io<mailto:wernerbuck=gmail.com@groups.io>
Sent: Tuesday, February 2, 2021 3:57 AM
To: discuss@edk2.groups.io<mailto:discuss@edk2.groups.io>
Subject: [EXTERNAL] [edk2-discuss] Compile EDK2 to set boot order to PXE

Hi,

I am network booting the raspberry pi firmware. Unfortunately as its loaded from TFTP it does not retain settings nor do I believe I can give it settings.
I am already compiling my own version of RPi4 uefi with edk-platforms/../Rpi4/.dsc edited for some better defaults like setting higher memory.
However, I can't find an option to force a particular boot option as a default. Right now it tries to boot an .efi locally but that efi is not able to be found because we are booting from TFTP.
Instead I would like it to boot to PXE again where I can boot iPXE and control the boot process further. The end goal here is that I can boot UEFI -> iPXE without an SD card.

Could you help me find out what option/variable I can set in the platform dsc? I think the option should be in MdePkg.dec but I can't find any "DefaultBootOption" or override variable.

Kind regards,

Werner Buck


Re: Compile EDK2 to set boot order to PXE

Laszlo Ersek
 

adding Pete and Ard

On 01/29/21 23:45, wernerbuck@gmail.com wrote:
Hi,

I am network booting the raspberry pi firmware. Unfortunately as its loaded from TFTP it does not retain settings nor do I believe I can give it settings.
I am already compiling my own version of RPi4 uefi with edk-platforms/../Rpi4/.dsc edited for some better defaults like setting higher memory.
However, I can't find an option to force a particular boot option as a default. Right now it tries to boot an .efi locally but that efi is not able to be found because we are booting from TFTP.
Instead I would like it to boot to PXE again where I can boot iPXE and control the boot process further. The end goal here is that I can boot UEFI -> iPXE without an SD card.

Could you help me find out what option/variable I can set in the platform dsc? I think the option should be in MdePkg.dec but I can't find any "DefaultBootOption" or override variable.

Kind regards,

Werner Buck


Re: Understanding about each package inside EDK2 repo.

Laszlo Ersek
 

Hi,

On 02/02/21 07:16, gauravpandya321@gmail.com wrote:
Hello Everyone,
Where is the best place to get information about each package in EDK2 repo for a beginner. I want to understand what functionality each package provides, documentation about each package.
the edk2 wiki seems to have an intro text for each package; for example:

https://github.com/tianocore/tianocore.github.io/wiki/MdePkg

Thanks
Laszlo


Understanding about each package inside EDK2 repo.

gauravpandya321@...
 

Hello Everyone,
Where is the best place to get information about each package in EDK2 repo for a beginner. I want to understand what functionality each package provides, documentation about each package.

Thanks.


Compile EDK2 to set boot order to PXE

wernerbuck@...
 

Hi,

I am network booting the raspberry pi firmware. Unfortunately as its loaded from TFTP it does not retain settings nor do I believe I can give it settings.
I am already compiling my own version of RPi4 uefi with edk-platforms/../Rpi4/.dsc edited for some better defaults like setting higher memory.
However, I can't find an option to force a particular boot option as a default. Right now it tries to boot an .efi locally but that efi is not able to be found because we are booting from TFTP.
Instead I would like it to boot to PXE again where I can boot iPXE and control the boot process further. The end goal here is that I can boot UEFI -> iPXE without an SD card.

Could you help me find out what option/variable I can set in the platform dsc? I think the option should be in MdePkg.dec but I can't find any "DefaultBootOption" or override variable.

Kind regards,

Werner Buck


Re: Loading second PCI driver on the same PCI device hangs the system.

Laszlo Ersek
 

On 02/01/21 14:38, UdayS via groups.io wrote:
Hi,
I have two pci drivers (1) full driver with all functionality, (2) Driver which subset of (1).
Both drivers are working fine. Load/Unload at run time smoothly works when each of them are done independently.

Issue:
1. Load driver (1) and unload (1) now if I load driver (2), shell hangs.

I have verified loading/unloading of driver, multiple iterations, i.e. it cleanups all protocols installed.
But if I follow the issue procedure above, it hangs. I don't see error during initialization of second driver.

Need advise to debug this issue further.

Thank in advance.
Unloading driver (1) could leave the hardware in such a state that
driver (1) can deal with, when loaded (again), but driver (2) cannot,
when loaded (for the first time after (1)).

Laszlo


Re: what's the conditions of submodule updating

Laszlo Ersek
 

On 02/02/21 03:14, wenyi,xie via groups.io wrote:
Hi all,
May I ask a question.
In what conditions will we update submodules. Will we update the sbumodule when it only fixes a vulnerability, or any other conditions should be meet before updating.
I don't think we've formalized this. I would think: we update a
submodule when there's a reason to. Important bugfix (security or
otherwise), or a new feature that we'd like to consume in an edk2 module.

Just my impressions.

Thanks
Laszlo


Re: 'PciIO->Map' is returning "EFI_OUT_OF_RESOURCES" on Intel CRB device

Laszlo Ersek
 

On 02/01/21 11:14, udai16787 via [] wrote:
Small Update:
I could fix the issue by moving the PCI->Map little early in the initialization but couldn't root cause it yet.
Could be that the portion of the address space that PciIo->Map() can
deal with gets fragmented in the part of code that you have now
eliminated, by moving the call earlier.

Laszlo


what's the conditions of submodule updating

wenyi,xie
 

Hi all,
May I ask a question.
In what conditions will we update submodules. Will we update the sbumodule when it only fixes a vulnerability, or any other conditions should be meet before updating.


Loading second PCI driver on the same PCI device hangs the system.

UdayS
 

Hi,
I have two pci drivers (1) full driver with all functionality, (2) Driver which subset of (1).
Both drivers are working fine. Load/Unload at run time smoothly works when each of them are done independently.

Issue:
1. Load driver (1) and unload (1) now if I load driver (2), shell hangs.

I have verified loading/unloading of driver, multiple iterations, i.e. it cleanups all protocols installed.
But if I follow the issue procedure above, it hangs. I don't see error during initialization of second driver.

Need advise to debug this issue further.

Thank in advance.


Re: edk2 build failure due to long paths

rajesh.ravi@broadcom.com
 

Thanks a lot Laszlo.

Regards,
Rajesh

On Thu, Jan 28, 2021 at 09:50 AM, Laszlo Ersek wrote:


Laszlo


Re: 'PciIO->Map' is returning "EFI_OUT_OF_RESOURCES" on Intel CRB device

UdayS
 

Small Update:
I could fix the issue by moving the PCI->Map little early in the initialization but couldn't root cause it yet.


Re: 回复: [edk2-discuss] edk2 build failure due to long paths

rajesh.ravi@broadcom.com
 

Thanks a lot gaoliming.

Regards,
Rajesh

On Thu, Jan 28, 2021 at 04:57 PM, gaoliming wrote:


BZ https://bugzilla.tianocore.org/show_bug.cgi?id=3032 has been fixed at
020ec963048340c9eaf9799471167d769239bcfc


Exposing new block IO handle to Platform BIOS

sanket.goswami@...
 

I'm working on a drivers for a storage controller. In it I install block IO protocol on each drive connected to the controller. Some of these drives may have OS in them.
These block IO handles are child handles of the controller handle.

In some scenarios I need to reinstall block IO protocol on the drives. This happens after boot when user changes the driver's configuration from BIOS menu.
Once I uninstall a block IO handle any driver using this block IO handle(e.g. Disk IO driver) with EFI_OPEN_PROTOCOL_BY_DRIVER attribute will be disconnected from this device.

1. when I install block IO again then Should I call boot service ConnectController to connect this block IO handle to all drivers in system?
I tried calling ConnectController service with recursive flag '-r' but it takes very long to complete the operation. So don't want to do it if it's not necessary.

2. If I want to do connect controller for only some specific drivers like disk IO driver, Is it ok to do it?
Because some drivers like partition driver use Disk IO handle to created child handle for each partition.
So if I connect to just Disk IO driver will the Partition driver and FAT system driver discover this new DiskIO handle and create partition handles and file system for it?

If I don't call connect controller service after reinstallation of Block IO protocol, the platform BIOS doesn't install partitions and file system on the bootable drive.

Thanks,
Sanket


回复: [edk2-discuss] edk2 build failure due to long paths

gaoliming
 

BZ https://bugzilla.tianocore.org/show_bug.cgi?id=3032 has been fixed at 020ec963048340c9eaf9799471167d769239bcfc

Can you try the latest edk2?

-----邮件原件-----
发件人: bounce+34241+490+4905953+8764802@groups.io
<bounce+34241+490+4905953+8764802@groups.io> 代表 Laszlo Ersek
发送时间: 2021年1月29日 1:51
收件人: discuss@edk2.groups.io; rajesh.ravi@broadcom.com
主题: Re: [edk2-discuss] edk2 build failure due to long paths

On 01/28/21 10:29, rajesh.ravi@broadcom.com via groups.io wrote:
I 'm facing edk2 build issues on Linux build hosts when path length is long.

*Example scenarios*
Eg. A) manual/standalone builds: If edk2 code base is deep inside a
directory path instead of $HOME dir
B)Yocto builds: when SRCREV_FORMAT contains multiple
components
making the uefi path very long.

*Source code*

It seems the following files are to support longer file paths and resolve
such issues.
*BaseTools/Source/Python/Common/LongFilePath*.py*

If so, please suggest how to enable longer file paths for edk2 builds on
Linux build host
You may have hit <https://bugzilla.tianocore.org/show_bug.cgi?id=3032>.

Thanks
Laszlo





Re: edk2 build failure due to long paths

Laszlo Ersek
 

On 01/28/21 10:29, rajesh.ravi@broadcom.com via groups.io wrote:
I 'm facing edk2 build issues on Linux build hosts when path length is long.

*Example scenarios*
Eg. A) manual/standalone builds: If edk2 code base is deep inside a
directory path instead of $HOME dir
B)Yocto builds: when SRCREV_FORMAT contains multiple components
making the uefi path very long.

*Source code*

It seems the following files are to support longer file paths and resolve
such issues.
*BaseTools/Source/Python/Common/LongFilePath*.py*

If so, please suggest how to enable longer file paths for edk2 builds on
Linux build host
You may have hit <https://bugzilla.tianocore.org/show_bug.cgi?id=3032>.

Thanks
Laszlo


edk2 build failure due to long paths

rajesh.ravi@broadcom.com
 

I 'm facing edk2 build issues on Linux build hosts when path length is long.

*Example scenarios*
Eg. A) manual/standalone builds: If edk2 code base is deep inside a
directory path instead of $HOME dir
B)Yocto builds: when SRCREV_FORMAT contains multiple components
making the uefi path very long.

*Source code*

It seems the following files are to support longer file paths and resolve
such issues.
*BaseTools/Source/Python/Common/LongFilePath*.py*

If so, please suggest how to enable longer file paths for edk2 builds on
Linux build host
--
Regards,
Rajesh


HTTP Requests from UEFI Shell are denied access to HTTP Server

huynhhai323@...
 

Hi,

My name is Hayden. I am working on communications between a machine running only the UEFI Shell and an external server via HTTP Protocol. The Shell binary I am using is built from ShellPkg in the stable/202011 stable release. The issue I am facing is that both the http command binary (also built from ShellPkg in stable/202011) and HttpUtil program (source code attached with this post; written by me, based on the sample code on page 1548-1553 in the UEFI Spec 2.8B May 2020 document) were denied access to my HTTP server. Execution quitted whenever the Request function of the HttpProtocol instance was reached and a status of 15 (EFI_ACCESS_DENIED) is returned. Both machines are connected to the same network via the Catalyst 2960 Plus switch and they can ping each other seamlessly every time. I have also attached a zip containing files used to set up my simple HTTP server using NodeJS.

Any recommendations or advice would be greatly appreciated. And please do not hesitate to contact me if you need more information.

Best regards,
Hayden


GDB server does not start.

joseph@...
 

It seems to be connected to DebugAgent, but the gdb server does not start.
I am using Hyper-V Generation 2.

==================================================
UEFI Shell:

disconnect (serial)
load -nc DebugAgentDxe.efi
Debug Agent: Initialized successfully!

Image 'FS1:\DebugAgentDxe.efi' loaded at F6C91000 - Success

==================================================
udk-gdb-server Log: (Can see also in https://pastebin.pl/view/ee5a1bc9 )

Intel(R) UEFI Development Kit Debugger Tool Version 1.5.1
Debugging through TCP (localhost:11001)
===Configuration===
Debug Port:
BaudRate =
Channel = TCP
Redirect Target output to TCP port (20715)
FlowControl =
Port = 11001
Server = localhost
Features:
TerminalRedirectionPort = 20715
Maintenance:
Trace = 0x1f
Target System:
ProcessorCount = 16
Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5) ...
Received data [ fe 3f 06 00 59 ba ]
Request(3f) sequence (0)
Sent data [ fe 80 06 00 66 9f ]
ProcessAsyncCommand(): INIT_BREAK
Delay 0s before call HandleInitBreak()
HandleInitBreak() called
QueryRevision() called
Sent data [ fe 12 06 01 a0 87 ]
HOST connection is successful!
Timeout...
Recv timeout
Sent data [ fe 12 06 01 a0 87 ]
Received data [ fc 80 0a 01 d6 33 04 00 00 05 ]
Debug agent revision: 0.4
Sent data [ fe 80 06 01 57 ac ]
QueryRevision() returning : Revision = 4 Capability = 0
PutDebuggerSetting() called: Key = 2 Value = 1f
Sent data [ fe 11 08 02 33 92 02 1f ]
SendAckPacket: SequenceNo = 2
Sent data [ FE 80 06 02 04 F9 ]
Received data [ fe 80 06 02 04 f9 ]
PutDebuggerSetting() returning
PutDebuggerSetting() called: Key = 1 Value = 0
Sent data [ fe 11 08 03 e4 cb 01 00 ]
TARGET: Try to get command from HOST...
Timeout...
Recv timeout
Sent data [ fe 11 08 03 e4 cb 01 00 ]
Received data [ FE 11 08 03 00 00 01 00 ]
Processor[0]:Received one command(11)
SendAckPacket: SequenceNo = 3
Sent data [ FE 80 06 03 35 CA ]
Received data [ fe 80 06 03 35 ca ]
PutDebuggerSetting() returning
PutDebuggerSetting() called: Key = 3 Value = 0
Sent data [ fe 11 08 04 8b ba 03 00 ]
TARGET: Try to get command from HOST...
Timeout...
Recv timeout
Sent data [ fe 11 08 04 8b ba 03 00 ]
Received data [ FE 11 08 04 00 00 03 00 ]
Processor[0]:Received one command(11)
SendAckPacket: SequenceNo = 4
Sent data [ FE 80 06 04 A2 53 ]
Received data [ fe 80 06 04 a2 53 ]
PutDebuggerSetting() returning
IGetViewpoint() called
Sent data [ fe 15 06 05 49 1a ]
TARGET: Try to get command from HOST...
Timeout...
Recv timeout
Sent data [ fe 15 06 05 49 1a ]
Received data [ FE 15 06 05 00 00 ]
Processor[0]:Received one command(15)
Received data [ fc 80 09 05 76 9e 00 00 02 ]
Sent data [ fe 80 06 05 93 60 ]
IGetViewpoint() returning : TargetViewpoint = 0
MemoryReady() called
Sent data [ fe 3d 06 06 97 fd ]
Received data [ FE 80 06 05 00 00 ]
TARGET: Try to get command from HOST...
Timeout...
Recv timeout
Sent data [ fe 3d 06 06 97 fd ]
Received data [ FE 3D 06 06 00 00 ]
Processor[0]:Received one command(3D)
Sent data [ FE 80 07 06 42 D0 00 ]
Received data [ fe 80 07 06 42 d0 00 ]
Sent data [ fe 80 06 06 c0 35 ]
MemoryReady() returning : Ready = 0
Informing the happening of target event (reset)
Informed the happening of target event (reset)
IGo() called
Sent data [ fe 01 06 07 7d ad ]
Received data [ FE 80 06 06 00 00 ]
TARGET: Try to get command from HOST...
Timeout...
Recv timeout
Sent data [ fe 01 06 07 7d ad ]
Received data [ FE 01 06 07 00 00 ]
Processor[0]:Received one command(1)
SendAckPacket: SequenceNo = 7
Sent data [ FE 80 06 07 F1 06 ]
Received data [ fe 80 06 07 f1 06 ]
IGo() returning
HandleInitBreak() returning
Sent data [ FE 3D 06 01 00 64 ]
Received data [ fe 3d 06 01 00 64 ]
Request(3d) sequence (1)
Sent data [ fe 80 06 01 57 ac ]
Target memory is ready!
IGo() called
Sent data [ fe 01 06 08 43 bd ]
Received data [ FE 80 06 01 00 00 ]
TARGET: Try to get command from HOST...
Timeout...
Recv timeout
Sent data [ fe 01 06 08 43 bd ]
Received data [ FE 01 06 08 00 00 ]
Processor[0]:Received one command(1)
SendAckPacket: SequenceNo = 8
Sent data [ FE 80 06 08 CF 16 ]
Received data [ fe 80 06 08 cf 16 ]
IGo() returning
==================================================

361 - 380 of 859