Firmware function customization method and device, electronic equipment and storage medium

By obtaining the functional customization requirements of the original firmware and using the file system information of the firmware boot tool to initialize the compatibility service, it solves the problem that LinuxBoot cannot be compatible with multiple operating systems, and achieves the stable startup of the target firmware in different operating systems and hardware environments.

CN120492043APending Publication Date: 2025-08-15INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510566111.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The LinuxBoot firmware boot tool is not compatible with other operating systems except Linux, which limits the customization of firmware functions and the compatibility of the operating system.

Method used

By obtaining the functional customization requirements of the original firmware, using the file system information of the firmware startup tool to initialize the firmware compatibility service, and achieving stable startup of the target firmware in different operating systems and hardware environments.

Benefits of technology

It realizes the stable startup of LinuxBoot firmware in different operating systems and hardware environments, solves the multi-system compatibility problem of firmware startup tools, and meets the customized needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492043A_ABST
    Figure CN120492043A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware function customization method and device, electronic equipment and a storage medium, and relates to the technical field of computers. When it is found that an operating system of target starting equipment is incompatible with a firmware starting tool, a firmware compatible service is initialized through file system information of the firmware starting tool; the firmware boot tool enables the target firmware to adapt to different operating systems and hardware environments based on the firmware compatible service. Therefore, the technical problem that a firmware starting tool LinuxBoot cannot be compatible with multiple operating systems can be solved, and the technical effect of being compatible with the multiple operating systems while firmware customized modification is achieved is achieved, so that it is ensured that the target firmware subjected to customized modification can be stably started and run on different target starting devices and operating systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for customizing firmware functions. Background Art

[0002] Currently, the firmware for computing devices such as servers is usually developed by chip manufacturers based on the chip architecture and relies on the Unified Extensible Firmware Interface (UEFI) to load the firmware's operating system. Although UEFI is compatible with various operating systems, it does not support user customization.

[0003] To customize firmware functionality, LinuxBoot, an open-source firmware boot solution, emerged. LinuxBoot allows users to customize the boot firmware's functionality. However, LinuxBoot is limited in its ability to load operating systems; it can only load Linux-compatible operating systems. Therefore, making LinuxBoot compatible with other operating systems has become a pressing technical challenge. Summary of the Invention

[0004] The present application provides a firmware function customization method, device, electronic device and storage medium to at least solve the problem in the related art that LinuxBoot has limitations in loading operating systems and can only load Linux-compatible operating systems.

[0005] This application provides a method for customizing firmware functions, including:

[0006] Obtain the original firmware and the user's firmware function customization requirements;

[0007] Based on the firmware startup tool, according to the firmware function customization requirements, the original firmware is modified to obtain the target firmware;

[0008] Determine whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool;

[0009] When it is determined that the operating system of the target boot device of the target firmware is incompatible with the firmware boot tool, obtaining file system information of the firmware boot tool;

[0010] Initialize the firmware compatibility service based on the file system information of the firmware startup tool;

[0011] The firmware boot tool boots the target firmware on the target boot device based on the firmware compatible service.

[0012] This application also provides a firmware function customization device, including:

[0013] The first acquisition module is used to obtain the original firmware and the user's firmware function customization requirements;

[0014] The customization module is used to modify the original firmware to obtain the target firmware based on the firmware startup tool and the firmware function customization requirements;

[0015] A judgment module, used to judge whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool;

[0016] A second acquisition module is used to acquire file system information of the firmware startup tool when it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool;

[0017] The compatibility module is used to initialize the firmware compatibility service according to the file system information of the firmware startup tool;

[0018] The startup module is used by the firmware startup tool to start the target firmware on the target startup device based on the firmware compatible service.

[0019] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned firmware function customization methods when executing the computer program.

[0020] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned firmware function customization methods are implemented.

[0021] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned firmware function customization methods when executed by a processor.

[0022] Through this application, when it is found that the target boot device operating system is incompatible with the firmware boot tool, the firmware boot tool uses the file system information of the firmware boot tool to initialize the firmware compatibility service. Based on the firmware compatibility service, the firmware boot tool enables the target firmware to adapt to different operating systems and hardware environments. Therefore, the technical problem that the firmware boot tool LinuxBoot is not compatible with multiple operating systems can be solved, achieving the technical effect of being compatible with multiple operating systems while implementing customized firmware modifications, thereby ensuring that the customized target firmware can stably start and run on different target boot devices and operating systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0024] Figure 1 This is a schematic diagram of the structure of the firmware function customization system based on the embodiments of the present application;

