0

In the code, the following boot service is being used to obtain an array of Handles with the array size equals HandleCount.

gBS->LocateHandleBuffer (
                ByProtocol,
                &gEfiSomeProtocolGuid,
                NULL,
                &HandleCount,
                &Handles
                );

I was expecting a particular order of the array of Handles I can get after this boot service call. Let's say this represents the EFI_GRAPHICS_OUTPUT_PROTOCOL. The system connects to 3 video cards and I want to ensure the GeForce RTX™ 3090 is always loaded before 3070, and then 3060. How do I trace the source of this Handles array to modify the handle database? What affects the ordering of the handle database?

  • You don't. The implementation of the handle database is intentionally abstracted behind the APIs. What is the behaviour you are trying to affect? – unixsmurf Nov 01 '22 at 09:13
  • I want the graphic card handles to be returned always in this order: GeForce RTX™ 3090 -> 3070 -> 3060 after I called gBS->LocatHandleBuffer(ByProtocol, &gEfiGraphicsOutputProtocolGuid, NULL, &HandleCount, &Handles) if possible. – geekycheek Nov 01 '22 at 15:19
  • It is not possible. So can you explain the problem you are trying to solve by making that happen? – unixsmurf Nov 02 '22 at 10:14
  • I have to rearrange the boot option order such that an O/S on a SD card always boot before the one on a hard drive. My thought was the handle order may depend on the order each handle is initialized and saved into the system. Hence, I am looking for a way to insert the handles in order. – geekycheek Nov 02 '22 at 15:40
  • So, your goal is to modify the boot order? – DMeneses Nov 22 '22 at 18:42
  • Not a boot order a user configured using either efibootmgr -o or the UiApp, but the default one. That is, when a user first turns on the system, he sees a default list. – geekycheek Nov 26 '22 at 20:14

0 Answers0