Method and apparatus for displaying boot mode of PCIE device, device, and medium
View Patent ↗The present disclosure provides a method and apparatus for displaying a boot mode of a PCIE device, a device, and a medium, and relates to the technical field of servers. The method includes: querying in all root bridge devices in a BIOS initialization device stage after a server is powered on; determining, based on each root bridge device of the root bridge devices, a PCIE device under the root bridge device; reading a first preset bit of a capability list and a second preset bit in PCIE capable bits in a configuration space of the PCIE device when the PCIE device is present; and displaying, based on the first preset bit of the capability list and the second preset bit in the PCIE capable bits, a boot mode supported by the PCIE device under a BIOS device option, which may display the boot mode supported by the PCIE device being present.
1 . A method for displaying a boot mode of a peripheral component interconnect express (PCIE) device, applied to a Basic Input Output System (BIOS) integrated circuit, the method comprising:
querying in all root bridge devices in a BIOS initialization device stage after a server is powered on;
determining, based on each root bridge device of the root bridge devices, a PCIE device under the root bridge device;
for the PCIE device, in response to determining that the PCIE device is present, reading a first preset bit of a capability list and a second preset bit in PCIE capable bits in a configuration space of the PCIE device; and
displaying, based on the first preset bit of the capability list and the second preset bit in the PCIE capable bits, a boot mode supported by the PCIE device under a BIOS device option.
2 . The method according to claim 1 , wherein the displaying, based on the first preset bit of the capability list and the second preset bit in the PCIE capable bits, the boot mode supported by the PCIE device under a BIOS device option, comprises:
performing an AND operation on a fourth bit of the capability list and a seventh bit in the PCIE capable bits to obtain an AND operation result;
assigning the AND operation result to a preset global variable;
generating a file in a preset format based on device information of the PCIE device, the device information comprising the preset global variable;
creating, under the BIOS device option, a topology of the PCIE device based on the device information of the PCIE device in the file in the preset format;
creating, under the topology of the PCIE device, a BIOS option of the boot mode supported by the PCIE device;
determining, based on a value of the preset global variable under the BIOS option of the boot mode supported by the PCIE device, the boot mode supported by the PCIE device; and
displaying, under the BIOS option of the boot mode supported by the PCIE device, the boot mode supported by the PCIE device.
3 . The method according to claim 2 , wherein the determining, based on a value of the preset global variable under the BIOS option of the boot mode supported by the PCIE device, the boot mode supported by the PCIE device, comprises:
in response to determining that the value of the preset global variable under the BIOS option of the boot mode supported by the PCIE device is 1, determining that the boot mode supported by the PCIE device is a Unified Extensible Firmware Interface (UEFI) mode and a Legacy mode; or
in response to determining that the value of the preset global variable under the BIOS option of the boot mode supported by the PCIE device is 0, determining that the boot mode supported by the PCIE device is a Legacy mode.
4 . The method according to claim 1 , wherein after a step of the displaying, based on the first preset bit of the capability list and the second preset bit in the PCIE capable bits, a boot mode supported by the PCIE device under a BIOS device option, the method further comprises:
in response to determining that the boot mode of the PCIE device is adjusted to a target boot mode, verifying whether the target boot mode is consistent with the boot mode supported by the PCIE device; and
in response to determining that the target boot mode is consistent with the boot mode supported by the PCIE device, storing the target boot mode into a dynamic region of a non-volatile random access memory, so that the PCIE device boots by using the target boot mode at a next boot.
5 . The method according to claim 4 , wherein after a step of the verifying whether the target boot mode is consistent with the boot mode supported by the PCIE device, the method further comprises:
in response to determining that the target boot mode is inconsistent with the boot mode supported by the PCIE device, determining that the PCIE device is a target PCIE device; and
displaying prompt information that the target PCIE device does not support the target boot mode through a pop-up window.
6 . The method according to claim 1 , wherein the reading a first preset bit of a capability list and a second preset bit in PCIE capable bits in a configuration space of the PCIE device comprises:
reading the first preset bit of the capability list and the second preset bit in the PCIE capable bits through a capability list pointer of the PCIE device.
7 . The method according to claim 1 , further comprising:
acquiring information of a downstream port through a PCIE protocol;
generating, based on the information of the downstream port, a linked list of slot information for the PCIE device; and
generating, based on the linked list of slot information for the PCIE device and the boot mode supported by the PCIE device, a target data structure table, so that a user exports the target data structure table and views the boot mode supported by the PCIE device based on the target data structure table.
8 . The method according to claim 2 , further comprising:
sending the file in the preset format to a Baseboard Management Controller (BMC) integrated circuit through a redfish out-of-band interface, so that the BMC integrated circuit displays, based on the file in the preset format, the boot mode supported by the PCIE device under a device list of a BMC network interface.
9 . The method according to claim 1 , wherein the first preset bit is a fourth bit, and the second preset bit is a seventh bit.
10 . The method according to claim 1 , wherein a value of the first preset bit of the capability list is configured to indicate whether the PCIE device supports a UEFI mode, and a value of the second preset bit in the PCIE capable bits is configured to indicate whether the PCIE device supports the UEFI mode.
11 . The method according to claim 1 , wherein the determining, based on each root bridge device of the root bridge devices, a PCIE device under the root bridge device comprises:
storing the root bridge device into a linked list; and
traversing the root bridge device in the linked list to find the PCIE device under the root bridge device.
12 . A BIOS integrated circuit, comprising:
one or more processors; and
a memory associated with the one or more processors, the memory being configured to store computer-readable instructions that, when read and executed by the one or more processors, implement steps of the method for displaying a boot mode of a PCIE device according to claim 1 .
13 . A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-readable instructions that, when executed by one or more processors, implement steps of the method for displaying a boot mode of a PCIE device according to claim 1 .
14 . A method for displaying a boot mode of a PCIE device, applied to a BMC integrated circuit, the method comprising:
receiving a file in a preset format sent by a BIOS integrated circuit, the file in the preset format being generated based on device information of the PCIE device, the device information of the PCIE device comprising a preset global variable, and the preset global variable storing an AND operation result of a first preset bit of a capability list and a second preset bit in PCIE capable bits in a configuration space of the PCIE device; and
displaying, based on the file in the preset format, a boot mode supported by the PCIE device under a device list of a BMC network interface.
15 . The method according to claim 14 , wherein the displaying, based on the file in the preset format, a boot mode supported by the PCIE device under a device list of a BMC network interface, comprises:
parsing the file in the preset format to obtain the device information of the PCIE device;
extracting, for the PCIE device, the AND operation result in the preset global variable from the device information of the PCIE device;
determining, based on the AND operation result, the boot mode supported by the PCIE device; and
displaying the boot mode supported by the PCIE device under the device list of the BMC network interface.
16 . The method according to claim 14 , wherein the first preset bit is a fourth bit, and the second preset bit is a seventh bit.
17 . The method according to claim 14 , wherein a value of the first preset bit of the capability list is configured to indicate whether the PCIE device supports a UEFI mode, and a value of the second preset bit in the PCIE capable bits is configured to indicate whether the PCIE device supports the UEFI mode.
18 . An apparatus for displaying a boot mode of a PCIE device, comprising:
a query module, configured to query in all root bridge devices in a BIOS initialization device stage after a server is powered on;
a determination module, configured to determine, based on each root bridge device of the root bridge devices, a PCIE device under the root bridge device;
a reading module, configured to, for the PCIE device, in response to determining that the PCIE device is present, read a first preset bit of a capability list and a second preset bit in PCIE capable bits in a configuration space of the PCIE device; and
a first display module, configured to display, based on the first preset bit of the capability list and the second preset bit in the PCIE capable bits, a boot mode supported by the PCIE device under a BIOS device option.
19 . A BMC integrated circuit, comprising:
one or more processors; and
a memory associated with the one or more processors, the memory being configured to store computer-readable instructions that, when read and executed by the one or more processors, implement steps of the method for displaying a boot mode of a PCIE device according to claim 14 .
20 . A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-readable instructions that, when executed by one or more processors, implement steps of the method for displaying a boot mode of a PCIE device according to claim 14 .