Method and system for executing PXE (PCI eXtensions for Ethernet Extensions for Extensions for Extensions for Extensions for Ethernet
By obtaining and displaying the network card MAC address in the UEFI BIOS, the problem of indistinguishable network ports in UEFI mode is solved, and the boot efficiency and user experience are improved.
Patent Information
- Application Number
- CN202510439821.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-08
AI Technical Summary
In UEFI mode, the computer boot time increases and it is difficult for users to distinguish the network port corresponding to each startup option, especially when the onboard network port chip model is the same.
By adding code in UEFI BIOS, obtain the MAC address of the network card device, and list the network card MAC address in the BIOS Setup for users to specify, and display the MAC address of the network card in the Boot Menu interface of UEFI BIOS to distinguish the network card corresponding to each network boot option.
It effectively solves the problem of users having difficulty distinguishing the network port corresponding to each startup option, improves the boot efficiency and enhances the user experience.
Smart Images

Figure CN120276779A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a method and system for a network interface to perform PXE boot startup by specifying an address at the UEFI stage. Background Art
[0002] In modern computer network management, the PXE (Preboot eXecution Environment) startup technology plays a crucial role. This technology allows a computer to load an operating system and applications from a remote server over the network without relying on a local storage device. PXE startup not only simplifies the system deployment process but also improves the flexibility and management efficiency of the IT infrastructure.
[0003] Currently, after a computer selects PXE (Pre-boot Execution Environment) boot, each network interface in the standard UEFI mode will execute PXE once, resulting in an increase in the computer's boot time. Moreover, if the on-board network interface chip models are the same, the information displayed in the Boot Menu interface of the UEFI BIOS is the same, and it is difficult for users to distinguish the network interface corresponding to each startup option. There is a need for a method and system for a network interface to perform PXE boot startup by specifying an address at the UEFI stage to solve the above problems in this scenario. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method for a network interface to perform PXE boot startup by specifying an address at the UEFI stage in view of the above-mentioned defects of the prior art, and also provide a system for a network interface to perform PXE boot startup by specifying an address at the UEFI stage.
[0005] The technical solution adopted by the present invention to solve its technical problems is as follows:
[0006] Construct a method for a network interface with a specified MAC address at the UEFI stage to perform PXE boot startup, wherein the method includes the steps of:
[0007] Step 1: After powering on, determine whether an instruction to select to enter the BIOS Setup to specify MAC address PXE boot is received. If so, restart and proceed to the next step; otherwise, continue with UEFI startup.
[0008] Step 2: UEFI pre-loads the PXE driver.
[0009] Step 3: Determine whether the DevicePath of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to Step 9.
[0010] Step 4: Determine whether the PciHandle of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to Step 9.
[0011] Step 5: Determine whether the PciIo pointer of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to Step 9.
[0012] Step 6: Obtain the device type code of the device. Determine whether it is a network card device based on the device type code. If so, proceed to the next step; otherwise, jump to Step 9.
[0013] Step 7: Obtain the MAC address of the network card device. Determine whether the MAC address of the network card device is the same as the specified MAC address. If so, proceed to the next step; otherwise, jump to Step 9.
[0014] Step 8: Load the PXE driver to boot and jump to Step 10.
[0015] Step 9: Determine whether the next boot device is successfully obtained. If so, jump to Step 3; otherwise, jump to Step 10.
[0016] Step 10: Continue with UEFI boot.
[0017] For the method of performing PXE boot on a network port with a specified MAC address in the UEFI stage of the present invention, before the above-mentioned Step 1, the following steps are further included:
[0018] Add code in the UEFI BIOS to obtain PCI device PciHandles according to the gEfiPciIoProtocolGuid.
[0019] Obtain the PciIo pointer according to the PciHandle and read the PciClass.
[0020] If it is a network card device, obtain the device DevicePath according to the PciHandle and the gEfiDevicePathProtocolGuid.
[0021] Obtain the network card MAC through the DevicePath pointer and add an option in the BIOS Setup to list all network card MAC addresses.
[0022] For the method of performing PXE boot on a network port with a specified MAC address in the UEFI stage of the present invention, before the above-mentioned Step 1, the following steps are further included:
[0023] Add code in the UEFI BIOS to obtain the DevicePath pointer of the boot option according to L"Boot#" and the gEfiGlobalVariableGuid.
[0024] Obtain the PciHandle of the current device according to the DevicePath;
[0025] Obtain the PciIo pointer according to the PciHandle and read the PciClass;
[0026] If it is a network card device, add the MAC address to the Description of the startup option and finally display it on the BootMenu interface.
[0027] A network port that specifies the MAC address in the UEFI stage executes PXE boot to start the system. Among them, the system includes a BISO module, and the BISO module is used to execute the PXE boot method for the network port that specifies the MAC address in the UEFI stage as described in claim 1.
[0028] For the PXE boot startup system of the network port that specifies the MAC address in the UEFI stage of the present invention, the system further includes a setting module, and the setting module is used for:
[0029] Add code in the UEFI BIOS to obtain PCI device PciHandles according to the gEfiPciIoProtocolGuid;
[0030] Obtain the PciIo pointer according to the PciHandle and read the PciClass;
[0031] If it is a network card device, obtain the device DevicePath according to the PciHandle and the gEfiDevicePathProtocolGuid;
[0032] Obtain the network card MAC through the DevicePath pointer and add an option in the BIOS Setup to list all network card MAC addresses.
[0033] For the PXE boot startup system of the network port that specifies the MAC address in the UEFI stage of the present invention, the setting module is further used for:
[0034] Add code in the UEFI BIOS to obtain the DevicePath pointer of the startup option according to L"Boot#" and the gEfiGlobalVariableGuid;
[0035] Obtain the PciHandle of the current device according to the DevicePath;
[0036] Obtain the PciIo pointer according to the PciHandle and read the PciClass;
[0037] If it is a network card device, add the MAC address to the Description in the startup options, and finally display it on the BootMenu interface.
[0038] The beneficial effects of the present invention are as follows: By applying the methods and techniques of this application, based on the UEFI mode, the on-board network card MAC address is listed in the BIOS Setup for the user to specify the MAC address network card to perform PXE boot. At the same time, the MAC address of the network card is added before the network boot option in the BootMenu interface of the UEFI BIOS to distinguish the network card corresponding to each network boot option, which can well solve the problem that it is difficult for users to distinguish the network port corresponding to each boot option. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will further illustrate the present invention in conjunction with the drawings and embodiments. The drawings in the following description are only partial embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings:
[0040] Figure 1 It is a flowchart of the method for the network port with a specified address to perform PXE boot and start in the UEFI stage of the preferred embodiment of the present invention;
[0041] Figure 2 It is a schematic block diagram of the system for the network port with a specified address to perform PXE boot and start in the UEFI stage of the preferred embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0042] In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are partial embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0043] The method for the network port with a specified address to perform PXE boot and start in the UEFI stage of the preferred embodiment of the present invention is as Figure 1 shown, and includes the steps:
[0044] S01: After power-on, determine whether an instruction to select to enter the BIOS Setup to specify the MAC address for PXE boot is received. If yes, restart and proceed to the next step; otherwise, continue with the UEFI startup;
[0045] S02: The UEFI preloads the PXE driver;
[0046] S03: Determine whether the DevicePath of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to step nine.
[0047] S04: Determine whether the PciHandle of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to step nine.
[0048] S05: Determine whether the PciIo pointer of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to step nine.
[0049] S06: Obtain the device type code of the device. Determine whether it is a network card device based on the device type code. If so, proceed to the next step; otherwise, jump to step nine.
[0050] S07: Obtain the MAC address of the network card device. Determine whether the MAC address of the network card device is the same as the specified MAC address. If so, proceed to the next step; otherwise, jump to step nine.
[0051] S08: Load the PXE driver to boot, and jump to step ten.
[0052] S09: Determine whether the next boot device is successfully obtained. If so, jump to step three; otherwise, jump to step ten.
[0053] S10: Continue the UEFI boot.
[0054] Applying the method of the present application, based on the UEFI mode, list the on-board network card MAC address in the BIOS Setup for the user to specify the MAC address network card to perform PXE boot. At the same time, add the MAC address of the network card before the network boot option in the Boot Menu interface of the UEFI BIOS to distinguish the network card corresponding to each network boot option, which can well solve the problem that it is difficult for users to distinguish the network port corresponding to each boot option.
[0055] Preferably, before step one, there is also a step:
[0056] Add code in the UEFI BIOS to obtain the PciHandles of the PCI device according to the gEfiPciIoProtocolGuid.
[0057] Obtain the PciIo pointer according to the PciHandle and read the PciClass.
[0058] If it is a network card device, obtain the device DevicePath according to the PciHandle and the gEfiDevicePathProtocolGuid.
[0059] Obtain the network card MAC through the DevicePath pointer, and add an option in the BIOS Setup to list all network card MAC addresses;
[0060] List the network card MAC addresses in the BIOS options so that it is more intuitive for users to make selections.
[0061] Preferably, before step one, there is also a step:
[0062] Add code in the UEFI BIOS to obtain the DevicePath pointer of the boot option according to L"Boot#" and gEfiGlobalVariableGuid;
[0063] Obtain the PciHandle of the current device according to the DevicePath;
[0064] Obtain the PciIo pointer according to the PciHandle and read the PciClass;
[0065] If it is a network card device, add the MAC address to the Description of the boot option and finally display it on the BootMenu interface.
[0066] A network port that specifies the MAC address in the UEFI stage executes PXE boot to start the system, as Figure 2 shown, the system includes a BISO module 100, and the BISO module is used to execute the PXE boot start method for the network port that specifies the MAC address in the UEFI stage as claimed in claim 1;
[0067] Applying the system of the present application, based on the UEFI mode, list the on-board network card MAC addresses in the BIOS Setup for the user to specify the MAC address network card to execute PXE boot. At the same time, add the MAC address of the network card before the network boot option in the Boot Menu interface of the UEFI BIOS to distinguish the network card corresponding to each network boot option, which can well solve the problem that it is difficult for users to distinguish the network port corresponding to each boot option.
[0068] Preferably, the system further includes a setting module 101, and the setting module is used for:
[0069] Add code in the UEFI BIOS to obtain the PciHandles of the PCI device according to the gEfiPciIoProtocolGuid;
[0070] Obtain the PciIo pointer according to the PciHandle and read the PciClass;
[0071] If it is a network card device, obtain the device's DevicePath according to the PciHandle and the gEfiDevicePathProtocolGuid;
[0072] Obtain the network card MAC through the DevicePath pointer, and add an option in the BIOS Setup to list all network card MAC addresses;
[0073] The setting module is further used for:
[0074] Add code in the UEFI BIOS to obtain the DevicePath pointer of the boot option according to L"Boot#" and the gEfiGlobalVariableGuid;
[0075] Obtain the PciHandle of the current device according to the DevicePath;
[0076] Obtain the PciIo pointer according to the PciHandle and read the PciClass;
[0077] If it is a network card device, add the MAC address to the Description of the boot option and finally display it on the BootMenu interface.
[0078] It should be understood that those of ordinary skill in the art can make improvements or transformations according to the above description, and all such improvements and transformations shall fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for a network interface with a specified MAC address in the UEFI stage to perform PXE boot startup, characterized in that, The method includes the steps of: Step 1: After powering on, determine whether an instruction to select to enter the BIOS Setup to specify the MAC address for PXE boot is received. If so, restart and proceed to the next step; otherwise, continue with UEFI boot. Step 2: UEFI preloads the PXE driver. Step 3: Determine whether the DevicePath of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to Step 9. Step 4: Determine whether the PciHandle of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to Step 9. Step 5: Determine whether the PciIo pointer of the device is successfully obtained. If so, proceed to the next step; otherwise, jump to Step 9. Step 6: Obtain the device type code of the device, and determine whether it is a network card device based on the device type code. If so, proceed to the next step; otherwise, jump to Step 9. Step 7: Obtain the MAC address of the network card device, and determine whether the MAC address of the network card device is the same as the specified MAC address. If so, proceed to the next step; otherwise, jump to Step 9. Step 8: Load the PXE driver to boot and jump to Step 10. Step 9: Determine whether the next boot device is successfully obtained. If so, jump to Step 3; otherwise, jump to Step 10. Step 10: Continue with UEFI boot.
2. The method for performing PXE boot startup on a network interface that specifies a MAC address in the UEFI stage according to claim 1, characterized in that Before Step 1, there are also the steps of: Add code in the UEFI BIOS to obtain the PciHandles of PCI devices according to the gEfiPciIoProtocolGuid. Obtain the PciIo pointer according to the PciHandle and read the PciClass. If it is a network card device, obtain the device DevicePath according to the PciHandle and the gEfiDevicePathProtocolGuid. Obtain the network card MAC through the DevicePath pointer, and add an option in the BIOS Setup to list all network card MAC addresses.
3. The method for performing PXE boot startup of a network interface that specifies a MAC address in the UEFI stage according to claim 1, wherein Before Step 1, there are also the steps of: Add code in the UEFI BIOS to obtain the DevicePath pointer of the boot option according to L"Boot#" and the gEfiGlobalVariableGuid. Obtain the PciHandle of the current device according to the DevicePath. Obtain the PciIo pointer according to the PciHandle and read the PciClass. If it is a network card device, add the MAC address to the Description of the boot option and finally display it on the BootMenu interface.
4. A network port that specifies a MAC address in the UEFI stage executes PXE boot to start the system, characterized in that The system includes a BISO module, and the BISO module is used to execute the PXE boot method for the network port specifying the MAC address in the UEFI stage as described in Claim 1.
5. The network interface that specifies the MAC address in the UEFI stage performs PXE boot to start the system according to claim 4, characterized in that The system further includes a setting module, and the setting module is used to: Add code in the UEFI BIOS to obtain the PciHandles of PCI devices according to the gEfiPciIoProtocolGuid. Obtain the PciIo pointer according to the PciHandle and read the PciClass. If it is a network card device, obtain the device's DevicePath according to the PciHandle and the gEfiDevicePathProtocolGuid; Obtain the network card MAC through the DevicePath pointer, and add an option in the BIOS Setup to list all network card MAC addresses.
6. The network interface that specifies the MAC address in the UEFI stage executes the PXE boot to start the system, characterized in that, The setting module is further configured to: Add code in the UEFI BIOS to obtain the DevicePath pointer of the boot option according to L"Boot#" and the gEfiGlobalVariableGuid; Obtain the PciHandle of the current device according to the DevicePath; Obtain the PciIo pointer according to the PciHandle and read the PciClass; If it is a network card device, add the MAC address to the Description of the boot option, and finally display it on the BootMenu interface.