Method for increasing BMC (baseboard management controller) storage space by reserving memory for DRAM (dynamic random access memory)
By reserving DRAM memory and converting it into a block device within the BMC system, the method addresses the limitations of traditional storage solutions, providing flexible and cost-effective storage expansion suitable for temporary data retention.
Patent Information
- Application Number
- CN202411278399.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing BMC storage solutions face challenges in flexibly and cost-effectively increasing storage capacity due to limited SPI NorFlash capacity and hardware complexity, with external storage devices being uneconomical for scenarios requiring only temporary storage expansion.
Reserve a section of DRAM memory by modifying the Linux device tree configuration, convert it into a block device using a custom device driver, and mount it as a file system for data storage, avoiding additional hardware costs and ensuring data retention after BMC restarts.
This method efficiently expands BMC storage capacity by utilizing existing DRAM resources, reducing hardware costs and complexity, while ensuring data retention for temporary data like firmware updates and system logs without relying on external storage.
Smart Images

Figure CN119248668A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for increasing BMC storage space by reserving memory for DRAM. Background Art
[0002] In the BMC (Baseboard Management Controller) system, storage space is usually provided by persistent storage devices such as SPI NorFlash, but its capacity is relatively limited and it is difficult to cope with the growing data storage needs of complex systems. In order to increase the storage space, the existing technology usually achieves it by adding devices such as SPI NorFlash or external SD cards with larger capacity. However, these solutions face problems such as increased costs, increased hardware complexity, and limited motherboard layout space. In addition, although external storage devices can provide larger capacity, they are uneconomical and waste hardware resources in some application scenarios where only a small amount of storage needs to be temporarily increased. Therefore, the existing technology has obvious deficiencies in increasing BMC storage space flexibly and at low cost. Summary of the invention
[0003] In view of the many problems existing in the above-mentioned prior art, the present invention provides a method for increasing the BMC storage space by reserving memory for DRAM. The present invention reserves a section of memory space in the DRAM used by the BMC by modifying the Linux device tree configuration file, and converts the memory space into a block device through a custom device driver; then the block device is mounted as a file system, so that the BMC can perform data read and write operations on the reserved memory space; the present invention does not require additional hardware costs, while improving the data access speed and meeting the storage requirements of temporary data, especially in the scenario where the data can still be retained after the BMC is restarted.
[0004] A method for increasing BMC storage space by reserving memory for DRAM includes the following steps:
[0005] Reserve a memory space in the DRAM used by the BMC;
[0006] By modifying the Linux device tree configuration file, the reserved memory space is set as a reserved memory area, so that the memory space is available for use after the BMC is started;
[0007] Writing a device driver to convert the reserved memory space into a block device;
[0008] The block device is mounted as a file system so that the BMC can perform read and write operations on the reserved memory space.
[0009] Preferably, the size of the reserved memory space is determined according to the memory requirement of the BMC, and the size of the reserved memory space is not less than 100 MB.
[0010] Preferably, the size of the reserved memory space is calculated by the following formula:
[0011] S=TR
[0012] Among them, S is the size of the reserved memory space; T is the total DRAM capacity used by the BMC; R is the memory capacity required for the normal operation of the BMC.
[0013] Preferably, the address range of the reserved memory area is determined by dividing the unoccupied memory address range of the DRAM used by the BMC, and ensuring that the reserved memory area does not overlap with the memory area occupied by other programs or functions.
[0014] Preferably, the device driver is loaded by the Linux kernel during the BMC startup process, and converts the reserved memory space into a block device.
[0015] Preferably, the block device is mounted to a designated directory of the BMC through a file system of the BMC, so that the BMC can perform file system-level read and write operations on the reserved memory space through the directory.
[0016] Preferably, the reserved memory space is used to store data that needs to be retained but does not need to be persistently saved after the BMC is restarted, and the data includes firmware update files, system configuration files, and other temporary data.
[0017] Compared with the prior art, the advantages and beneficial effects of the present invention are:
[0018] The present invention achieves the effect of expanding the BMC storage space flexibly and at low cost by reserving DRAM memory space and virtualizing it into a block device.
[0019] Compared with the prior art, the present invention does not need to add external hardware storage devices, thus avoiding the problems of increased hardware costs and complicated mainboard layout.
[0020] By maintaining the reserved memory data after the BMC is restarted, the present invention also realizes the safe retention of data in a non-persistent environment, meets the storage requirements of temporary data such as firmware updates and system logs, and ensures the efficiency of system operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the process of the present invention;
[0022] Figure 2 It is a schematic diagram of the structure of the BMC and DRAM memory division in the present invention;
[0023] Figure 3 This is a flowchart of mounting a block device and a file system in the present invention;
[0024] Figure 4 Schematic diagram of the data retention mechanism after BMC restart in the present invention. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is obvious that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0028] like Figure 1 As shown, a method for increasing BMC storage space by reserving memory for DRAM includes the following steps:
[0029] Reserve a memory space in the DRAM used by the BMC;
[0030] Preferably, the size of the reserved memory space is determined according to the memory requirement of the BMC, and the size of the reserved memory space is not less than 100 MB.
[0031] In the present invention, by reserving a section of memory space for DRAM (dynamic random access memory), the storage space of BMC (Baseboard Management Controller) is increased to solve the problem of insufficient BMC storage space, especially in the storage-limited situation commonly seen in embedded systems.
[0032] In embedded systems, BMC usually relies on SPI NOR Flash as its main storage medium, and the common storage capacity ranges from 64MB to 128MB. BMC uses this storage space to store firmware, logs, system configuration files, etc. As the system becomes more complex, BMC needs more storage space. However, increasing the capacity of SPI NOR Flash will significantly increase the cost, and there are also certain hardware limitations. In addition, although external SD cards or other storage devices can provide larger storage capacity, in certain specific scenarios, when only limited storage space (such as 100MB) needs to be increased, the use of external storage devices is too wasteful, and it also increases the complexity of the system and the space occupied by the motherboard.
[0033] In response to this problem, the core principle of the present invention is to utilize part of the memory in the DRAM used by the BMC, and convert it into additional storage space through the kernel configuration and device driver in the operating system. Since the DRAM has a large remaining capacity (usually 1GB or larger) when the BMC is operating normally, a part (at least 100MB) can be divided out from it to store data that does not need to be persisted. This solution does not require additional hardware costs and makes full use of existing memory resources. Although DRAM will lose data after power failure, the present invention mainly deals with data that the BMC still needs to retain after restart but does not need to be persisted, and is suitable for storing temporary data, such as BIOS firmware update files, system configuration files, or other temporary data that does not need to be stored for a long time.
[0034] In terms of implementation, the reserved memory space is marked as a "reserved-memory" node by modifying the Linux device tree configuration file to ensure that the operating system can recognize and reserve this memory space when the BMC starts. Next, write a device driver to map this memory space as a block device and mount it to the BMC's file directory through the file system. After mounting, the BMC can read and write this memory space like a regular file system.
[0035] In a specific application, assuming that the total DRAM capacity used by the BMC is 1GB and the memory occupied by the normal operation of the system is 500MB, at least 100MB can be reserved from the remaining 500MB as additional storage space. Through the device tree configuration file, the memory will be automatically reserved when the BMC starts, and it will be ensured that the memory address will not be occupied by other applications or functions. After the device driver is loaded, the memory area is converted to a block device and mounted as a file system. This design allows the BMC to easily read and write to the memory area like operating a normal folder.
[0036] This approach has significant effects. First, it avoids the cost increase caused by the use of additional hardware devices and simplifies the system design. Second, it makes full use of the system's existing memory resources to meet the storage needs of the BMC in specific scenarios, especially when firmware updates, logs, or temporary files need to be retained. Since data can be retained after the BMC is restarted, this makes the system more flexible in operations such as firmware updates and reduces the risk of storage data loss due to unexpected restarts.
[0037] The present invention enables BMC to obtain additional storage space without increasing hardware costs through reasonable division and configuration of DRAM, and ensures that data can be retained when the system is restarted. The entire solution has strong application value, especially in embedded systems with rapidly growing storage requirements, providing an efficient storage expansion solution.
[0038] Preferably, the size of the reserved memory space is calculated by the following formula:
[0039] S=TR
[0040] Among them, S is the size of the reserved memory space; T is the total DRAM capacity used by the BMC; R is the memory capacity required for the normal operation of the BMC.
[0041] In the present invention, the core principle of increasing the BMC (Baseboard Management Controller) storage space by reserving DRAM memory is to reasonably divide the DRAM memory used by the BMC. In order to ensure the normal operation of the system and the effectiveness of the expanded storage, it is necessary to scientifically calculate the size of the reserved memory space so as to maximize the use of the remaining memory space to provide additional storage capacity while meeting the normal operation memory requirements of the BMC. The size of the reserved memory space can be calculated by the above formula.
[0042] When the BMC system is running, DRAM is used to store the current operating system, firmware, applications, and their runtime data. Generally, the memory capacity required for BMC operation is a dynamic range, such as 200MB to 500MB, depending on the complexity of the system and the tasks being run. Assuming that the total DRAM capacity used by the BMC is 1GB, the system may occupy a portion of it (such as 500MB) during normal operation. At this time, the remaining memory is the space available for reservation. In order to ensure the stability and efficiency of the system, the memory requirement of the BMC must be calculated, that is, the value of R, which can be determined by observing the maximum memory usage of the BMC under normal load. T is a fixed hardware attribute that represents the total DRAM capacity of the BMC.
[0043] In this case, the size of the reserved memory space S is determined by the difference between T and R. By calculating the formula S = TR, the memory space that can be used for extended storage when the BMC is operating normally can be scientifically determined. For example, assuming that the total DRAM capacity T of the BMC is 1GB, and the maximum memory requirement R required for the normal operation of the BMC is 500MB, then according to the formula, S is 500MB. The remaining 500MB of space can be divided out for system use to provide additional storage support for temporary or specific tasks.
[0044] In order to achieve the above memory partitioning, the present invention sets the calculated reserved memory space S as a reserved memory area by modifying the Linux device tree configuration file. This ensures that when the BMC is started, the operating system can recognize and reserve this memory space and will not allocate it to other programs or tasks. The writing of the device driver also ensures that this memory space is correctly converted into a block device, and then mounted through the file system so that it can be operated like a normal storage device.
[0045] In this way, BMC can effectively use the remaining unused space of DRAM to expand storage capacity, especially in scenarios where data does not need to be persisted. In specific applications, this reserved memory can be used to store data such as firmware update files, system logs, and temporary configuration files. When the BMC is operating normally, this data can be saved in the DRAM reserved space. Even if the BMC is restarted, the data can still be retained until the system completes the update or needs to be reloaded.
[0046] This method of reserving memory and expanding storage not only makes full use of existing hardware resources, but also avoids increasing costs. Compared with using external storage devices or larger-capacity flash storage, this DRAM-based solution is more cost-effective. In addition, by scientifically calculating the memory requirements to determine the size of the reserved space, it can ensure that the memory required for the normal operation of the BMC is not affected, while maximizing the use of remaining memory resources to improve the system's storage capacity.
[0047] In a specific embodiment, assuming that the total DRAM capacity of the BMC is 2GB, and the maximum memory R required for normal system operation is 1GB, the reserved memory space S can be calculated as 1GB by the formula. This 1GB of reserved space can be mapped as a block device through the device driver and mounted to the file system to store data that needs to be retained after the BMC restarts, such as firmware updates or log files. In scenarios that do not involve persistent storage, this extended storage solution can significantly improve the storage efficiency of the BMC.
[0048] In summary, the present invention reasonably determines the size of the reserved memory space in DRAM through the calculation method of the formula S=TR, and realizes the effective utilization of the memory space through system configuration and driver program, thereby increasing the storage capacity of BMC, and providing a more flexible storage solution without increasing hardware costs. It is particularly suitable for scenarios with low requirements for data persistence but large storage space requirements.
[0049] By modifying the Linux device tree configuration file, the reserved memory space is set as a reserved memory area, so that the memory space is available for use after the BMC is started;
[0050] Preferably, Figure 2 As shown, the address range of the reserved memory area is determined by dividing the unoccupied memory address range of the DRAM used by the BMC, and ensuring that the reserved memory area does not overlap with the memory area occupied by other programs or functions.
[0051] In the present invention, by modifying the Linux device tree configuration file, the reserved DRAM memory space is set as a reserved memory area, so that after the BMC (Baseboard Management Controller) is started, this memory space can be identified and used to expand the storage capacity of the BMC. This process is implemented based on the management mechanism of the operating system for hardware resources, especially the device tree configuration for memory management, by accurately dividing the unoccupied memory address range in the DRAM used by the BMC, ensuring the safe and effective use of the reserved memory space, and avoiding conflicts with other programs or functions.
[0052] Device Tree is a file used to describe hardware configuration in embedded Linux systems. Through the device tree, the operating system can correctly identify and manage the hardware resources of the system at startup. In the technical implementation of the present invention, it is first necessary to modify the configuration file of the device tree and declare the reserved DRAM memory space as a "reserved memory area". This means that when the system starts, the kernel will read the configuration and recognize that the memory area is for special use and will not be allocated to other programs or system tasks, thereby ensuring the independence of the memory area.
[0053] For the selection of the address range of the reserved memory area, the focus is on dividing the part of the DRAM used by the BMC that is not occupied by other programs or functions. DRAM is usually used to store the operating system, application programs and runtime data of the storage system, and the operating system dynamically allocates memory space according to demand. In order to achieve the expansion of the BMC storage space, the present invention accurately marks the unoccupied address range in the DRAM through the device tree configuration file. For example, if the total DRAM capacity of the BMC is 1GB, and 500MB is occupied during normal operation of the system, the remaining 500MB can be divided into part of the space as a reserved memory area. The address space of the divided area needs to ensure that it does not conflict with other memory requirements of the system, that is, to ensure that the memory address is not occupied by other programs or functions.
[0054] In the device tree file, the reserved memory area is usually configured under the "reserved-memory" node, specifying the memory start address and size. With this configuration, the kernel will automatically identify and reserve this memory space according to the configuration in the device tree when it starts, so that it will not be used by other processes during the operation after the BMC starts. This mechanism effectively ensures the independence and controllability of memory resources.
[0055] To implement this solution, you first need to analyze the system memory usage to determine the memory size and the corresponding address range that can be reserved. Then, add a section of code to the device tree configuration file that describes the reserved memory, including the starting address and size of the memory. For example, assuming that the DRAM used during normal operation of the BMC is 500MB, the remaining 500MB can be used for reserved space. At this point, configure the device tree file as follows:
[0056] reserved-memory{
[0057] reg = <0x8000000000x20000000>; / / The starting address is 0x80000000, and the size is 512MB
[0058] };
[0059] In this configuration, the "reg" attribute defines the starting address and length of the memory, 0x80000000 indicates the starting position of the memory, and 0x20000000 (512MB) is the reserved memory size. In this way, when the system starts, the kernel will mark this memory space as reserved memory and no longer allocate it to the regular memory allocation system.
[0060] The advantage of this method in application is that it makes full use of existing memory resources without adding additional hardware devices to expand the storage space of BMC. After the BMC is started, this reserved memory can be mounted as a block device through the file system, allowing the BMC to perform data read and write operations like using ordinary storage devices.
[0061] This method of dividing and managing the reserved memory area through the device tree configuration file can effectively increase the storage space of the BMC without interfering with the memory allocation for normal system operation. Since the reserved memory area is fixed when the system starts, it will not be affected by other applications or system tasks, ensuring the stability and security of storage. This method is particularly suitable for scenarios where the BMC needs to expand temporary storage space, such as storing firmware update files, system configuration files and other data.
[0062] By dividing the unoccupied memory address range and configuring it as a reserved memory area, the system can significantly improve the storage capacity based on the existing hardware without affecting the normal memory allocation mechanism of the system. For example, in an actual application scenario, the total DRAM capacity of a BMC system is 2GB, the memory occupied by normal operation is 1GB, and the remaining 1GB can be configured as a reserved memory area through the device tree to store temporary files or logs. This method avoids the normal operation of the BMC being affected by insufficient storage space, and also provides the system with more flexible storage expansion options.
[0063] In summary, by modifying the device tree configuration file, reasonably dividing the unoccupied memory address range in DRAM, and ensuring that the memory area does not overlap with the memory of other programs or functions, the BMC storage space is efficiently expanded. This solution has significant application value, especially in the environment of tight storage resources in embedded systems, it provides a cost-effective storage expansion solution.
[0064] Writing a device driver to convert the reserved memory space into a block device;
[0065] Preferably, the device driver is loaded by the Linux kernel during the BMC startup process, and converts the reserved memory space into a block device.
[0066] In the present invention, by writing a device driver, the reserved DRAM memory space is converted into a block device to achieve the storage space expansion of the BMC (Baseboard Management Controller). The device driver is a bridge between the operating system and the hardware, and its core function is to convert the reserved memory space into a block device that can be read and written through the file system. The reserved memory space in the present invention needs to be loaded and initialized by this device driver before it can be truly recognized and used as a storage space by the BMC.
[0067] Block devices are an abstract form of storage device management in the operating system, allowing the operating system and applications to access the contents of the storage device in blocks (usually fixed-size bytes). Traditional block devices include physical storage devices such as hard disks and SSDs, while in the present invention, the reserved memory space is virtualized as a block device to provide similar functions.
[0068] By writing a custom Linux device driver, the present invention virtualizes the reserved DRAM memory space into a block device, so that the BMC can read and write the memory space through the file system. During the BMC system startup process, the Linux kernel will load the written device driver, which is responsible for initializing the reserved memory area and registering it as a block device. After registration, the operating system regards the memory space as a storage device equivalent to other physical storage devices, and users or applications can operate this memory by mounting the file system.
[0069] In terms of specific implementation, when writing a device driver, you first need to identify the reserved memory space through the device tree configuration in the Linux kernel when the kernel starts, and reserve the memory space. Then, the device driver maps the reserved memory as a block device, which usually requires the following key steps:
[0070] Device registration: The driver first registers a new block device and assigns it a device number so that it can be recognized by the operating system.
[0071] Memory mapping: Next, the device driver maps the physical address of the reserved memory space to the logical address of the block device, making it accessible through the standard block device interface.
[0072] Read and write interface: The driver needs to implement the read and write interface of the block device to allow the operating system and applications to perform data operations on the memory in a block manner.
[0073] Through this process, the reserved memory space is successfully virtualized as a block device and can be mounted to the BMC directory structure through the file system. For example, in a Linux system, you can use a standard mount command (such as mount) to mount the block device to a directory, so that the BMC system and applications can read and write to the memory space just like accessing a normal folder.
[0074] In the present invention, the reserved memory space is the unused DRAM space reserved by modifying the device tree configuration file. In order to convert this space into an available storage device, a custom device driver is required. When the BMC system starts, the Linux kernel automatically loads the device driver, which identifies and initializes the reserved memory space during the startup process through the module initialization function in the kernel. In the specific implementation process, the device driver registers the memory as a block device through the kernel interface call and makes it accessible to the system.
[0075] For example, suppose the BMC uses 1GB of DRAM, 500MB is used when the system is running normally, and the remaining 500MB is set as a reserved memory area. After the device driver is loaded, the kernel module maps this 500MB memory area to a block device named / dev / myblockdevice. Then, the BMC operating system can mount the block device to a specified directory (such as / mnt / myspace) through a file system command (such as mount / dev / myblockdevice / mnt / myspace). At this point, the BMC can read and write files in the mounted directory just like a hard disk or other storage device.
[0076] By virtualizing the reserved memory space into a block device through a device driver, the present invention can effectively expand the storage space of the BMC without adding physical storage hardware, making full use of the unused memory resources in the DRAM. Compared with the solution of external storage devices or increasing hardware costs, the present invention realizes storage virtualization and flexibility through device driver. In addition, the data in the reserved memory space is still retained after the BMC is restarted, which is particularly applicable to scenarios such as firmware updates, system logs, and temporary file storage.
[0077] This technology not only reduces the hardware cost of the BMC system, but also improves the storage flexibility of the system, especially for those application scenarios that do not require high data persistence but require large-capacity temporary storage. For example, during the BMC firmware update process, the update file can be temporarily stored in the virtual block device and then cleaned up after the update is completed, reducing the pressure on the main storage device.
[0078] In this way, the present invention solves the traditional physical storage expansion problem through software means, enhances the storage capacity of the BMC, and provides a more flexible storage management method for system developers.
[0079] The block device is mounted as a file system so that the BMC can perform read and write operations on the reserved memory space.
[0080] Preferably, Figure 3 As shown, the block device is mounted to a designated directory of the BMC through the file system of the BMC, so that the BMC can perform file system-level read and write operations on the reserved memory space through the directory.
[0081] In the present invention, after the reserved DRAM memory space is converted into a block device through a device driver, the block device needs to be mounted as a file system so that the BMC (Baseboard Management Controller) can perform standard file operations on the reserved memory space through the file system interface, including reading, writing, creating, and modifying files. In this way, the BMC can flexibly manage temporary data, log files, or firmware update files just like using conventional storage devices.
[0082] Block devices are the basic units used to represent storage devices in the Linux operating system, and are usually used for storage devices such as hard disks and flash memory. Through file system mounting, the operating system can access and manage storage data in the form of files. In the present invention, the reserved DRAM memory space is converted into a block device with the support of the device driver, and the block device is mounted as part of the file system through the standard Linux mounting mechanism. After the mounting is completed, the BMC system and its upper-layer applications can access this memory space through the file system interface to perform data read and write operations.
[0083] In actual applications, when the device driver registers the reserved memory space as a block device, the operating system maps it to a device node, such as / dev / myblockdevice. Next, the block device can be mounted to the specified directory of the BMC through the file system mount command (such as mount). For example, the system administrator can mount the block device to / mnt / myspace, so that the BMC and its applications can read and write data in the reserved memory through the / mnt / myspace directory just like accessing a normal file system.
[0084] The entire mounting process needs to follow the standard Linux file system mechanism. In the Linux operating system, block devices cannot perform file operations directly, and must be mounted as a specific type of file system before operations such as file creation, modification, and deletion can be performed. In the present invention, the BMC can manage the DRAM reserved memory by mounting the block device, thereby effectively utilizing this memory space.
[0085] In a specific implementation, the present invention needs to perform the following steps:
[0086] Block device conversion: The reserved DRAM memory space is converted to a block device through the device driver. The block device appears in the Linux system as a device file, such as / dev / myblockdevice.
[0087] File system mount: Use the Linux mount command to mount the block device to the BMC file system. For example, you can use the following command to mount the device to a specified directory:
[0088] mount / dev / myblockdevice / mnt / myspace
[0089] At this time, the / mnt / myspace directory in the BMC system represents the reserved memory space, and all file operations on the directory (such as reading and writing files) are actually operations on the block device.
[0090] Read and write operations: After the mount is completed, the BMC and its upper-layer applications can access the directory to perform file system-level operations. The system and users can create files, write data, read file contents, etc. in the directory. For example, firmware update files can be stored in this directory, and when the system needs to perform a firmware update, the update files can be read directly from this directory.
[0091] This solution not only ensures the efficient use of reserved memory space, but also allows BMC to easily manage storage data through a standard file system interface, reducing operational complexity. For example, in a firmware update scenario, the administrator can upload the update file to the / mnt / myspace directory through the network. When the BMC is ready to restart the update, the update file is directly loaded from the directory, and the space is cleaned up after the update is completed. This file system-based storage management method greatly simplifies the operation process and is suitable for scenarios such as firmware updates and system log storage.
[0092] By mounting the block device as a file system, the present invention significantly enhances the storage capacity of the BMC and enables the operating system and users to easily manage the reserved memory space. The introduction of the file system allows the BMC to manage data in the form of files, which is completely consistent with the traditional storage operation method and reduces the complexity of development and operation and maintenance. The BMC does not need to care about the differences in the underlying storage media, and all data operations can be completed through the familiar file system interface, thereby improving the ease of use and flexibility of the system.
[0093] In addition, this solution makes full use of the BMC's DRAM resources without relying on expensive external storage devices, greatly reducing the cost of storage expansion. This technology is particularly suitable for application scenarios that require temporary storage of large amounts of data, such as log files, system configuration files, or firmware update files. In these scenarios, the BMC can flexibly use the reserved memory space for data storage without occupying the capacity of persistent storage devices such as SPI nor flash.
[0094] For example, in a specific embodiment, assuming that the total DRAM capacity of the BMC is 2GB, 1GB is occupied during normal operation, and the remaining 1GB is divided into reserved memory space and converted into a block device. Through file system mounting, this memory space can be used to store temporary log files or firmware update files. When the system needs to perform log analysis or firmware update, it can directly access the mounted directory to read data without affecting the normal operation of the system.
[0095] In summary, by mounting the block device as a file system, the present invention realizes efficient management of the reserved memory space, enabling the BMC to perform file operations like using a conventional storage device. This solution not only reduces the hardware cost of storage expansion, but also provides the system with greater storage flexibility and is suitable for a variety of application scenarios.
[0096] Preferably, Figure 4 As shown, the reserved memory space is used to store data that needs to be retained but does not need to be persisted after the BMC is restarted, and the data includes firmware update files, system configuration files, and other temporary data.
[0097] In the present invention, the reserved DRAM memory space is used to store data that needs to be retained but does not need to be persisted after the BMC (Baseboard Management Controller) is restarted. Such data generally includes firmware update files, system configuration files, and other temporary data. By storing these data in the reserved memory space, the present invention effectively increases the storage capacity of the BMC, while ensuring efficient management of temporary data without occupying persistent storage resources.
[0098] BMC usually uses SPI nor flash or other similar persistent storage media to save key data, such as firmware, operating system, and important logs and configuration files. However, the capacity of such storage devices is relatively limited, and with the growth of system requirements, the problem of insufficient storage space has become increasingly prominent. Especially in scenarios where temporary data needs to be stored, if these data are stored in a persistent storage device, not only will valuable persistent storage resources be wasted, but the overall performance of the BMC may also be affected. Therefore, the present invention divides a portion of the memory into a reserved memory area by utilizing the remaining space in DRAM, which is used to store temporary data that still needs to be retained after the BMC is restarted but does not need to be stored for a long time.
[0099] As the main memory of the system, DRAM has the advantage of fast access speed. However, the characteristic of DRAM is that data will be lost after power failure, so it is not suitable as a persistent storage device. But in the scenario where the BMC restarts without power failure, the data in DRAM can still be retained. Using this feature, the present invention stores some temporary, non-critical data that needs to be retained after restart in the reserved DRAM memory space, for example:
[0100] Firmware update files: When the BMC performs a firmware update, it is usually necessary to upload the new firmware file to the system and wait for the right time to update. These update files need to be retained after the BMC restarts until the update is completed, but they do not need to be saved in the system for a long time.
[0101] System configuration files: Some configuration files need to be retained while the system is running, but may be modified or overwritten after long-term operation. By storing them in reserved memory space, the system can continue to read these configuration files after restart without occupying persistent storage devices.
[0102] Other temporary data: including runtime logs, cache data, or temporary files generated by system operations. These data usually only need to be retained for a short period of time and need to be accessed for a period of time after the BMC is restarted, but do not need to be stored for a long time.
[0103] In the specific implementation, the division and use process of the reserved memory space is as follows:
[0104] Memory space reservation: By modifying the Linux device tree configuration file, reserve a portion of DRAM memory space and set it as a reserved memory area. When the BMC starts, the Linux kernel will recognize and reserve this memory and will not allocate it to other system processes or applications.
[0105] Loading device drivers: The reserved memory space is converted into a block device through the device driver, and the BMC system can access the space through the file system. At this point, the BMC and its applications can store and manage files in the reserved memory space just like using regular storage devices.
[0106] Data storage and management: When the system needs to store temporary files (such as firmware update files, system configuration files), these files can be directly written to the reserved memory space. Since this data only needs to be retained for a short time after the BMC restarts and does not need to be stored for a long time, there is no need to use a persistent storage device.
[0107] For example, when the BMC is preparing to update the firmware, the administrator can upload the new firmware files to the BMC through the network, and these files can be temporarily stored in the reserved memory space. Even if the BMC restarts before the update, the system can continue to read and execute the update operation because the data in the memory space still exists after the restart. When the update is completed, these files can be cleared to free up memory for the next use.
[0108] By using reserved memory space to store data that needs to be retained but does not need to be persistent after the BMC restarts, the present invention achieves efficient management of temporary data. First, this storage method does not occupy the capacity of the persistent storage device, which solves the storage needs of the BMC when storage resources are limited. Secondly, using DRAM to store these temporary data can speed up the reading and writing speed of data and improve the response efficiency of the system, especially in scenarios such as firmware updates and system configuration management, effectively shortening the operation time.
[0109] In addition, this method makes full use of the existing resources of the system and avoids the cost increase caused by adding external storage devices. DRAM is a key resource of the BMC system. By reasonably dividing and utilizing the remaining unused memory, it can provide the system with additional temporary storage space without affecting the normal operation of the system.
[0110] In a specific embodiment, assuming that the DRAM capacity of the BMC is 1GB, 500MB is occupied when the system is running normally, and the remaining 500MB can be divided into reserved memory space. When a firmware update is required, the administrator can upload the new firmware file to this space. Even if the BMC restarts unexpectedly during the update process, the update file still exists, and the system can continue to update the next time it starts. This flexible storage management method can effectively reduce operational complexity and ensure data availability.
[0111] In summary, the present invention not only increases the storage capacity of the system, but also improves the flexibility and efficiency of data management by using the reserved memory space in the DRAM to store data that needs to be retained but does not need to be persistent after the BMC is restarted. It is particularly suitable for application scenarios that require short-term storage but not long-term retention.
[0112] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware.
[0113] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for increasing BMC storage space by reserving memory for DRAM, characterized in that: The following steps are involved: Reserve a memory space in the DRAM used by the BMC; By modifying the Linux device tree configuration file, the reserved memory space is set as a reserved memory area, so that the memory space is available for use after the BMC is started; Writing a device driver to convert the reserved memory space into a block device; The block device is mounted as a file system so that the BMC can perform read and write operations on the reserved memory space.
2. The method according to claim 1, characterized in that The size of the reserved memory space is determined according to the memory requirement of the BMC, and the size of the reserved memory space is not less than 100 MB.
3. The method according to claim 1, characterized in that The size of the reserved memory space is calculated by the following formula: S=TR Among them, S is the size of the reserved memory space; T is the total DRAM capacity used by the BMC; R is the memory capacity required for the normal operation of the BMC.
4. The method according to claim 1, characterized in that: The address range of the reserved memory area is determined by dividing the unoccupied memory address range of the DRAM used by the BMC, and ensuring that the reserved memory area does not overlap with the memory area occupied by other programs or functions.
5. The method according to claim 1, characterized in that The device driver is loaded by the Linux kernel during the BMC startup process and converts the reserved memory space into a block device.
6. The method according to claim 1, characterized in that The block device is mounted to a designated directory of the BMC through the file system of the BMC, so that the BMC can perform file system level read and write operations on the reserved memory space through the directory.
7. The method according to claim 1, characterized in that The reserved memory space is used to store data that needs to be retained but does not need to be persistently saved after the BMC is restarted, and the data includes firmware update files, system configuration files, and other temporary data.
Citation Information
Patent Citations
Operating system mirror image storage and recovery method and device
CN106294019A
System log storage method and device based on non-volatile memory
CN106649152A
Method and system for keeping data consistency before and after system reboot
CN107894932A
Method, device, equipment and medium for enabling SPI master control to be compatible with flash chip
CN111858406A
Temporary file system construction method, electronic equipment and computer readable medium
CN118519967A