[0025] Figure 2 A flowchart of a firmware function customization method provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the phase division of firmware startup provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a simplified flow chart of a method for customizing firmware functions provided in an embodiment of the present application;

[0028] Figure 5 A flowchart of an exemplary firmware function customization method provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of the structure of a firmware function customization device provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0032] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0033] The current server boot firmware development model typically follows this pattern: chip manufacturers develop a code base (B) based on the chip architecture to initialize various core hardware functions. Firmware vendors (IBVs) then develop a platform code base (A) based on the chip manufacturer's code base (B). They then apply code base A to develop a loading solution for the operating system. This typically involves loading the operating system through UEFI. However, because many functional modules of UEFI firmware are not easily customizable, the firmware boot solutions provided by IBV vendors cannot meet the functional customization needs of end users. Therefore, some users have customized and developed an open-source Linux system (linuxboot) and integrated it into their server boot firmware solutions. This system, combined with hardware initialization solutions (UEFI, coreboot, etc.), leverages the multi-threaded nature of the terminal device's multiple CPUs to efficiently install or boot a Linux-compatible operating system. Compared to traditional UEFI firmware, LinuxBoot's openness allows server users to easily customize their own boot scripts, fix issues, build their own runtime environment, and flash the firmware with their own keys, without having to wait for vendor updates. This offers significantly faster boot times, greater flexibility, and greater security, making it a key development direction for next-generation system firmware.

[0034] The LinuxBoot firmware boot tool uses the Linux kernel to initialize peripherals, locates a bootable entry on bootable media, and then boots the operating system from the selected entry. However, as a firmware boot solution based on the open source Linux community, LinuxBoot has certain limitations when loading operating systems. It can only load Linux-compatible operating systems through the kexce mechanism and cannot load other operating systems, such as Windows and VMware.

[0035] Therefore, there is an urgent need to achieve compatibility with all operating systems based on Linuxboot and based on open source firmware solutions. The embodiment of the present application provides a firmware function customization method, device, electronic device and storage medium, the method comprising: obtaining the original firmware and the user's firmware function customization requirements; based on the firmware startup tool, according to the firmware function customization requirements, the original firmware is modified for function customization to obtain the target firmware; judging whether the operating system of the target startup device of the target firmware is compatible with the firmware startup tool; when it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool, obtaining the file system information of the firmware startup tool; initializing the firmware compatibility service based on the file system information of the firmware startup tool; the firmware startup tool starts the target firmware on the target startup device based on the firmware compatibility service. The method provided by the above scheme initializes the firmware compatibility service using the file system information of the firmware startup tool when it is found that the operating system of the target startup device is incompatible with the firmware startup tool, and the firmware startup tool enables the target firmware to adapt to different operating systems and hardware environments based on the firmware compatibility service. Therefore, the technical problem that the firmware boot tool LinuxBoot is not compatible with multiple operating systems can be solved, and the technical effect of being compatible with multiple operating systems while realizing customized firmware modification can be achieved, so as to ensure that the customized target firmware can be stably started and run on different target boot devices and operating systems.

[0036] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0037] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the firmware function customization method depends, the specific application environment architecture or specific hardware architecture is described here.

[0038] First, the structure of the firmware function customization system on which this application is based is described:

[0039] The firmware function customization method, device, electronic device and storage medium provided in the embodiments of the present application are suitable for performing compatibility processing when the operating system of the target boot device to be started with the customized target firmware is incompatible with the firmware boot tool, so as to ensure that the customized target firmware can be stably started and run on different target boot devices and operating systems. Figure 1As shown, this is a structural diagram of the firmware function customization system based on the embodiment of the present application, which mainly includes a firmware startup tool, a target startup device and a firmware function customization device. The firmware startup tool includes at least LinuxBoot. The firmware startup tool is used to customize the original firmware to obtain the target firmware. The firmware function customization device is used to successfully start the target firmware and run it on the target startup device of any operating system.

