System starting initial stage operation method, electronic equipment and storage medium
By pre-establishing the memory management unit page table before the system starts, the central processing unit directly accesses it in the early stage of startup, solving the problem of slow system startup speed and achieving rapid startup.
Patent Information
- Application Number
- CN202510414409.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-08-15
AI Technical Summary
In the early stage of system startup, establishing a memory management unit page table requires a lot of read and write memory, resulting in slow system operation.
Before the system starts, the memory management unit page table is established in the storage space. The central processing unit directly accesses the page table at the beginning of the startup, omitting the process of establishing the page table, and directly enabling the memory management unit and high-speed data cache.
This avoids the large number of read and write operations required to establish a memory management unit page table, which significantly speeds up the running speed of the system initially.
Smart Images

Figure CN120492041A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of embedded technology, and in particular to a system initial startup operation method, electronic equipment and storage medium. Background Art
[0002] The way to increase the operating speed at the initial stage of system power-on is to enable high-speed data cache. The prerequisite for enabling high-speed data cache is to first enable MMU (memory management unit) and establish MMU page table.
[0003] The MMU is primarily responsible for processing memory access requests from the CPU (Central Processing Unit). Its primary functions include virtual-to-physical address translation, memory permission management, and cache control. Configuration information for these three MMU functions is stored in the MMU page table, which is located on the MMU itself. Therefore, the MMU page table must be present before the MMU can be enabled, and finally, the data cache can be enabled.
[0004] However, establishing the MMU page table requires a large amount of memory reading and writing, which also takes a lot of time, seriously affecting the initial operating speed of the system. Summary of the Invention
[0005] The embodiments of the present invention provide a method for initial operation of a system startup, an electronic device, and a storage medium, which are used to improve the speed of initial operation of the system startup.
[0006] In one aspect of the present invention, a method for operating a system during the initial startup phase is provided. The method includes: a central processing unit (CPU) accessing a memory management unit (MMU) page table pre-established in a storage space during the initial startup phase, the storage space being directly accessible by the CPU during the initial startup phase; enabling the MMU by the CPU based on the MMU page table within the storage space; and enabling a high-speed data cache via the MMU, so that the CPU operates based on the high-speed data cache.
[0007] In another aspect of the present invention, an electronic device is provided, comprising: a memory configured to store an executable program; and a processor configured to execute the program to perform the above-mentioned system startup initial operation method.
[0008] In another aspect of the present invention, a storage medium is provided, wherein a computer program is stored on the medium, and the computer program is executed by a processor to implement the above-mentioned system startup initial operation method.
[0009] According to the technical solution of the present invention, before the system is started, a memory management unit page table is established in the storage space that can be directly accessed by the central processing unit of the system at the initial startup. Since the direction of the memory management unit page table is known at the initial system startup, there is no need to establish the memory management unit page table at the initial system startup. Instead, the memory management unit page table is directly called by the central processing unit, and then the central processing unit enables the memory management unit according to the memory management unit page table in the storage space, and enables the high-speed data cache through the memory management unit, so that the central processing unit runs based on the high-speed data cache, avoiding the need for a large amount of memory reading and writing and a lot of time due to establishing the memory management unit page table, thereby improving the speed of operation in the initial startup. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 Flowchart of a method for starting an initial operation of a system according to an embodiment of the present invention; Figure 2 This is a flow chart of a method for initial system startup in a system wake-up startup scenario according to an embodiment of the present invention; Figure 3 is a flow chart illustrating a method for initial system startup in a system cold start scenario according to an embodiment of the present invention; Figure 4 This is a flow chart of a method for initial system startup in a system hot startup scenario according to an embodiment of the present invention; Figure 5 is a flowchart illustrating a method for initial system startup in a scenario where the system runs new firmware according to an embodiment of the present invention; Figure 6 is a schematic diagram illustrating an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0011] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.
[0012] In existing technologies, during the initial system power-up, the DDR (Double Data Rate SDRAM) is not initialized, leaving the central processing unit (CPU) operating on slow, low-speed memory. An effective way to increase CPU speed is to enable high-speed data cache (e.g., Dcache). However, enabling high-speed data cache requires enabling the memory management unit (MMU) and establishing the MMU page table. Establishing the MMU page table requires extensive memory read and write operations, which is also time-consuming and significantly impacts the initial system speed.
[0013] To address at least the aforementioned technical issues, the present disclosure provides a method for operating during the initial phase of system startup. According to the present disclosure, a memory management unit (MMU) page table is established in memory before the system's central processing unit (CPU) is started. After the CPU is started, the MMU page table can be directly accessed. In this way, embodiments of the present disclosure can avoid the extensive memory read and write operations and the time required to establish the MMU page table during the initial phase of system startup, thereby improving the speed of initial startup operations.
[0014] Since the address space accessed by the CPU during initial startup is relatively fixed, the contents of the Memory Management Unit page table remain largely unchanged. If this Memory Management Unit page table is pre-built in memory before the CPU boots up, the MMU and high-speed data cache can be immediately enabled by simply pointing the page table pointer to it, thereby speeding up the CPU's operation.
[0015] Hereinafter, the technical solutions according to the present disclosure will be described with reference to specific embodiments and in conjunction with the accompanying drawings.
[0016] Figure 1 FIG. 1 is a flow chart showing a method 100 for initial system startup according to an embodiment of the present disclosure. Figure 1 , the method 100 includes the following steps 102 to 106.
[0017] In step 102, the central processing unit (CPU) accesses the memory management unit (MMU) page table pre-established in the memory space during initial boot-up. The memory space can be directly accessed by the CPU during initial boot-up. This allows the system to have the MMU page table pre-established in the memory space before boot-up, eliminating the need to establish the MMU page table after boot-up. The CPU directly accesses the MMU page table during initial boot-up, thereby accelerating CPU operation.
[0018] In some embodiments, before the CPU is booted, a memory management unit page table is pre-established in a memory space that is directly accessible to the CPU during the initial boot-up phase. This ensures that the CPU can obtain the memory management unit page table through direct access during the initial boot-up phase. Furthermore, the pre-establishment of the memory management unit page table corresponds to the CPU boot-up phase, facilitating the modification of the address space range accessible by the CPU during the initial boot-up phase based on actual needs.
[0019] In some embodiments, the storage space includes at least one of a normally powered static random access memory (SRAM), a boot read-only memory (BOOTROM), and a memory space for new firmware. This provides multiple storage spaces that can be directly accessed by the central processing unit during initial boot, facilitating flexible pre-establishment of memory management unit page tables to meet actual device requirements.
[0020] In some embodiments, the contents of the memory management unit page table are obtained based on a preset address space range accessed by the central processing unit during initial startup. In this way, by leveraging the fact that the address space range accessed by the central processing unit during initial startup is relatively fixed, and therefore the contents of the memory management unit page table are essentially unchanged, the contents of the memory management unit page table are pre-determined, ensuring that the pre-built memory management unit page table guarantees relatively basic access permissions for the central processing unit when it is subsequently called upon at system startup.
[0021] In step 104, the CPU activates the MMU based on the MMU page table in the memory space. This eliminates the need to create a MMU page table and directly uses the pre-created MMU page table to start the MMU, avoiding numerous memory read and write operations and saving runtime.
[0022] In some embodiments, the CPU points the page table pointer to the memory management unit page table in the memory space to enable the memory management unit. In this way, the system does not need to spend a lot of time to establish the memory management unit page table at the beginning of startup, significantly speeding up the system startup speed.
[0023] In some embodiments, when the memory management unit page table is solidified on the system's read-only memory and the central processing unit is set to start from the boot read-only memory, the central processing unit is set to control the page table pointer to point to the page table of the boot read-only memory. In this way, the page table mechanism can isolate the boot read-only memory area from other memory areas of the system. This means that during the startup process, the central processing unit will not accidentally interfere with the data in other memory areas when accessing the boot read-only memory, and vice versa. In addition, by controlling the page table pointer to point to the page table of the boot read-only memory, the boot read-only memory can be flexibly memory mapped according to the needs of the system.
[0024] In step 106, the memory management unit enables the high-speed data cache so that the central processing unit can run based on the high-speed data cache. In this way, the central processing unit is prevented from running only on the low-speed memory, thereby improving the running speed.
[0025] In some embodiments of the present invention, in response to waking up from a system hibernation state, the central processing unit boots from the always-powered static random access memory and accesses a memory management unit page table pre-established in the always-powered static random access memory. In this way, when the system wakes up from a hibernation state, the central processing unit can boot from the always-powered static random access memory and, relying on the fact that the contents of the always-powered static random access memory are not lost when the system is restarted, directly access the memory management unit page table, thereby speeding up the operation of the central processing unit.
[0026] In some embodiments of the present invention, in response to a system cold boot, the central processing unit boots from a boot ROM and accesses a memory management unit page table stored in the boot ROM. The boot ROM stores the stored code for boot initialization. In this way, the central processing unit can directly enable the memory management unit page table and cache control after booting from the boot ROM, thereby accelerating the boot ROM boot process.
[0027] In some embodiments according to the present invention, in response to a system hot boot, the central processing unit boots from the always-powered static random access memory and accesses a memory management unit page table pre-established in the always-powered static random access memory. In this way, when the system is hot booted, the central processing unit can boot from the always-powered static random access memory and, relying on the fact that the contents of the always-powered static random access memory are not lost when the system is restarted, directly access the memory management unit page table, thereby speeding up the operation of the central processing unit.
[0028] In some embodiments according to the present invention, in response to running new firmware, the central processing unit loads the firmware, which incorporates the memory management unit page table, into the memory and accesses the memory management unit page table in the corresponding space of the memory. In this way, the central processing unit directly uses the memory management unit page table after loading the firmware, thereby speeding up the execution of the new firmware.
[0029] In some embodiments, when integrating the Memory Management Unit page table into the system's firmware, the Memory Management Unit page table is compressed and then integrated into the system's firmware. This minimizes the storage space occupied by the Memory Management Unit page table in the firmware. Furthermore, during firmware updates or data exchange between devices, the smaller compressed file can be transferred more quickly, saving time and bandwidth resources.
[0030] Hereinafter, application scenarios of the system startup initial operation method, electronic device, and computer medium according to the embodiments of the present invention will be described by way of examples.
[0031] The Memory Management Unit (MMU) is a computer hardware device that primarily manages memory access requests from the Central Processing Unit (CPU). Configuration information for the MMU's functions is stored in the MMU page table, which is located on the MMU itself.
[0032] When the system is initially powered on, the DDR is not initialized. The CPU can only operate on low-speed memory, resulting in a relatively slow performance. An effective way to increase performance is to enable the high-speed data cache, but this requires the memory management unit (MMU). However, the MMU page table must be established before the MMU can be enabled, and finally the high-speed data cache. Establishing the MMU page table requires extensive memory read and write operations, which is also time-consuming and significantly impacts the initial system speed.
[0033] Figure 2 FIG. 3 is a flow chart showing a method 300 for initial system startup in a system wake-up startup scenario according to an embodiment of the present invention. Figure 2 The method includes the following steps 302 to 306.
[0034] In step 302 , in response to waking up from a system sleep state, the central processing unit boots from the normally powered static random access memory (SRAM) and accesses a memory management unit page table pre-established in the normally powered static random access memory (SRAM).
[0035] Since the address space range accessed by the central processing unit at the initial startup is relatively fixed, the content of the memory management unit page table remains substantially unchanged. Therefore, the content of the memory management unit page table is obtained based on the preset address space range accessed by the central processing unit at the initial startup.
[0036] Since the contents of the normally powered static random access memory are not lost, the central processing unit can directly use this memory management unit page table at the initial startup. The page table pointer points to the page table of the normally powered static random access memory, which can also speed up the restart speed.
[0037] In step 304 , the CPU enables the MMU according to the MMU page table in the normally powered SRAM.
[0038] In step 306 , the high-speed data cache is enabled through the memory management unit, so that the central processing unit operates based on the high-speed data cache.
[0039] In other words, if the memory management unit page table has been pre-built in the memory before the central processing unit is started, after the central processing unit is started, it only needs to point the page table pointer to the memory management unit page table to immediately start the memory management unit and the high-speed data cache, thereby speeding up the operation of the central processing unit.
[0040] Figure 3 FIG. 5 is a flow chart showing a method 500 for initial system startup in a system cold startup scenario according to an embodiment of the present invention. Figure 3 The method includes the following steps 502 to 506.
[0041] In step 502, in response to a system cold start, the central processing unit boots from the boot ROM and accesses a memory management unit page table fixed in the boot ROM, where the boot ROM stores fixed code for boot initialization.
[0042] A system cold boot occurs when the chip's power supply is completely shut down and then powered on again. Information stored in the boot ROM remains intact even after a power outage. Therefore, the memory management unit page table is stored in the system's boot ROM.
[0043] In step 504, the CPU enables the memory management unit according to the memory management unit page table in the startup read-only memory.
[0044] In step 506 , the high-speed data cache is enabled through the memory management unit, so that the central processing unit operates based on the high-speed data cache.
[0045] Figure 4 FIG. 7 is a flow chart showing a method 700 for operating a system in the initial stage of system startup in a system hot startup scenario according to an embodiment of the present invention. Figure 4 The method includes the following steps 702 to 706.
[0046] In step 702 , in response to a system hot boot, the central processing unit boots from the normally powered static random access memory and accesses a memory management unit page table pre-established in the normally powered static random access memory.
[0047] Since the address space range accessed by the central processing unit at the initial startup is relatively fixed, the content of the memory management unit page table remains substantially unchanged. Therefore, the content of the memory management unit page table is obtained based on the preset address space range accessed by the central processing unit at the initial startup.
[0048] In step 704 , the CPU enables the MMU according to the MMU page table in the normally powered SRAM.
[0049] In step 706 , the high-speed data cache is enabled through the memory management unit, so that the central processing unit operates based on the high-speed data cache.
[0050] Figure 5FIG. 9 is a flow chart showing a method 900 for initial system startup in a scenario where the system runs new firmware according to an embodiment of the present invention. Figure 5 The method includes the following steps 902 to 906.
[0051] In step 902 , in response to running the new firmware, the central processing unit loads the firmware integrated with the memory management unit page table into the memory, and accesses the memory management unit page table in the corresponding space of the memory.
[0052] In order to reduce the storage space occupied, the memory management unit page table can be compressed first, and then the compressed memory management unit page table can be integrated into the firmware.
[0053] In step 904 , the central processing unit enables the memory management unit according to the memory management unit page table in the corresponding space of the memory.
[0054] In step 906 , the high-speed data cache is enabled through the memory management unit, so that the central processing unit operates based on the high-speed data cache.
[0055] In summary, the core idea of the present invention is that if a memory management unit page table has been pre-built on the memory before the central processing unit is started, the memory management unit and cache control can be immediately turned on by pointing the page table pointer to the memory management unit page table after the central processing unit is started, thereby speeding up the operation of the central processing unit. Based on this idea, the above embodiments provide specific practices in different scenarios, namely, establishing a memory management unit page table on the system's normally powered static random access memory, setting the central processing unit to start from the normally powered static random access memory, or solidifying the memory management unit page table on the system's boot read-only memory, setting the central processing unit to start from the boot read-only memory, or integrating the memory management unit page table into the system's preset firmware, and saving the preset firmware on the system's memory.
[0056] According to yet another aspect of the present invention, Figure 6 1 is a schematic diagram showing an electronic device 1100 according to an embodiment of the present invention. Figure 6 The electronic device 1100 includes a memory 1102, a processor 1104, and a program stored in the memory and executable on the processor. When the processor 1104 executes the program, the steps or actions of the system startup initial operation method described above are implemented.
[0057] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored on the storage medium, and the computer program is executed by a processor to implement the system startup initial operation method described above.
[0058] In summary, the system startup initial operation method, electronic device and computer medium provided by the present invention establish a memory management unit page table in the storage space of the system that can be directly accessed by the central processing unit before the system starts. Specifically, the memory management unit page table can be established on the system's normally powered static random access memory, and the central processing unit is set to start from the normally powered static random access memory, or the memory management unit page table is fixed on the system's startup read-only memory, and the central processing unit is set to start from the startup read-only memory, or the memory management unit page table is integrated into the system's preset firmware, and the preset firmware is stored in the system's memory. In this way, the memory management unit page table is pre-built on the memory before the central processing unit is started; when the system is initially started, there is no need to establish the memory management unit page table, but it is started from the normally powered static random access memory, and the page table pointer points to the page table of the normally powered static random access memory, or it is started from the boot read-only memory, and the page table pointer points to the page table of the boot read-only memory, or the preset firmware is loaded into the memory, and the page table pointer points to the page table on the memory, to complete the call of the memory management unit page table; avoiding the need for a large amount of memory reading and writing and a lot of time due to establishing the memory management unit page table, thereby improving the speed of operation in the initial startup.
[0059] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for initial system startup, characterized in that: include: The central processing unit accesses a memory management unit page table pre-established in a storage space at an early stage of startup, wherein the storage space can be directly accessed by the central processing unit at the early stage of startup; activating a memory management unit by the central processing unit according to the memory management unit page table in the storage space; as well as The high-speed data cache is enabled by the memory management unit, so that the central processing unit operates based on the high-speed data cache.
2. The method according to claim 1, characterized in that Also includes: Before the central processing unit is started, the memory management unit page table is pre-established in the storage space that can be directly accessed by the central processing unit at the initial start-up stage.
3. The method according to claim 1, characterized in that The storage space includes at least one of a normally powered static random access memory, a boot read-only memory, and a memory space for new firmware.
4. The method according to claim 1, wherein The CPU accesses the memory management unit page table pre-established in the storage space at the initial startup, including: In response to waking up from a system hibernation state, the central processing unit starts up from the normally powered static random access memory and accesses the memory management unit page table pre-established in the normally powered static random access memory.
5. The method according to claim 1, wherein The CPU accesses the memory management unit page table pre-established in the storage space at the initial startup, including: In response to a system cold start, the central processing unit starts from the boot ROM and accesses the memory management unit page table fixed in the boot ROM, where the boot ROM stores fixed code for power-on initialization.
6. The method according to claim 1, characterized in that The CPU accesses the memory management unit page table pre-established in the storage space at the initial startup, including: In response to a system hot start, the central processing unit starts from the normally powered static random access memory and accesses the memory management unit page table pre-established in the normally powered static random access memory.
7. The method according to claim 1, characterized in that The CPU accesses the memory management unit page table pre-established in the storage space at the initial startup, including: In response to running the new firmware, the central processing unit loads the firmware integrated with the memory management unit page table into a memory, and accesses the memory management unit page table in a corresponding space of the memory.
8. The method according to claim 1, characterized in that Enabling, by the central processing unit, a memory management unit according to the memory management unit page table in the storage space includes: The central processing unit points a page table pointer to the memory management unit page table in the storage space to enable the memory management unit.
9. The method according to claim 1, characterized in that Enabling the central processing unit to operate based on the high-speed data cache includes: The central processing unit is enabled to operate by utilizing the enabled high-speed data cache after being started from the storage space at the initial start-up stage.
10. The method according to claim 1, characterized in that The CPU accesses the memory management unit page table pre-established in the storage space at the initial startup, including: The content of the memory management unit page table is accessed according to the preset address space range accessed at the initial startup of the central processing unit.
11. An electronic device comprising: a memory configured to store an executable program; as well as The processor is configured to execute the executable program to perform the system startup initial operation method according to any one of claims 1 to 10.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed to implement the system startup initial operation method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Preboot memory of a computer system
CN101258467A
Storage device, access method for mobile terminal and data, and frequency modulation method
CN101739359A
Program, control method, and control device
CN102460384A
Method for implementing hardware image starting optimizing of embedded operating system
CN1825283A