Base address register configuration method and electronic devices
By providing a base address register configuration interface during server startup, including switches for controlling capacity adjustment and selecting capacity configuration methods, the resource waste and addressing limit exceedance issues caused by enabling a single switch are resolved. This enables flexible adjustment and anomaly detection, improving configuration efficiency and device stability.
Patent Information
- Application Number
- CN202511292692.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-09-10
AI Technical Summary
In existing technologies, enabling the base address register with a single switch leads to resource waste and addressing over-limit issues. This is especially true when servers are equipped with a variety of graphics processors, where the size of the base address register often does not match the actual needs, and may even cause anomalies or crashes.
A base address register configuration method is provided, which displays a configuration interface during server startup, including a first switch and a second switch. The first switch is used to control the enabling and disabling of the capacity adjustment function, and the second switch is used to select the capacity configuration mode, supporting both automatic and manual modes. The configuration is based on the capacity adjustment range of the hardware device, and alarm information is generated to avoid exceeding the limit.
It enables flexible adjustment of the base address register capacity, avoids resource waste and addressing overruns, improves configuration efficiency, and provides anomaly detection alarms to ensure normal device operation.
Smart Images

Figure CN120780381B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of hardware management technology, and in particular to a base address register configuration method and an electronic device. Background Technology
[0002] Adjustable base address registers allow the graphics card to directly access system memory, bypassing the central processing unit (CPU), reducing latency, and improving performance. Enabling this feature requires support from the graphics card hardware, motherboard Basic Input / Output System (BIOS), operating system drivers, and applications. According to the Peripheral Component Interconnect (PCI) specification, the address space size can be adjusted by modifying the base address register size register; the BIOS allocates resources according to the configuration during device enumeration. The latest BIOS systems provide an adjustable base address register switch; enabling this will set the base address register size of devices that support this feature to the maximum value.
[0003] However, in actual use, due to the wide variety of graphics processors used in servers, the size of the base address register often does not match the actual needs, or even exceeds the addressing capability of the central processing unit. Relying solely on a single switch to enable the adjustable base address register can easily lead to resource waste, or even cause anomalies or crashes. Summary of the Invention
[0004] This application provides a base address register configuration method and an electronic device to at least solve the problems of wasted resources and addressing limits when enabling the base address register with a single switch in the related art.
[0005] This application provides a base address register configuration method, comprising: displaying a base address register configuration interface during server startup, the configuration interface displaying a first switch and a second switch, wherein the first switch is used to control the enabling and disabling of the capacity adjustment function of the base address register address space, and the second switch is used to control the capacity configuration mode of the base address register address space, including automatic mode and manual mode; reading the capacity adjustment range of the base address register corresponding to the hardware device, and configuring the base address register corresponding to the hardware device according to the first switch and the second switch, wherein, when the capacity configuration mode is automatic, the capacity of the address space of the base address register is automatically configured, and a first alarm message is generated when the current value of the address space capacity exceeds the capacity adjustment range; when the capacity configuration mode is manual, responding to the user's first interactive action, and manually configuring the capacity of the address space of the base address register within the capacity adjustment range.
[0006] This application provides a base address register configuration device, comprising: a display module for displaying a base address register configuration interface during server startup, the configuration interface displaying a first switch and a second switch, wherein the first switch is used to control the opening and closing of the capacity adjustment function of the base address register address space, and the second switch is used to control the capacity configuration mode of the base address register address space, the capacity configuration mode including automatic mode and manual mode; a first configuration module for reading the capacity adjustment range of the base address register corresponding to the hardware device, and configuring the base address register corresponding to the hardware device according to the first switch and the second switch, wherein, when the capacity configuration mode is automatic, the capacity of the address space of the base address register is automatically configured, and a first alarm message is generated when the current value of the address space capacity exceeds the capacity adjustment range; and a second configuration module for, when the capacity configuration mode is manual, responding to a first user interaction action, and manually configuring the capacity of the address space of the base address register within the capacity adjustment range.
[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the above-described base address register configuration method when executing the computer program.
[0008] This application also provides a non-volatile computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described base address register configuration method.
[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described base address register configuration method.
[0010] This application provides a base address register configuration interface during server startup. The interface includes a first switch for controlling the enabling or disabling of the base address register address space capacity adjustment function, and a second switch for selecting the capacity configuration mode, which includes automatic and manual modes. It reads the capacity adjustment range of the corresponding base address register of the hardware device and configures it according to the first and second switches. In automatic mode, the address space capacity is automatically configured, and a first alarm message is generated when the current capacity value exceeds the capacity adjustment range. In manual mode, it responds to the user's first interactive action and manually configures the address space capacity within the capacity adjustment range. Therefore, it solves the problems of resource waste and addressing limit exceedances associated with single-switch base address register activation in related technologies, achieving flexible base address register adjustment and anomaly detection alarms. Attached Figure Description
[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating a base address register configuration method provided in an embodiment of this application;
[0013] Figure 2 A flowchart illustrating the base address register capacity configuration and information acquisition process provided in this application embodiment;
[0014] Figure 3 This is a schematic diagram of the base address register configuration interface provided in an embodiment of this application;
[0015] Figure 4 A flowchart for base address register capacity configuration verification provided in this application embodiment;
[0016] Figure 5 A flowchart illustrating the base address register capacity configuration interaction provided in this application embodiment;
[0017] Figure 6 A complete flowchart illustrating the base address register configuration method provided in this application embodiment;
[0018] Figure 7 This is a schematic diagram of the structure of the base address register configuration device provided in the embodiments of this application;
[0019] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0021] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0022] To enable those skilled in the art to better understand the present application, the following description is provided in conjunction with the appendix. Figure 1 The present application will be further described in detail with reference to specific embodiments.
[0023] The embodiments of this application provide a base address register configuration method, and the method is described in detail below in conjunction with the execution flow of the base address register configuration method.
[0024] Figure 1 This is a schematic diagram of a base address register configuration method provided in an embodiment of this application, as shown below. Figure 1 As shown, the base address register configuration method includes the following steps:
[0025] In step S101, the configuration interface of the base address register is displayed during the server startup process. The configuration interface displays a first switch and a second switch. The first switch is used to control the opening and closing of the capacity adjustment function of the base address register address space, and the second switch is used to control the capacity configuration mode of the base address register address space. The capacity configuration mode includes automatic mode and manual mode.
[0026] The base address register is a register in a high-speed interconnect device for peripheral components used to indicate the starting address and size of the memory address space. In this application, the base address register can be adjusted in capacity through a configuration interface. The first switch is the master switch for the base address register, used to enable or disable the base address register capacity adjustment function. The second switch is the master switch for controlling the base address register capacity, used to select the base address register capacity configuration mode, which in this application is used to switch between automatic and manual modes. The capacity configuration mode is the way to set the base address register capacity, which in this application represents two modes: automatic mode and manual mode. The automatic mode is the configuration mode for the base address register capacity automatically selected by the embodiment of this application, in which the basic input / output system automatically allocates capacity according to resources. The manual mode is the configuration mode for the base address register capacity directly specified by the user, which in this application represents the user manually setting the capacity through the configuration interface.
[0027] Understandably, by displaying the base address register configuration interface during server startup and setting a first and second switch within this interface, users can control the capacity adjustment function and configuration method of the base address register address space during device initialization. On one hand, the first switch makes enabling and disabling the capacity adjustment function more flexible; on the other hand, the second switch provides both automatic and manual options, allowing users to rely on automatic allocation for simplified operation or achieve accurate capacity control through manual configuration.
[0028] In step S102, the capacity adjustment range of the base address register corresponding to the hardware device is read, and the base address register corresponding to the hardware device is configured according to the first switch and the second switch. When the capacity configuration mode is automatic, the capacity of the address space of the base address register is automatically configured, and a first alarm message is generated when the current value of the address space capacity exceeds the capacity adjustment range.
[0029] The first alarm message is used to generate a prompt on the configuration interface when it is detected that the base address register capacity configuration exceeds the supported range, or that the setting is too large and may affect performance, so as to remind the user of the risk and guide them to make adjustments.
[0030] It is understandable that by further identifying the current state of the second switch after the capacity adjustment function is enabled, the two capacity configuration strategies of automatic and manual modes can be flexibly distinguished. When the second switch is in automatic mode, the embodiments of this application can automatically complete the allocation of the base address register address space capacity according to the hardware device characteristics and resource status, improving configuration efficiency and reducing manual intervention.
[0031] Specifically, when the user turns on the second switch, if the second switch is in the second state, this embodiment of the application will determine the option category of the current value of the third switch for the base address register capacity of each device. If the current value is the automatic option and the range of base address register capacities supported by the device is too large, it is determined that the automatically allocated capacity may pose a risk; if the current value is the adjustment option, but the configured capacity exceeds a reasonable range, it is also considered an improper configuration. In both of the above cases, this embodiment of the application will generate a prompt message under the third switch of the device, reminding the user that the current base address register capacity configuration is too large, which may affect the normal use of the device's base address register function, and suggesting that the base address register capacity setting be appropriately reduced.
[0032] In one embodiment of this application, configuring the base address register corresponding to the hardware device according to the first switch and the second switch includes: when the capacity adjustment function is enabled based on the first switch, identifying the current state of the second switch, the current state of the second switch includes a first state and a second state, the capacity configuration mode corresponding to the first state is automatic mode, and the capacity configuration mode corresponding to the second state is manual mode; if the current state of the second switch is the first state, then the capacity configuration mode is determined to be automatic mode, the automatic mode process includes: automatically configuring the capacity of the address space of the base address register corresponding to the hardware device according to the preset capacity configuration parameters; if the current state of the second switch is the second state, then the capacity configuration mode is determined to be manual mode, the manual mode process includes: displaying at least one third switch on the configuration interface, responding to the user's first interactive action, and manually configuring the capacity of the address space of the base address register based on the third switch within the capacity adjustment range.
[0033] The third switch is a separate switch for the base address register capacity of each device. The first interactive action is the user's operation of the third switch on the configuration interface, used to adjust the base address register capacity of a single hardware device.
[0034] It is understandable that by further identifying the current state of the second switch after the capacity adjustment function is enabled, the two capacity configuration strategies of automatic and manual modes can be flexibly distinguished. When the second switch is in automatic mode, this embodiment can automatically complete the allocation of the base address register address space capacity according to the hardware device characteristics and resource status, improving configuration efficiency and reducing manual intervention. When the second switch is in manual mode, the administrator can make fine-grained capacity settings according to specific needs to meet differentiated performance optimization and resource management requirements. When the second switch is in the first state, this embodiment will automatically configure the base address register capacity of each hardware device according to the preset capacity parameters, without requiring manual adjustment by the user, saving the user time of setting each device individually, avoiding errors caused by manual operation, and ensuring that the capacity of all devices is configured according to a unified standard. When the second switch is in the second state, this embodiment will display the third switch corresponding to each device in the configuration interface, allowing the user to manually adjust the base address register capacity of each hardware device according to actual needs. In this way, users can make personalized settings for specific devices, such as allocating larger capacity to high-performance devices and keeping the default capacity for low-load devices, thereby optimizing resource utilization efficiency.
[0035] In one embodiment of this application, before the capacity adjustment function of the base address register address space based on the first switch is enabled, the method further includes: responding to a third user interaction action and controlling the current state of the first switch, wherein the current state includes an on state and a off state, the capacity adjustment function is enabled in the on state and the capacity adjustment function is disabled in the off state.
[0036] The third interactive action is the user's operation on the first switch on the configuration interface, which is the user's active choice to set the first switch to the on or off state.
[0037] It is understandable that by introducing a third interactive action to control the state of the first switch before the capacity adjustment function is enabled, the user can actively select the base address register capacity adjustment function. When the user selects the enabled state, this embodiment enters the capacity adjustable mode, providing a prerequisite for subsequent automatic or manual capacity configuration; when the user selects the disabled state, this embodiment maintains the default configuration to avoid additional impact on resource allocation.
[0038] In one embodiment of this application, responding to a user's first interactive action, manually configuring the capacity of the base address register's address space within the capacity adjustment range based on a third switch includes: responding to the user's first interactive action, controlling the current option of the third switch, wherein the current option includes an automatic option and an adjustment option, the capacity configuration mode corresponding to the automatic option is automatic mode, and the capacity configuration mode corresponding to the adjustment option is manual mode; if the current option of the third switch is the automatic option, then the capacity configuration mode is determined to be automatic mode, the automatic mode process includes: automatically configuring the capacity of the address space of the base address register corresponding to the hardware device according to the preset capacity configuration parameters; if the current option of the third switch is the adjustment option, then displaying the capacity adjustment range of the base address register's address space on the configuration interface, responding to the user's second interactive action, and adjusting the capacity of the address space of the base address register corresponding to the hardware device within the capacity adjustment range.
[0039] The second interactive action is the user's behavior of operating on specific values within the capacity adjustment range on the configuration interface.
[0040] It is understood that, through the automatic option of the third switch, this embodiment of the application can uniformly apply the preset capacity strategy, avoiding potential conflicts or configuration errors caused by manual operation. The adjustment option allows users to intuitively view the adjustable capacity range of each device in the configuration interface, and combined with the second interactive action, ensures that the capacity adjustment matches the actual load requirements and performance goals. After the user adjusts the address space capacity of the base address register corresponding to the hardware device, this embodiment of the application can promptly detect whether there is a situation that exceeds the hardware support range or is too large by obtaining and verifying the current capacity value, and generate a first alarm message in the configuration interface to prompt the user that the current configuration may affect the normal functioning of the device, effectively avoiding the operational risks caused by incorrect configuration.
[0041] Specifically, the third switch is dynamically generated based on the structure information collected by the basic input / output system during power-on. The display name of the third switch can consist of one or more fields from the device name, the device's location information in the machine, or the bus, device, and function number. Optional values are adjustment options (the capacity range supported by the device) and automatic options (the default value is the default capacity recorded in the device's hardware register).
[0042] Taking a workstation as an example, assuming that this embodiment includes a high-performance graphics card, a high-speed storage device, and a low-computation auxiliary processing card. During the boot process, the Basic Input / Output System (BIOS) collects the structural information of each device, including the device name, slot location, bus, device, and function number. Based on this information, a third switch is dynamically generated. The display name of each switch may be displayed as "Graphics Card - GPU Slot 1 - BDF0:1:0" or "Storage Card - PCIe Slot 2 - BDF0:2:0", allowing the user to clearly identify the corresponding device.
[0043] For each third switch, the user can choose between an adjustable option or an automatic option. The adjustable option allows the user to manually set the base address register capacity within the capacity range supported by the device. For example, allocating a larger capacity to a high-performance graphics card to improve graphics computing performance, allocating a moderate capacity to a high-speed storage device to ensure data throughput, and keeping the auxiliary processing card at its minimum capacity to save resources. The automatic option directly uses the default capacity recorded in the device's hardware registers, automatically configured by the embodiments of this application, suitable for devices with insensitive performance requirements. In this way, the third switch not only intuitively displays information about each device but also allows users to flexibly adjust the capacity according to actual application scenarios, thereby optimizing resource allocation and overall performance.
[0044] Specifically, the interaction process for configuring the base address register capacity in this application embodiment is as follows: Figure 2 As shown:
[0045] In step S201, the configuration interface sets up adjustable options for the capacity base address register, providing an operation entry point as the starting point of the process, and establishing an interaction channel between the user and the configuration function.
[0046] Next, in step S202, the first and second switches are generated and the configuration logic is divided, that is, the first switch controls the start and stop of the capacity adjustment function, and the second switch selects the configuration mode.
[0047] Subsequently, in step S203, the third switch for each device is dynamically generated based on the structure: the structure containing device information is read, and a third switch is generated for each hardware device that supports capacity adjustment, so as to achieve precise control of a single device and avoid the adaptation problem of unified configuration.
[0048] In step S204, the selectable values are specified as the capacity range supported by the hardware and automatic options, thus clarifying the operational boundaries and lowering the threshold.
[0049] In step S205, the current value is set to the default capacity of the device by default. If the user modifies it, it will be updated to ensure that the device operates according to the preset when there is no intervention and responds to the user's intention when there is intervention.
[0050] Finally, in step S206, the current value of the relevant option is filled into the base address register capacity register, the interface configuration value is written into the hardware register, and converted into actual running parameters. Through hierarchical control and dynamic adaptation, the conversion from interface operation to hardware configuration is realized.
[0051] In one embodiment of this application, after controlling the current state of the first switch, the method further includes: if the current state of the first switch is closed, then hiding the second switch; if the current state of the first switch is open, then displaying the second switch; if the current state of the second switch is a first state, then hiding the third switch; if the current state of the second switch is a second state, then displaying the third switch.
[0052] Understandably, by dynamically controlling the display and hiding of the second and third switches based on the states of the first and second switches, the configuration interface can present a layered and progressive interactive logic. This avoids displaying invalid or redundant options when the function is not enabled, reducing user interference and misoperation, and displays further configuration entry points as needed when the function is enabled, improving the simplicity of the interface and the intuitiveness of the interaction.
[0053] Specifically, this application creates hierarchical options for adjusting the capacity of the base address register in the server's configuration interface. First, a first switch is set. This switch can be either on or off, with the default value being off. When the first switch is off, all options related to base address register configuration are hidden; when the user sets this switch to on, a second switch is displayed in the configuration interface.
[0054] Secondly, a second switch is configured to control the capacity configuration mode. The selectable values are "First State" and "Second State," corresponding to automatic and manual modes respectively, with the default being "First State." When this option is in "First State," the configuration interface hides the third switch and does not display configuration items for specific devices; when set to "Second State," the third switch is displayed in the configuration interface.
[0055] Specifically, the configuration interface 30 in this application embodiment is as follows: Figure 3As shown, in the base address register configuration interface, the state of the first switch 301 (the main switch for capacity adjustment function) is first determined. If it is in the off state, the second switch 302 and the third switch 303 will be hidden. If the first switch 301 is in the on state, the second switch 302 (capacity configuration mode selection) will be displayed. Then, the state of the second switch 302 will be determined. If it is in automatic mode, the third switch 303 will be hidden and the capacity will be configured automatically. If it is in manual mode, the third switch 303 (single device capacity configuration) will be displayed. Then, the state of the third switch 303 will be determined. If it is in automatic mode, the default capacity or preset parameters will be used to configure the capacity of a single device. If it is in adjustment mode, the capacity adjustment range will be displayed, and the user can manually set the capacity of a single device.
[0056] In one embodiment of this application, before displaying the configuration interface of the base address register during the server startup process, the method further includes: identifying the extended functions of the hardware device during the hardware device enumeration process; identifying whether the hardware device supports the capacity adjustment function of the base address register based on the extended functions; if the hardware device supports the capacity adjustment function of the base address register, obtaining the device information of the hardware device, constructing structure information based on the device information; and generating at least one of the first switch, the second switch, and the third switch based on the structure information.
[0057] It is understood that by identifying extended functions during the hardware device enumeration phase, the embodiments of this application can accurately determine whether a device supports the base address register capacity adjustment function, avoiding invalid configuration or resource waste. Detailed device information of the hardware device is obtained and a structure is constructed, so that the identity information, address information, capacity range, and default values of each hardware device supporting this function are managed in a structured manner.
[0058] In one embodiment of this application, identifying whether a hardware device supports the capacity adjustment function of a base address register based on extended functions includes: reading a list of function identifiers for extended functions; if a function identifier for the capacity adjustment function is read from the list of function identifiers, then it is determined that the hardware device supports the capacity adjustment function of the base address register.
[0059] Among them, the hardware device is a peripheral device that supports the interface of a high-speed interconnect device for peripheral components; the extended function is a structure in the configuration space of the high-speed interconnect device for peripheral components used to add additional function descriptions, which in this application can be used to identify the additional function modules supported by the hardware device; the function identifier is a unique identifier corresponding to each extended function, which in this application is a number used to distinguish different extended functions; the capacity adjustment function is a function that can adjust the capacity of the base address register address space, which in this application represents the ability to dynamically change the capacity of the base address register.
[0060] Understandably, by identifying whether a hardware device supports base address register capacity adjustment based on its extended functions, an accurate assessment of the device's resource capabilities can be achieved. Specifically, by reading the list of extended function identifiers, if the identifier for capacity adjustment is detected, it can be determined that the device supports base address register capacity adjustment.
[0061] For example, when the basic input / output system traverses the configuration space of each peripheral component high-speed interconnect device to expand the functional structure, it can read the function identifier of the capacity adjustment function from the function identifier list. If the function identifier of the capacity adjustment function is 0x15, it can be determined that the device has the ability to adjust the capacity of the base address register address space.
[0062] In one embodiment of this application, obtaining device information of a hardware device includes: reading a first register and a second register of the device hardware, wherein the first register stores the capacity adjustment range of the base address register address space supported by the hardware device, and the second register stores the default capacity of the base address register address space supported by the hardware device, the default capacity being a pre-set capacity; recording the function identifier, physical slot number, device path, manufacturer number, and device number of the hardware device; and generating device information of the hardware device based on at least one of the capacity adjustment range, default capacity, function identifier, slot number, device path, manufacturer number, and device number.
[0063] Wherein, the first register is the base address register function register; the second register is the base address register control register; the slot number is the number of the physical slot in which the hardware device is installed on the server, and in this application represents the basis for the device's location in the physical machine; the manufacturer number is the unique number of the hardware device manufacturer, and in this application represents the identifier that distinguishes the device manufacturer; the device number is the unique number of the hardware device model, and in this application represents the identifier that distinguishes the specific device; the device path is the access path that identifies the device in the topology of this application embodiment, and in this application represents information for locating the device's hierarchical relationship; the default capacity is the base address register capacity preset by the hardware device when it is not adjusted, and in this application represents the default size recorded by the register.
[0064] It is understandable that by reading the first register and the second register, the range of base address register capacity adjustment and the default capacity supported by the hardware device can be accurately obtained; by simultaneously recording key information such as function identifier, slot number, device path, manufacturer number and device number, and generating complete device information based on the above information, the capabilities, location and identity of the hardware device can be comprehensively described and accurately identified.
[0065] In one embodiment of this application, constructing structure information based on device information includes: matching slot numbers with pre-configured location correspondences in the machine; determining the device name of the hardware device based on the manufacturer number and device number; and constructing structure information based on the hardware device's location information in the machine, device name, manufacturer number, device number, function identifier, device path, capacity adjustment range, and default capacity.
[0066] Among them, the structure information is a data structure used to organize and store device information. In this application, it represents the structured result generated by matching slot number, manufacturer number, device number and other relevant information.
[0067] It is understood that through this structure, the embodiments of this application can completely and accurately record the identity information and resource capabilities of each hardware device, providing basic data support for subsequent capacity configuration and resource allocation.
[0068] Specifically, this application first matches the physical slot number of the hardware device with the pre-configured actual location of the basic input / output (PI) within the machine to determine the specific installation location of each device. Next, it further utilizes the manufacturer's serial number and device serial number to match each hardware device with its corresponding device name, thereby achieving accurate device identification. Finally, the basic information of each hardware device is integrated into a structure, which includes the hardware device's location information within the machine, device name, manufacturer's serial number, device serial number, function identifier, device path, capacity adjustment range, and default capacity.
[0069] The specific steps for constructing structure information based on device information in this embodiment are as follows: Figure 4 As shown:
[0070] In step S401, peripheral high-speed interconnect devices are enumerated; in step S402, it is determined whether capacity adjustment is supported. If not, the enumeration is restarted. If it is supported, the process proceeds to step S403 to obtain device information and write it into the structure; then in step S404, the base address register capacity is configured according to the option value; finally, in step S405, it is determined whether the enumeration has ended. If not, the process returns to step S401 to loop through the enumeration. If it ends, the process terminates.
[0071] The process of S403 acquiring device information and writing it into the structure is as follows:
[0072] First, this application embodiment establishes a structure for storing hardware device information. This structure includes the hardware device's location information in the machine, device name, manufacturer number, device number, function identifier, device path, capacity adjustment range, and default capacity. Simultaneously, a correspondence table between manufacturer number, device number, and device name, as well as a correspondence table between physical slot number and device location in the machine, are pre-established in the basic input / output system to provide a basis for subsequent matching.
[0073] Secondly, during the enumeration of high-speed interconnect devices for peripheral components in the basic input / output system, the extended function structure of each device is traversed. When a function identifier for capacity adjustment is detected in the function identifier list, such as function identifier 0x15, it is considered that the device supports the capacity adjustment function of the base address register. Subsequently, the manufacturer number and device number of the device are written into the structure, and the device name is obtained by matching it with a pre-established lookup table and written into the structure.
[0074] Next, the first and second registers of the device supporting base address register capacity adjustment are read. The range of base address register capacities supported by the device is determined by the values of the registers, and each capacity is recorded by corresponding to a binary bit, where 1 represents supported capacity and 0 represents unsupported capacity. This binary number is then written into the structure. Simultaneously, the register representing the default capacity is read, and the default capacity is written into the structure in the same way.
[0075] Finally, the device path of the device that supports the base address register capacity adjustment function is read and written into the structure. At the same time, the physical slot number of its parent bridging device is read, and the specific location information of the device in the machine is obtained by matching with a pre-set corresponding table and written into the structure.
[0076] Through the above steps, the embodiments of this application can completely and accurately record the identity information, address information, capacity range and default configuration of each peripheral component high-speed interconnect device that supports the base address register capacity adjustment function.
[0077] In step S103, when the capacity configuration mode is manual, the capacity of the base address register's address space is manually configured within the capacity adjustment range in response to the user's first interactive action.
[0078] Understandably, this application provides users with flexible adjustment methods when the automatic configuration results cannot meet the needs of specific application scenarios, enabling users to personalize the capacity settings according to actual needs, thereby improving the controllability and adaptability of the system.
[0079] In one embodiment of this application, after manually configuring the capacity of the address space of the base address register within the capacity adjustment range, the method further includes: obtaining the current capacity value and capacity threshold of the address space of the base address register corresponding to the hardware device; and generating a second alarm message when the current capacity value exceeds the capacity threshold.
[0080] The second alarm message indicates that when the second switch is in the first state, it is detected that the base address register capacity supported by certain hardware devices is abnormally large, which may affect the normal use of the function. A prompt is generated on the configuration interface to remind the user of the risk and guide them to make adjustments.
[0081] It is understandable that verifying the configuration result after configuring the base address register capacity in automatic mode can promptly detect potential risks when the actual allocated capacity exceeds a preset threshold, thus preventing abnormal device resource functions due to excessively large automatic allocation results. Furthermore, by generating a second alarm message in the configuration interface, this embodiment of the application can clearly indicate the source of the problem to the user at the first moment.
[0082] Specifically, when the user activates the second switch, if the second switch is in the first state, this application will read the base address register capacity range supported by each device in the structure. If an abnormally large capacity is detected (the specific judgment criteria can be determined based on factors such as platform type and device characteristics), a second alarm message will be generated under the second switch to remind the user that the current hardware device has an abnormally large supported base address register capacity, which may cause the base address register function to malfunction. To reduce the risk, it is recommended that the user adjust the second switch to the second state and manually select an appropriate base address register capacity for each device.
[0083] Figure 5 The document demonstrates the base address register capacity adjustment function and its related configuration check and alarm information processing flow, specifically including the following steps:
[0084] In step S501, the configuration interface sets the adjustable capacity base address register capacity information; then in step S502, it is determined whether the first switch is in the open state, and only if the first switch is in the open state will the process proceed to step S503; in step S503, the state of the second switch is determined, and different states correspond to different subsequent verification paths.
[0085] If the second switch is in the first state, proceed to step S504 to verify whether the base address register capacity range supported by each device is too large; if the second switch is in the second state, proceed to step S505 to determine whether the third switch is an automatic option or an adjustment option. If the third switch is an automatic option, proceed to step S506 to verify whether the base address register capacity range supported by the option is too large; if the third switch is an adjustment option, proceed to step S507 to verify whether the value configured by the option is too large.
[0086] If any of the verification judgments in steps S503, S506, and S507 is "yes", that is, the value of the option configuration range or the base address register capacity range is too large, then proceed to step S508 to add alarm information. In this way, through multi-level switch status judgment and capacity range and configuration value verification, the rationality check and alarm triggering of the base address register capacity configuration can be realized.
[0087] In summary, the complete steps of the base address register configuration method provided in this application embodiment are as follows: Figure 6 As shown, this application comprises a complete process consisting of an information collection and configuration module, an option display module, and an anomaly alarm module. In the information collection and configuration module, high-speed interconnect devices for peripheral components are first enumerated. Then, information on such devices that support base address register capacity adjustment is collected. The relevant data is then filled into the base address register capacity register, ultimately completing the resource allocation for the high-speed interconnect devices and laying a solid hardware data foundation for subsequent processes. The option display module, based on the information collected by the former, first creates options in the configuration interface, then generates a first switch, a second switch, a third switch, and corresponding options. Subsequently, based on user operations, the current values of the selected and saved options are fed back to the information collection and configuration module, realizing the transformation from hardware capabilities to a user-interactive configuration interface. The anomaly alarm module first sets alarm information in the configuration interface, then determines the alarm strategy based on the current values of each option. If an anomaly is detected in the configuration, alarm information is added to monitor the rationality of the configuration and ensure the safe and stable operation of the entire process.
[0088] The base address register configuration method of this application provides a base address register configuration interface during server startup. This interface includes a first switch for controlling the enabling or disabling of the base address register address space capacity adjustment function, and a second switch for selecting the capacity configuration mode. The configuration mode includes automatic mode and manual mode. In automatic mode, the capacity of the base address register corresponding to the hardware device can be automatically configured according to preset parameters. In manual mode, at least one third switch can be displayed on the interface to adjust the capacity of the base address register corresponding to each hardware device in response to user operation, and address space can be flexibly allocated according to different devices and different states. Therefore, it solves the problems of wasting resources and addressing limits when enabling the base address register with a single switch in related technologies, and achieves the effect of flexibly adjusting the base address register and detecting alarms for anomalies.
[0089] Figure 7 This is a schematic diagram of a base address register configuration device provided in an embodiment of this application, as shown below. Figure 7 As shown, the base address register configuration device 10 includes: a display module 100, a first configuration module 200, and a second configuration module 300.
[0090] The display module 100 is used to display the configuration interface of the base address register during the server startup process. The configuration interface displays a first switch and a second switch. The first switch controls the opening and closing of the capacity adjustment function of the base address register address space, and the second switch controls the capacity configuration mode of the base address register address space, which includes automatic mode and manual mode. The first configuration module 200 is used to read the capacity adjustment range of the base address register corresponding to the hardware device and configure the base address register corresponding to the hardware device according to the first switch and the second switch. When the capacity configuration mode is automatic, the capacity of the address space of the base address register is automatically configured, and a first alarm message is generated when the current value of the address space capacity exceeds the capacity adjustment range. The second configuration module 300 is used to respond to the user's first interaction action when the capacity configuration mode is manual and manually configure the capacity of the address space of the base address register within the capacity adjustment range.
[0091] In one embodiment of this application, the first configuration module is further configured to identify the current state of the second switch when the capacity adjustment function is enabled based on the first switch control. The current state of the second switch includes a first state and a second state. The capacity configuration mode corresponding to the first state is automatic mode, and the capacity configuration mode corresponding to the second state is manual mode. If the current state of the second switch is the first state, the capacity configuration mode is determined to be automatic mode. The automatic mode process includes: automatically configuring the capacity of the address space of the base address register corresponding to the hardware device according to the preset capacity configuration parameters. If the current state of the second switch is the second state, the capacity configuration mode is determined to be manual mode. The manual mode process includes: displaying at least one third switch on the configuration interface, responding to the user's first interactive action, and manually configuring the capacity of the address space of the base address register based on the third switch within the capacity adjustment range.
[0092] In one embodiment of this application, the first configuration module 200 is further configured to respond to a user's first interactive action and control the current option of the third switch. The current option includes an automatic option and an adjustment option. The capacity configuration mode corresponding to the automatic option is automatic mode, and the capacity configuration mode corresponding to the adjustment option is manual mode. If the current option of the third switch is the automatic option, the capacity configuration mode is determined to be automatic mode. The automatic mode process includes: automatically configuring the capacity of the address space of the base address register corresponding to the hardware device according to the preset capacity configuration parameters. If the current option of the third switch is the adjustment option, the capacity adjustment range of the address space of the base address register is displayed on the configuration interface, and the user's second interactive action is responded to. Within the capacity adjustment range, the capacity of the address space of the base address register corresponding to the hardware device is adjusted.
[0093] In one embodiment of this application, before the capacity adjustment function based on the address space of the control base address register of the first switch is enabled, the control module is further used to respond to the user's third interactive action and control the current state of the first switch, wherein the current state includes an on state and a off state, the capacity adjustment function is enabled corresponding to the on state, and the capacity adjustment function is disabled corresponding to the off state.
[0094] In one embodiment of this application, before displaying the configuration interface of the base address register during the server boot process, the generation module is further configured to identify the extended functions of the hardware device during the hardware device enumeration process; identify whether the hardware device supports the capacity adjustment function of the base address register based on the extended functions; if the hardware device supports the capacity adjustment function of the base address register, obtain the device information of the hardware device, construct the structure information based on the device information; and generate at least one of the first switch, the second switch, and the third switch based on the structure information.
[0095] In one embodiment of this application, the first configuration module 200 is further configured to read the function identifier list of extended functions; if the function identifier of the capacity adjustment function is read from the function identifier list, it is determined that the hardware device supports the capacity adjustment function of the base address register.
[0096] In one embodiment of this application, the first configuration module 200 is further configured to read the first register and the second register of the device hardware, wherein the first register stores the capacity adjustment range of the base address register address space supported by the hardware device, and the second register stores the default capacity of the base address register address space supported by the hardware device, the default capacity being a pre-set capacity; and records the function identifier, physical slot number, device path, manufacturer number, and device number of the hardware device, and generates device information of the hardware device based on at least one of the capacity adjustment range, default capacity, function identifier, slot number, device path, manufacturer number, and device number.
[0097] In one embodiment of this application, the first configuration module 200 is further configured to match the slot number with the pre-configured location correspondence in the machine; determine the device name of the hardware device according to the manufacturer number and the device number; and construct structure information according to the location information of the hardware device in the machine, the device name, the manufacturer number, the device number, the function identifier, the device path, the capacity adjustment range and the default capacity.
[0098] In one embodiment of this application, after manually configuring the capacity of the address space of the base address register within the capacity adjustment range, the acquisition module is further used to acquire the current capacity value and capacity threshold of the address space of the corresponding base address register of the hardware device; and to generate a second alarm message when the current capacity value exceeds the capacity threshold.
[0099] The base address register configuration device of this application provides a base address register configuration interface during server startup. This interface includes a first switch for controlling the enabling or disabling of the base address register address space capacity adjustment function, and a second switch for selecting the capacity configuration mode. The configuration mode includes an automatic mode and a manual mode. In the automatic mode, the capacity of the base address register corresponding to the hardware device can be automatically configured according to preset parameters. In the manual mode, at least one third switch can be displayed on the interface to adjust the capacity of the base address register corresponding to each hardware device in response to user operation, and the address space can be flexibly allocated according to different devices and different states. Therefore, it solves the problems of wasting resources and addressing limits when enabling the base address register with a single switch in the related technology, and achieves the effect of flexibly adjusting the base address register and detecting alarms for anomalies.
[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0101] Embodiments of this application also provide an electronic device, such as... Figure 8 As shown, the electronic device includes a memory 801 and a processor 802. The memory 801 stores a computer program, and the processor 802 is configured to run the computer program to perform the steps in any of the above-described base address register configuration method embodiments.
[0102] This application also provides a non-volatile computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described firmware code coverage statistics method.
[0103] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described firmware code coverage statistics method.
[0104] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can 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.
[0105] The above provides a detailed description of a base address register configuration method provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A base address register configuration method, characterized in that, include: During the server startup process, a configuration interface for the base address register is displayed. The configuration interface displays a first switch and a second switch. The first switch is used to control the opening and closing of the capacity adjustment function of the base address register address space, and the second switch is used to control the capacity configuration mode of the base address register address space, which includes automatic mode and manual mode. The capacity adjustment range of the base address register corresponding to the hardware device is read, and the base address register corresponding to the hardware device is configured according to the first switch and the second switch. When the capacity configuration mode is the automatic mode, the capacity of the address space of the base address register is automatically configured, and a first alarm message is generated when the current value of the address space capacity exceeds the capacity adjustment range. When the capacity configuration mode is manual, in response to the user's first interactive action, the capacity of the address space of the base address register is manually configured within the capacity adjustment range.
2. The base address register configuration method according to claim 1, characterized in that, The step of configuring the base address register corresponding to the hardware device according to the first switch and the second switch includes: When the first switch controls the capacity adjustment function to be turned on, the current state of the second switch is identified. The current state of the second switch includes a first state and a second state. The capacity configuration mode corresponding to the first state is automatic mode, and the capacity configuration mode corresponding to the second state is manual mode. If the current state of the second switch is the first state, then the capacity configuration mode is determined to be the automatic mode. The automatic mode process includes: automatically configuring the capacity of the address space of the base address register corresponding to the hardware device according to the preset capacity configuration parameters. If the current state of the second switch is the second state, then the capacity configuration method is determined to be the manual mode. The process of the manual mode includes: displaying at least one third switch on the configuration interface, responding to the user's first interactive action, and manually configuring the capacity of the address space of the base address register based on the third switch within the capacity adjustment range.
3. The base address register configuration method according to claim 2, characterized in that, The response to the user's first interactive action, manually configuring the capacity of the base address register's address space based on the third switch within the capacity adjustment range, includes: In response to the user's first interactive action, the current option of the third switch is controlled, wherein the current option includes an automatic option and an adjustment option, the capacity configuration mode corresponding to the automatic option is automatic mode, and the capacity configuration mode corresponding to the adjustment option is manual mode; If the current option of the third switch is the automatic option, then the capacity configuration mode is determined to be the automatic mode. The process of the automatic mode includes: automatically configuring the capacity of the address space of the base address register corresponding to the hardware device according to the preset capacity configuration parameters. If the current option of the third switch is the adjustment option, the capacity adjustment range of the address space of the base address register is displayed on the configuration interface. In response to the user's second interactive action, the user can manually adjust the capacity of the address space of the corresponding base address register of the hardware device within the capacity adjustment range.
4. The base address register configuration method according to claim 2, characterized in that, Before enabling the capacity adjustment function of the base address register address space based on the first switch, the following is also included: In response to a third user interaction, the current state of the first switch is controlled, wherein the current state includes an on state and an off state, the capacity adjustment function is enabled in the on state, and the capacity adjustment function is disabled in the off state.
5. The base address register configuration method according to claim 3, characterized in that, Before the base address register configuration interface is displayed during server startup, the following is also included: During the hardware device enumeration process, the extended functions of the hardware device are identified; The extended functionality is used to identify whether the hardware device supports the base address register capacity adjustment function; If the hardware device supports the capacity adjustment function of the base address register, then obtain the device information of the hardware device and construct the structure information based on the device information; At least one of a first switch, a second switch, and a third switch is generated based on the structure information, wherein the second switch is generated when the first switch has already been generated, and the third switch is generated when both the first and second switches have already been generated.
6. The base address register configuration method according to claim 5, characterized in that, The step of identifying whether the hardware device supports the base address register capacity adjustment function based on the extended function includes: Read the list of function identifiers for the extended functionality; If the function identifier of the capacity adjustment function is read from the function identifier list, it is determined that the hardware device supports the capacity adjustment function of the base address register.
7. The base address register configuration method according to claim 5, characterized in that, The step of obtaining the device information of the hardware device includes: Read the first register and the second register of the device hardware, wherein the first register stores the capacity adjustment range of the base address register address space supported by the hardware device, and the second register stores the default capacity of the base address register address space supported by the hardware device, wherein the default capacity is a preset capacity; Record the function identifier, physical slot number, device path, manufacturer number, and device number of the hardware device. Generate device information of the hardware device based on at least one of the capacity adjustment range, the default capacity, the function identifier, the slot number, the device path, the manufacturer number, and the device number.
8. The base address register configuration method according to claim 7, characterized in that, The step of constructing the structure information based on the device information includes: Match the slot number with the pre-configured position correspondence in the machine; The device name of the hardware device is determined based on the manufacturer number and the device number; The structure information is constructed based on the location information of the hardware device in the machine, the device name, the manufacturer number, the device number, the function identifier, the device path, the capacity adjustment range, and the default capacity.
9. The base address register configuration method according to claim 1, characterized in that, After manually configuring the capacity of the base address register's address space within the capacity adjustment range, the method further includes: Obtain the current capacity and capacity threshold of the address space of the base address register corresponding to the hardware device; A second alarm message is generated when the current capacity value exceeds the capacity threshold.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the base address register configuration method as described in any one of claims 1 to 9 when executing the computer program.
Citation Information
Patent Citations
Bridging system and computing architecture
CN118885420A
Time delay optimization method and device of network interconnection system, electronic equipment and medium
CN120336226A