[0040] The embodiments of the present application provide a method for customizing firmware functions, which is used to perform compatibility processing when the operating system of the target boot device to be booted with customized target firmware is incompatible with the firmware boot tool, so as to ensure that the customized target firmware can be stably booted and run on different target boot devices and operating systems. The execution subject of the embodiments of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used for firmware function customization.

[0041] like Figure 2 FIG. 1 is a flow chart of a method for customizing firmware functions according to an embodiment of the present application, the method comprising:

[0042] Step 201: Obtain the original firmware and the user's firmware function customization requirements.

[0043] Original firmware refers to the firmware code provided by the firmware manufacturer, which is used to implement important functions such as central processing unit (CPU) initialization, hardware configuration management, system fault monitoring, power management, and hardware fault detection in computing devices such as servers. User requirements for firmware customization include modifications and expansions to firmware functions, such as requests to modify power management policies or add network security protection features.

[0044] Step 202 : Based on the firmware startup tool and according to the firmware function customization requirements, the original firmware is modified to obtain the target firmware.

[0045] The firmware startup tool at least includes LinuxBoot.

[0046] Specifically, based on the firmware startup tool, according to the firmware function customization requirements, the firmware code corresponding to each functional module in the original firmware can be customized and modified to obtain the target firmware that meets the user's firmware function customization requirements.

[0047] Step 203: Determine whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool.

[0048] The target boot device is a hardware device used to run the target firmware, such as a server or various embedded computing devices.

[0049] Specifically, when the firmware boot tool is LinuxBoot, the firmware boot tool LinuxBoot is only compatible with Linux. Therefore, when it is determined that the operating system of the target boot device of the target firmware is a non-Linux system, it can be determined that the operating system of the target boot device of the target firmware is incompatible with the firmware boot tool.

[0050] Step 204 : When it is determined that the operating system of the target boot device of the target firmware is incompatible with the firmware boot tool, obtain file system information of the firmware boot tool.

[0051] Among them, the file system information of the firmware startup tool includes various key information in the LinuxBoot file system, such as memory map information (system memory information), system management information and system hardware configuration information. System management information is also called system management BIOS information (System Management BIOS Information, abbreviated as: SMBIOS), and system hardware configuration information is also called advanced configuration and power interface information (Advanced Configuration and Power Interface Information, abbreviated as: ACPI).

[0052] Among them, the system memory information describes the layout of the system memory, including the starting address, ending address, memory type (such as RAM, ROM, etc.) of different memory areas, and their usage, etc., which can help the operating system and other software to correctly manage and access the memory. System management information includes system manufacturer, model, serial number, motherboard information, memory configuration, processor information, etc. It allows the operating system and management software to obtain detailed information related to these hardware in order to perform system management, diagnosis, and configuration operations. System hardware configuration information defines the interface between the operating system and the hardware for power management and configuration information interaction. It provides information about the power management functions, device status, wake-up events, etc. of the system hardware, so that the operating system can effectively manage the power usage of the system, such as achieving energy saving and dynamic management of devices.

[0053] Specifically, when LinuxBoot is used to modify the firmware, an area needs to be allocated in the Flash of the Basic Input / Output System (BIOS) to store the LinuxBoot program image file, and then a variable (such as "LinuxBootEnable") is stored in the BIOS NVRAM to represent whether to boot from LinuxBoot. During the startup process, the BIOS decides whether to use LinuxBoot to initialize peripherals and boot the system based on the value of "LinuxBootEnable" stored in the BIOS NVRAM and whether the LinuxBoot file exists in the Flash. If LinuxBoot is used, various information of the target boot device is mapped to a specific path in the LinuxBoot file system. Therefore, the system memory information can be extracted under the / sys / firmware / memmap address in the LinuxBoot file system, the system management information can be extracted under the / sys / firmware / efi / systab address in the LinuxBoot file system, and the system hardware configuration information can be extracted under the / sys / firmware / acpi / tables address in the LinuxBoot file system. The extracted system memory information, system management information, and system hardware configuration information are saved to a specified location in the memory for subsequent reading.

[0054] Step 205: Initialize the firmware compatibility service according to the file system information of the firmware startup tool.

[0055] It's important to note that firmware compatibility services are software services designed to address the issue of target firmware running on operating systems incompatible with the firmware boot tool. Firmware compatibility services primarily include memory management interface services and system reset services. These services manage and configure the resources of the target boot device, ensuring the target firmware can boot and run properly in different operating system environments.

[0056] Specifically, the firmware compatibility service may adopt the Unified Extensible Firmware Interface (UEFI) service. The UEFI service is compatible with various operating systems, such as Windows and VMware.

[0057] Step 206: The firmware startup tool starts the target firmware on the target startup device based on the firmware compatibility service.

[0058] Specifically, the firmware boot tool can use the device initialization and system status control capabilities provided by the firmware compatibility service to perform a series of operations on the target boot device, such as status checking of the target boot device, parameter setting, and preparation of the system environment, so that the target boot device is in a state suitable for the operation of the target firmware, and then boot the target firmware on the target boot device.

[0059] Accordingly, in one embodiment, when it is determined that the operating system of the target boot device of the target firmware is compatible with the firmware boot tool, the target firmware is booted on the target boot device based on the native system boot mechanism of the firmware boot tool.

[0060] Among them, the native system startup mechanism of the firmware startup tool includes Kexex, the native OS startup mechanism in LinuxBoot. In terms of booting the operating system, Kexex is a patch of the Linux kernel that can directly boot a new kernel from the currently running kernel. LinuxBoot relies on this mechanism to use the firmware startup process as a new Linux kernel when it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool, copy the new Linux kernel into the kernel, and move this Linux kernel image to the dynamic kernel memory. This image is copied to the actual target location (overwriting the current kernel), and then the new Linux kernel is started, so that the firmware startup tool has the corresponding new functions, that is, the firmware can be started and run normally in the case of system incompatibility.

[0061] Based on the above embodiment, as an implementable approach, in one embodiment, based on a firmware startup tool, the original firmware is modified for function customization according to the firmware function customization requirements to obtain the target firmware, including:

[0062] Step 2021: Determine the functional modules to be modified and / or newly added based on the firmware function customization requirements;

[0063] Step 2022: If there is a function module to be modified, modify the code of the corresponding function module to be modified in the original firmware based on the firmware startup tool;

[0064] Step 2023: If there is a new functional module, based on the firmware startup tool, corresponding software and hardware interface initialization processing is performed according to the attribute information of the new functional module, so that the obtained target firmware supports the new functional module.

[0065] Specifically, once the functional modules to be modified are identified, the code of the corresponding modules in the original firmware is adjusted using the firmware startup tool. The firmware startup tool provides a range of firmware development and debugging functions. The tool can locate the code location of the functional modules to be modified and modify the code based on functional customization requirements, such as modifying the original functional logic.

[0066] Specifically, if a new functional module is added, while writing the corresponding functional code, it is also necessary to perform the corresponding software and hardware interface initialization processing according to the attribute information of the new functional module to ensure that the hardware can support the operation of the new functional module. For example, for a new remote management interface functional module, the network interface needs to be initialized to ensure that the functional module can communicate normally with external devices and thus realize remote management.

[0067] By customizing the original firmware, the functionality can be flexibly adjusted and expanded based on the user's specific needs. Whether modifying existing functions or adding new ones, the firmware can better meet the needs of different users in different application scenarios, improving the firmware's relevance and practicality.

[0068] Specifically, if Figure 3 As shown, it is a schematic diagram of the phase division of the firmware startup provided in an embodiment of the present application. The entire firmware function customization method is divided into at least two phases, namely the hardware initialization phase and the operating system booting phase.

[0069] The hardware initialization phase involves initializing the hardware, including CPU, chip initialization, memory initialization, and storage device initialization. This is a fundamental step in system startup, ensuring that hardware components are in a working state. Hardware initialization solutions include: UEFIPEI, Coreboot, and Slimboot. UEFIPEI (Pre-EFI Initialization) is the pre-initialization phase of UEFI (Unified Extensible Firmware Interface), responsible for initializing basic hardware and preparing for subsequent startup phases; Coreboot is an open source firmware project designed to provide a fast and secure boot process; Slimboot is also a firmware solution for hardware initialization.

[0070] Among them, in the stage of booting the operating system, the boot device is selected and the software and hardware interfaces are initialized in order to prepare for the startup of the operating system. The boot operation method includes UEFI BDS (Boot Device Selection) and Linux Boot. UEFI BDS is used to select the appropriate boot device and load the boot file; Linux Boot is a boot solution based on the Linux kernel. After the initialization and booting of the first two extremes, the target firmware is started and run in the operating system, providing the user with an operating interface and various services. The firmware function customization method provided in the embodiment of the present application is mainly used in the stage of booting the operating system.

[0071] Based on the above embodiment, as an implementable manner, in one embodiment, determining whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool includes:

[0072] Step 2031, traversing the device system files of the target boot device of the target firmware to determine whether the device system files include the target system files;

[0073] Step 2032: When it is determined that the device system file includes the target system file, it is determined that the operating system of the target boot device of the target firmware is compatible with the firmware boot tool.

[0074] The target system file includes a system feature file of a firmware startup tool, that is, the target system file includes a Linux system feature file.

[0075] On the contrary, in the case where it is determined that the device system file does not include the target system file, it is determined that the operating system of the target boot device of the target firmware is incompatible with the firmware boot tool.

[0076] Specifically, the system signature file of the firmware startup tool included in the target system file is a compatibility identifier of the two. If this file exists, it means that the operating system of the target startup device has the environment and conditions required for the normal operation of the firmware startup tool.

[0077] Among them, by judging whether the operating system of the target boot device is compatible with the firmware boot tool, it is possible to determine in advance whether the firmware boot tool can successfully start and run the target firmware on the target boot device, avoiding resource waste and time loss in subsequent firmware startup due to compatibility issues.

[0078] Based on the above embodiment, as an implementable manner, in one embodiment, initializing the firmware compatibility service according to the file system information of the firmware startup tool includes:

[0079] Step 2051, determining the start address, end address, and memory type of each memory area based on the system memory information of the target boot device;

[0080] Step 2052: Generate a target memory data structure that complies with the firmware compatibility standard based on the start address, end address, and memory type of each memory area.

[0081] Step 2053: Initialize the memory management interface service (interface service of the memory management service) based on the target memory data structure.

[0082] The file system information of the firmware startup tool includes system memory information of the target startup device, and the firmware compatible service includes a memory management interface service, which is used to access various memory areas.

[0083] It's important to note that the target boot device's system memory information records the layout and usage of the entire system memory. System memory is typically divided into different areas, each with specific uses and properties. By analyzing the target boot device's system memory information, we can determine the boundaries of each memory area (i.e., the starting and ending addresses) and the memory type. Memory types are categorized into at least kernel memory (which stores the operating system) and buffer memory.

[0084] Specifically, after determining the start address, end address, and memory type of each memory region, this information is integrated into a specific data structure that complies with firmware compatibility standards, such as the UEFI standard. The target memory data structure can be an array, EFI_MEMORY_DESCRIPTOR, where each element contains information about a memory region. Generating this data structure facilitates subsequent management and manipulation of memory information.

[0085] The memory management interface services are a set of functions or interfaces used to access and manage system memory. Based on the target memory data structure generated earlier, these interface services can be initialized. This initialization process includes setting interface parameters, allocating necessary resources, and establishing an association with the target memory data structure. After initializing the memory management interface services, subsequent programs can use these interfaces to access and manage various memory areas.

[0086] Specifically, by accurately determining the information of each memory area and generating a standardized data structure, the memory management interface service can more efficiently perform memory allocation, release, and access operations. It can also quickly locate available memory areas, avoiding unnecessary memory scanning and search processes, thereby improving memory management efficiency. Furthermore, due to the standardized data structure, the memory management interface service can more accurately handle different types of memory areas, reducing the probability of memory management errors.

[0087] Specifically, in one embodiment, the hardware configuration interface protocol of the operating system of the target boot device can be determined based on the system hardware configuration information of the target boot device; and the system reset service (interface service of the system reset service) can be initialized based on the hardware configuration interface protocol of the operating system of the target boot device.

[0088] The file system information of the firmware startup tool includes the system hardware configuration information of the target startup device, and the firmware compatible service includes a system reset service, which is used to perform a system reset operation on the target startup device.

[0089] It should be noted that the operating system of the target boot device needs to communicate and configure the hardware through a specific interface protocol. Different hardware may use different interface protocols, which specify how data is transmitted, commands are sent, and status feedback is provided between the operating system and the hardware.

[0090] Specifically, by analyzing the target boot device's system hardware configuration information, the interface protocols used by each hardware component in the device can be determined. For example, if the hardware configuration information shows that the target boot device contains a hard drive that supports the SATA interface, then it can be determined that the operating system needs to use the SATA protocol to communicate with and configure the hard drive.

[0091] The system reset service is a functional module used to perform a system reset on the target boot device. Specifically, the system reset service can be initialized based on the specified hardware configuration interface protocol. This includes setting parameters required for the system reset service, configuring the interface for communicating with the hardware, and loading drivers.

[0092] Specifically, accurately determining the hardware configuration interface protocol and initializing the system reset service can ensure that the system reset operation can be executed correctly. When the system fails or needs to be initialized, the system reset service can quickly restore the system to normal state, improving system availability.

[0093] Based on the above embodiment, as an implementable manner, in one embodiment, the firmware boot tool boots the target firmware on the target boot device based on the firmware compatibility service, including:

[0094] Step 2061: The firmware startup tool allocates memory space required for the target firmware to run in the target startup device based on the memory management interface service.

[0095] Step 2062: Perform a system reset operation on the target boot device based on the system reset service to initialize the operating system of the target boot device.

[0096] Step 2063 : Load the boot program of the operating system of the target boot device into the allocated memory space, and start the target firmware based on the boot program to start the target firmware on the target boot device.

[0097] Among them, firmware compatibility services include memory management interface services and system reset services.

[0098] Specifically, the target firmware requires a certain amount of memory space to store code, data, and temporary information generated during execution. The firmware boot tool uses the memory management interface service to allocate a memory area of appropriate size from the available memory of the target boot device based on the specific needs of the target firmware.

[0099] Specifically, the purpose of the system reset operation is to restore the hardware and software status of the target boot device to the initial state. During the system reset, the target boot device will be initialized according to the system management information, and any existing error states and temporary data will be cleared so that the target firmware starts booting in the initial state.

[0100] The target device's operating system bootloader is a piece of code that performs a series of initialization tasks during system startup, loading the target firmware into memory and booting it. After completing memory allocation and a system reset, the firmware boot tool loads the target device's operating system bootloader into the previously allocated memory space. Once loaded into memory, the bootloader begins performing its intended tasks, such as detecting hardware devices, initializing the system environment, and loading the target firmware's core components. After the bootloader completes its tasks, control is transferred to the target firmware, allowing the target firmware to boot on the target device.

[0101] Specifically, the memory management interface service allocates appropriate memory space for the target firmware, preventing boot failures or crashes during operation due to insufficient memory. Furthermore, the system reset clears erroneous states and temporary data that could affect the target firmware's operation, providing it with a stable operating environment. This enables the target firmware to boot normally on the target boot device and continue to run stably, reducing the probability of system failures and anomalies.

[0102] Specifically, if Figure 4As shown, it is a schematic flow chart of the firmware function customization method provided by the embodiment of the present application. After hardware initialization, LinuxBoot loading device driver (loading LinuxBoot startup file) and determining the target startup device specified by the user, if it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool (LinuxBoot), then enter the OSBootApp module (operating system startup application module). In the OSBootApp module, first create the UEFI System Table (firmware compatibility service), and then based on the firmware compatibility service, load the boot program (OS Loader APP) of the operating system of the target startup device, and finally enter the OS (operating system of the target startup device) to enable the target firmware to start and run on the target startup device. Among them, in order to ensure that LinuxBoot is an independent system firmware solution, the operating system startup application module is independent of the hardware and hardware initialization scheme. In the standard UEFI startup process, the UEFI System Table is installed after the memory initialization is completed. Most of the content can be completed without directly relying on other information, but some services require some additional information collected in the early stage of startup (system memory information, system management information and system hardware configuration information) to support it.

[0103] Among them, the UEFI System Table initialization is completed, that is, the boot service table, runtime service table and system configuration table are initialized. Among them, the memory management interface service allocates memory space for the target firmware and can rely on the memory allocation function in the boot service table to implement the system reset operation. The system reset service can be implemented by calling the system reset function in the runtime service table. The information in the system configuration table (system management information) can provide a reference for hardware and system configuration for the entire firmware startup and operating system loading process, ensuring that each step can correctly interact and configure with the hardware. Finally, traverse the target boot device and find the system boot UEFIAPP (boot program) designed by the operating system manufacturer of the target boot device to complete the startup and operation of the target firmware on the operating system (OS) of the target boot device based on the boot program.

[0104] Specifically, in one embodiment, during the operation of the target firmware, the real-time monitoring mechanism of the target boot device can be used to collect device hardware status (CPU load and memory usage), system operation data (response time and error logs), and external environment information (network traffic, temperature and humidity). By analyzing this data, the firmware function is dynamically adjusted according to the current operating status. For example, when it is detected that the device temperature is too high, the operating priority of high-load functions in the firmware is automatically reduced, or the cooling fan control strategy is adjusted; if the network bandwidth fluctuates abnormally, the data transmission protocol parameters are optimized to ensure service stability.

[0105] Among them, such as Figure 5 As shown in FIG, a flow chart of an exemplary firmware function customization method provided in an embodiment of the present application is shown in FIG. Figure 5 The method shown is as follows Figure 2 The method shown is an exemplary embodiment, and the implementation principles of the two are the same and will not be repeated.

[0106] The firmware function customization method provided by the embodiment of the present application obtains the original firmware and the user's firmware function customization requirements; based on the firmware startup tool, according to the firmware function customization requirements, the original firmware is customized and modified to obtain the target firmware; it is determined whether the operating system of the target startup device of the target firmware is compatible with the firmware startup tool; when it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool, the file system information of the firmware startup tool is obtained; based on the file system information of the firmware startup tool, the firmware compatibility service is initialized; the firmware startup tool starts the target firmware on the target startup device based on the firmware compatibility service. The method provided by the above scheme initializes the firmware compatibility service using the file system information of the firmware startup tool when it is found that the operating system of the target startup device is incompatible with the firmware startup tool, and the firmware startup tool enables the target firmware to adapt to different operating systems and hardware environments based on the firmware compatibility service. Therefore, the technical problem that the firmware startup tool LinuxBoot is not compatible with multiple operating systems can be solved, and the technical effect of being compatible with multiple operating systems while realizing firmware customization modification can be achieved, so as to ensure that the customized target firmware can be stably started and run on different target startup devices and operating systems. Moreover, this technical solution is not affected by any platform hardware initialization system firmware startup solution. It runs independently in LinuxBoot, collects the information required by the operating system Loader in the LinuxBoot environment, and is compatible with UEFI, coreboot and other platform hardware initialization system firmware startup solutions.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0108] An embodiment of the present application also provides a firmware function customization device for executing the firmware function customization method provided in the above embodiment.

[0109] like Figure 6FIG. 6 is a schematic diagram of a firmware function customization device according to an embodiment of the present invention. The firmware function customization device 60 includes a first acquisition module 601 , a customization module 602 , a determination module 603 , a second acquisition module 604 , a compatibility module 605 and a startup module 606 .

[0110] Among them, the first acquisition module is used to obtain the original firmware and the user's firmware function customization requirements; the customization module is used to perform function customization modifications on the original firmware based on the firmware startup tool according to the firmware function customization requirements to obtain the target firmware; the judgment module is used to judge whether the operating system of the target startup device of the target firmware is compatible with the firmware startup tool; the second acquisition module is used to obtain the file system information of the firmware startup tool when it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool; the compatibility module is used to initialize the firmware compatibility service according to the file system information of the firmware startup tool; the startup module is used for the firmware startup tool to start the target firmware on the target startup device based on the firmware compatibility service.

[0111] For the description of the features in the embodiment corresponding to the firmware function customization device, please refer to the relevant description of the embodiment corresponding to the firmware function customization method, and no further details will be given here.

[0112] The embodiment of the present application also provides an electronic device, such as Figure 7 As shown, it is a structural diagram of an electronic device provided in an embodiment of the present application, including a processor 10 and a memory 20, in which a computer program is stored. The processor 10 is configured to run the computer program to execute the steps in any of the above-mentioned firmware function customization method embodiments.

[0113] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned firmware function customization method embodiments when running.

[0114] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0115] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned firmware function customization method embodiments are implemented.

[0116] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned firmware function customization method embodiments.

[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0118] The above is a detailed introduction to a firmware function customization method, device, electronic device and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A method for customizing firmware functions, characterized in that: include: Obtain the original firmware and the user's firmware function customization requirements; Based on the firmware startup tool, according to the firmware function customization requirements, the original firmware is modified for function customization to obtain the target firmware; Determine whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool; When it is determined that the operating system of the target boot device of the target firmware is incompatible with the firmware boot tool, obtaining file system information of the firmware boot tool; Initializing a firmware compatibility service according to the file system information of the firmware startup tool; The firmware startup tool starts the target firmware on the target startup device based on the firmware compatible service.

2. The firmware function customization method according to claim 1, characterized in that: The firmware startup tool performs function customization modification on the original firmware according to the firmware function customization requirement to obtain the target firmware, including: Determine the functional modules to be modified and / or the functional modules to be added according to the firmware function customization requirements; If there is a function module to be modified, modify the code of the corresponding function module to be modified in the original firmware based on the firmware startup tool; In the case that a new functional module exists, the corresponding software and hardware interface initialization processing is performed based on the firmware startup tool according to the attribute information of the new functional module, so that the obtained target firmware supports the new functional module.

3. The firmware function customization method according to claim 1, characterized in that: The determining whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool includes: Traversing the device system files of the target boot device of the target firmware to determine whether the device system files include the target system files; In a case where it is determined that the device system file includes a target system file, determining that an operating system of a target boot device of the target firmware is compatible with the firmware boot tool; The target system file includes a system feature file of the firmware startup tool.

4. The firmware function customization method according to claim 1, wherein: Initializing the firmware compatibility service according to the file system information of the firmware startup tool includes: Determine the starting address, ending address, and memory type of each memory area based on the system memory information of the target boot device; Generate a target memory data structure compatible with the firmware standard based on the start address, end address and memory type of each memory area; Initializing a memory management interface service based on the target memory data structure; The file system information of the firmware startup tool includes the system memory information of the target startup device, and the firmware compatible service includes the memory management interface service, which is used to access various memory areas.

5. The firmware function customization method according to claim 1, characterized in that: Initializing the firmware compatibility service according to the file system information of the firmware startup tool includes: Determining a hardware configuration interface protocol of an operating system of the target boot device according to the system hardware configuration information of the target boot device; Initializing a system reset service according to the hardware configuration interface protocol of the operating system of the target boot device; The file system information of the firmware startup tool includes the system hardware configuration information of the target startup device, and the firmware compatible service includes the system reset service, which is used to perform a system reset operation on the target startup device.

6. The firmware function customization method according to claim 1, characterized in that: The firmware startup tool starts the target firmware on the target startup device based on the firmware compatible service, including: The firmware startup tool allocates memory space required for the target firmware to run in the target startup device based on a memory management interface service; Based on the system reset service, performing a system reset operation on the target boot device to initialize the operating system of the target boot device; Loading a boot program of the operating system of the target boot device into the allocated memory space, and starting the target firmware based on the boot program to start the target firmware on the target boot device; The firmware compatibility service includes the memory management interface service and the system reset service.

7. The firmware function customization method according to claim 1, characterized in that: The method further comprises: When it is determined that the operating system of the target boot device of the target firmware is compatible with the firmware boot tool, the target firmware is booted on the target boot device based on the native system boot mechanism of the firmware boot tool.

8. A firmware function customization device, characterized in that: include: The first acquisition module is used to obtain the original firmware and the user's firmware function customization requirements; A customization module is used to modify the original firmware to obtain a target firmware based on the firmware startup tool and the firmware function customization requirements; A judging module, configured to judge whether the operating system of the target boot device of the target firmware is compatible with the firmware boot tool; A second acquisition module is configured to acquire file system information of the firmware startup tool when it is determined that the operating system of the target startup device of the target firmware is incompatible with the firmware startup tool; A compatibility module, configured to initialize a firmware compatibility service according to file system information of the firmware startup tool; A startup module is used for the firmware startup tool to start the target firmware on the target startup device based on the firmware compatible service.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the firmware function customization method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the firmware function customization method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Chip, chip starting method and electronic equipment

    CN121116410A