CN103246610B - Dynamic storage management method based on the embedded system of single type memory - Google Patents

Dynamic storage management method based on the embedded system of single type memory Download PDF

Info

Publication number
CN103246610B
CN103246610B CN201210032785.1A CN201210032785A CN103246610B CN 103246610 B CN103246610 B CN 103246610B CN 201210032785 A CN201210032785 A CN 201210032785A CN 103246610 B CN103246610 B CN 103246610B
Authority
CN
China
Prior art keywords
kernel
memory
file system
memory block
district
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210032785.1A
Other languages
Chinese (zh)
Other versions
CN103246610A (en
Inventor
李顺芬
陈小刚
陈后鹏
丁晟
陈一峰
许林海
王玉婵
刘波
宋志棠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Institute of Microsystem and Information Technology of CAS
Original Assignee
Shanghai Institute of Microsystem and Information Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Institute of Microsystem and Information Technology of CAS filed Critical Shanghai Institute of Microsystem and Information Technology of CAS
Priority to CN201210032785.1A priority Critical patent/CN103246610B/en
Publication of CN103246610A publication Critical patent/CN103246610A/en
Application granted granted Critical
Publication of CN103246610B publication Critical patent/CN103246610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides the dynamic storage management method of a kind of embedded system based on single type memory, this embedded system includes prestoring the startup program storage area of kernel and file system start-up loading information and bootstrap and building the system RAM district of kernel and file system, the method is after bootstrap starts, and loads kernel and file system based on log-on message; Then mark with memory field and free memory district in system RAM district; When final system receives renewal or moves instruction, whether application system RAM district has continuously available memory block, if, then write renewal or the moving data of kernel or file system, if not, then arrange the fragment in this free memory district and respectively this fragment is merged into continuously available memory block, so that the renewal of kernel or file system or moving data are write this memory block, the present invention has obscured the boundary of internal memory and external memory, unify storage architecture, external memory management is incorporated among memory management, solves the problems such as inconvenience management.

Description

Dynamic storage management method based on the embedded system of single type memory
Technical field
The present invention relates to the technical field of embedded system, particularly relate to the dynamic storage management method of a kind of embedded system based on single type memory.
Background technology
Embedded system be application-centered, based on computer technology, hardware and software can cutting, adapt to application system to function, reliability, cost, volume, power consumption be strict with dedicated computer system. Along with developing rapidly of embedded technology and semiconductor memory technologies, consumer to the toggle speed of embedded product, run each side such as real-time, power consumption and put forward higher requirement. Therefore, the status tool of winning the market of embedded product is of great significance by the startup bootup process of simplification embedded OS, shortening startup time, reduction system power dissipation.
The function of embedded device realizes mainly through software and extends, along with constantly improving of embedded device function and being continuously increased of application demand, it is necessary to the software in original system is constantly upgraded. By the nonvolatile storage of new software write embedded device, the defective or incomplete software of function before substituting. For a product containing embedded system, design good, powerful upgrading scheme and can bring stronger competitiveness for this product. Upgrade file is generally made image file by the upgrading scheme of existing embedded system, and after data original on the nonvolatile memory in embedded system are all wiped, then image file is write on nonvolatile memory, to reach the purpose of upgrading.
In as shown in Figure 1, the configuration diagram being shown as in prior art embedded system, as shown in the figure, when described embedded system starts, in the copy decompression procedure of described volatibility DRAM kernel image, the plenty of time is consumed by described NANDFlash memorizer, and during kernel (Kernel) load document system (Rootfs), the root file system of file system is decompressed, carry, copy, decompression waste for a long time.Meanwhile, conventional embedded system adopts polytype memorizer of mixing to build Embedded Memory System, and the accumulator system of mixed type brings certain limitation in use, simultaneously also relative complex in the storage management of system, control. especially needed it is intended that, owing to above-mentioned traditional embedded system structure is by bootstrap (Bootloader), kernel (Kernel), and file system (Rootfs) builds in external memory, when carrying out upgrading or rewriting, the refresh rate of the nonvolatile memory being used for save routine data in embedded system is slower, time needed for refresh process is relatively long, so once occur the situations such as accident power-off to make the situation of system break, the system of will result in cannot start, must use special tool and method that the nonvolatile memory in embedded system re-starts refresh operation more just can make system again can use, the program is not only dangerous but also the work of recovery system becomes to waste time and energy again after making system upgrade failure, and, when performing above-mentioned upgrading scheme, the whole of volatile memory must be carried out refreshing and upgrading, and the data of some or the several part specified in volatile memory can not be carried out refreshing and upgrading operation, it is not easy to management.
Furthermore, along with novel memory devices, include but not limited to phase transition storage (PCRAM, PhaseChangeRandomAccessMemory), resistance-variable storing device R-RAM, magnetic memory (MRAM, MagneticRandomAccessMemory), the appearance of the non-volatile random access memory such as ferroelectric memory (FeRAM) and be applied to embedded system, erasable number of times based on the memorizer of this new type limits its relative usage life-span, especially further shorten the service life of novel memory devices when using frequent, uneven to novel memory devices local. Therefore how by becoming another problem demanding prompt solution the service life of balance policy prolongation novel memory devices.
Thus, how a kind of flexible management that can realize updating or move process is provided and reduces the workload of system update, even if can ensure that again and occurring accidental interruption also can be again started up the dynamic storage management method of system in system update process, become the technical problem that practitioner in the art is urgently to be resolved hurrily in fact.
Summary of the invention
The shortcoming of prior art in view of the above, it is an object of the invention to provide the dynamic storage management method of a kind of embedded system based on single type memory, for solve in prior art embedded system update hourly velocity slowly, more amount of new data easily cause greatly embedded system to update unsuccessfully system unavailable, and along with novel memory devices be applied to embedded system but owing to the erasable number of times of novel memory devices is limited, use the problems such as the unbalanced embedded system performance reduction causing shortening in its service life and bring.
For achieving the above object and other relevant purposes, the present invention provides the dynamic storage management method of a kind of embedded system based on single type memory, described embedded system includes the startup program storage area of start-up loading information and the bootstrap prestoring kernel and file system and builds the system RAM district of kernel and file system, and described dynamic storage management method at least comprises the following steps:
1) system electrification, described bootstrap starts;
2) described bootstrap loads described kernel based on the log-on message of the kernel prestored in described startup program storage area, is then based in described startup program storage area the log-on message described file system of loading of the file system prestored;
3) memory field used by the kernel having been turned in described system RAM district and file system is labeled as with memory field, is then free memory district by the zone marker beyond internal memory shared by system RAM district labelling kernel and file system; And
4) when system receives the instruction updating or moving described kernel or file system, apply for and judge whether described free memory district has memory block one piece continuously available, if, then write the more new data of described kernel or file system based on this memory block or described kernel or file system moved to this available memory block, if not, then arrange the fragment in described free memory district and by multiple little, discontinuous memory fragmentation is merged into continuously available memory block, write this memory block with the more new data by described kernel or file system or described kernel or file system moved to this available memory block.
In the dynamic storage management method of the present invention, described embedded system is the accumulator system built based on single non-volatile random access memory, this accumulator system brings the memory block shared by kernel and file system the memory management system of operating system into, and this memorizer is the one in phase transition storage, resistance-variable storing device, magnetic memory or ferroelectric memory.
The step 4 of dynamic storage management method in the present invention) in, at least comprise the following steps:
4-1) system receives the instruction updating or moving described kernel or file system;
4-2) judge whether described free memory district has memory block one piece continuously available, if so, then go to step 4-9), if it is not, then enter next step;
4-3) arrange the fragment in free memory district;
4-4) scan the service condition of internal memory in described system RAM district;
4-5) discrete memory block in system RAM district described in labelling;
4-6) revise the physical address that respectively this discrete memory block virtual address is corresponding;
4-7) respectively this discrete memory block is moved, merged;
4-8) judge whether the memory block capacity through merging meets the available memory block size of application demand, if so, then enter next step, if it is not, then return internal memory application failure information;
4-9) distribute new kernel or new file system memory block based on described system RAM district;
4-10) write the data updating or moving of described kernel or file system;
Whether the data updating or moving 4-11) verifying described kernel or file system are correct; If so, then update or move the start-up loading information of described kernel or file system, if it is not, then return data transmission or move failure information.
The dynamic storage management method of the present invention in one embodiment, in described step 4-1) in, system receives renewal instruction when being the instruction updating described kernel, then in follow-up step:
4-9) distribute new kernel memory area based on described system RAM district;
4-10) write the more new data of described kernel;
Whether more new data 4-11) verifying described kernel is correct; If so, the start-up loading information of kernel in described startup program storage area is then updated, if it is not, then return data transmission fails information.
The dynamic storage management method of the present invention in another embodiment, in described step 4-1) in, system receives renewal instruction when being the instruction updating described file system, then in follow-up step:
4-9) distribute new file system memory block based on described system RAM district;
4-10) write the more new data of described file system;
Whether more new data 4-11) verifying described file system is correct;If so, the start-up loading information of described startup program storage area file system is then updated, if it is not, then return data transmission fails information.
Wherein, when after internal memory application failure or data transmission fails, when system re-powers, described bootstrap loads described kernel based on the log-on message of the kernel not being updated in described startup program storage area, is then based in described startup program storage area the log-on message described file system of loading of the file system not being updated.
The dynamic storage management method of the present invention in another embodiment, in described step 4-1) in, system receives moves instruction when being the instruction moving described kernel, then in follow-up step:
4-9) distribute new kernel memory area based on described system RAM district;
4-10) write the moving data of described kernel;
Whether moving data 4-11) verifying described kernel is correct; If so, the start-up loading information of kernel in described startup program storage area is then updated, if it is not, then return data-moving failure information.
The dynamic storage management method of the present invention is in another embodiment, in described step 4-1) in, system receives moves instruction when being the instruction moving described file system, then in follow-up step:
4-9) distribute new file system memory block based on described system RAM district;
4-10) write the moving data of described file system;
Whether moving data 4-11) verifying described file system is correct; If so, the start-up loading information of described startup program storage area file system is then updated, if it is not, then return data-moving failure information.
Wherein, when after internal memory application failure or data-moving failure, when system re-powers, described bootstrap loads described kernel based on the log-on message of kernel not allochthonous in described startup program storage area, is then based in described startup program storage area the log-on message described file system of loading of the file system not being updated.
As mentioned above, the dynamic storage management method of the embedded system based on single type memory of the present invention, memory block shared by kernel and file system is brought into the memory management system of operating system, realize kernel, file system and system RAM district memory space to share, this dynamic storage management method also provides for a critical function simultaneously, namely can provide the function of application contiguous memory block to application program based on this dynamic storage management method system. the dynamic memory management method that the present invention proposes is applied to based on single non-volatile random access memory (including but not limited to phase transition storage PCRAM, resistance-variable storing device R-RAM, magnetic memory MRAM, the non-volatile random access memory such as ferroelectric memory FeRAM) build accumulator system, this storage system logic is divided into startup program storage area and the system RAM district being dynamically adapted, and in system operation, can need to realize the renewal of system by application program based on system RAM district according to function or move, both the dynamic adjustment of kernel and file system storage section can have been realized based on the storage of system RAM district, reach operating system nucleus and file system and separate upgrading, the flexible management realizing escalation process and the workload greatly reducing in escalation process, accelerate escalation process to reach to update the purpose of systemic-function.
Simultaneously, restricted based on the novel erasable number of times of non-volatile memorizer, and it is used for depositing kernel, the memory block of file system is because of kernel, file system is relatively fixed the operation of this memory block relatively infrequent, the memory block run for program mutually switches its erasable related frequency due to program, this uneven operation to novel memory devices substantially reduces its service life, kernel can be realized based on this dynamic storage management method, moving of file system, by kernel, file system moves reading, write in the memory block of related frequency, kernel is deposited by former, the memory block that relatively infrequent memory block does after discharging when application program runs that uses of file system uses, erasable use equilibrium to reach accumulator system extends its service life.
Accompanying drawing explanation
The configuration diagram that Fig. 1 is shown as in prior art embedded system.
Fig. 2 is shown as the embedded system structure schematic diagram based on single type memory of the present invention.
Fig. 3 is shown as the dynamic storage management method schematic flow sheet of the present invention.
Fig. 4 is shown as updating in dynamic storage management method of the present invention the schematic flow sheet of Kernel-Process.
Fig. 5 is shown as updating in dynamic storage management method of the present invention the schematic flow sheet of File System Processes.
Fig. 6 is shown as moving in dynamic storage management method of the present invention the schematic flow sheet of Kernel-Process.
Fig. 7 is shown as moving in dynamic storage management method of the present invention the schematic flow sheet of File System Processes.
Element numbers explanation
S1~S4 step
S10~S413 step
S10 '~S413 ' step
S10 "~S413 " step
S10 " '~S413 " ' step
Detailed description of the invention
Below by way of specific instantiation, embodiments of the present invention being described, those skilled in the art the content disclosed by this specification can understand other advantages and effect of the present invention easily. The present invention can also be carried out by additionally different detailed description of the invention or apply, and the every details in this specification based on different viewpoints and application, can also carry out various modification or change under the spirit without departing from the present invention.
Refer to Fig. 2 to Fig. 7. It should be noted that, the diagram provided in the present embodiment only illustrates the basic conception of the present invention in a schematic way, then assembly that in graphic, only display is relevant with the present invention but not component count when implementing according to reality, shape and size drafting, during its actual enforcement, the kenel of each assembly, quantity and ratio can be a kind of random change, and its assembly layout kenel is likely to increasingly complex.
As shown in Figure 2, the present invention provides the dynamic storage management method of a kind of embedded system based on single type memory, described embedded system includes starting program storage area and system RAM district, wherein, described startup program storage area prestores start-up loading information and the bootstrap (Bootloader) of kernel (Kernel) and file system (Rootfs), and described kernel and file system are arranged in system RAM district. described embedded system is the accumulator system built based on single non-volatile random access memory, this memorizer is including but not limited to including but not limited to phase transition storage (PCRAM, PhaseChangeRandomAccessMemory), resistance-variable storing device R-RAM, magnetic memory (MRAM, MagneticRandomAccessMemory), the non-volatile random access memory such as ferroelectric memory (FeRAM), described embedded system brings the memory block shared by kernel and file system the memory management system of operating system into, in other words, the dynamic storage management method of the present invention realizes kernel, file system and system RAM district memory space are shared, obscure the boundary of internal memory and external memory, unify storage architecture, the management of external memory is brought into memory management.
The described embedded system based on single type memory is that the memory block shared by kernel and file system is brought into the memory management system of operating system, realize kernel, file system and system RAM district memory space are shared, namely startup program storage area and the system RAM district being dynamically adapted it is divided into based on the storage system logic of the embedded device of this management method, and internal memory shared by kernel and file system is dynamically distributed based on system RAM district, the parameters such as the internal memory initial address of kernel and file system distribution and the size of shared memory block are saved in the fixed memory block starting program storage area.
The dynamic storage management method of the present invention is mainly used in system update and system is moved, so-called system update refers to and according to functional requirement, subregion in system RAM district is updated, realize operating system nucleus and file system and separate renewal, reach the flexible management of renewal process and update systemic-function, so-called system is moved and namely the region using more frequent region relatively infrequent with use in system RAM district is adjusted, realize the dynamic adjustment of kernel and file system storage position in the storage of system RAM district, the equilibrium reaching the erasable use of accumulator system extends its service life.
Referring to Fig. 3, described dynamic storage management method at least comprises the following steps:
Step S1, system electrification are first carried out, and described bootstrap starts, and to initialize the hardware such as the such as internal memory of described embedded device, then performs step S2.
In step s 2, system loads described kernel based on the log-on message of the kernel prestored in described startup program storage area, after kernel starts successfully, the log-on message based on the file system prestored in described startup program storage area loads described file system, then performs step S3.
In step s3, memory field used by the kernel having been turned in described system RAM district and file system is labeled as with memory field, it is free memory district by the zone marker beyond internal memory shared by system RAM district labelling kernel and file system, in other words, memory field used by the kernel having been turned on and file system is labeled as and uses by system, other region of memorys in system RAM district are labeled as available, after system start-up, the distribution that is based in system RAM district free memory district of internal memory used by execution program, then performs step S4.
In step s 4, when system receives the instruction updating or moving described kernel or file system, apply for and judge whether described free memory district has memory block one piece continuously available, if, then write the more new data of described kernel or file system based on this memory block or described kernel or file system moved to this available memory block, if not, then arrange the fragment in described free memory district and by multiple little, discontinuous memory fragmentation is merged into continuously available memory block, write this memory block with the more new data by described kernel or file system or described kernel or file system moved to this available memory block.
Based on the dynamic storage management method that the present invention proposes, carry out system update or move to be realized by application program in system operation, application program send to system update or moving request, obtained by the various communication means under system running state update or moving data and call dynamic memory management method acquisition internal memory that this patent proposes, write data, checking data, amendment log-on message complete renewal process. If kernel updates or process of moving completes, kernel log-on message is changed accordingly, to load the system kernel after updating or moving based on new kernel log-on message when system is again started up, otherwise kernel log-on message remains unchanged, the kernel that system will load before updating or moving; If file system updates or process of moving completes, file system log-on message is changed accordingly, when kernel has started load document system, the file system after updating or moving will be loaded based on new file system log-on message, otherwise file system log-on message remains unchanged, load the file system updated or before moving, say, that no matter system kernel and file system updates or whether process of moving completes system and can again normally start all the time.
In order to principles of the invention and effect are expanded on further, describe kernel and file system in described step S4 separately below update or move process, refer to Fig. 4, Fig. 5, Fig. 6 and Fig. 7, Fig. 4 is shown as updating in dynamic storage management method of the present invention the schematic flow sheet of Kernel-Process, Fig. 5 is shown as updating in dynamic storage management method of the present invention the schematic flow sheet of File System Processes, Fig. 6 is shown as moving in dynamic storage management method of the present invention the schematic flow sheet of Kernel-Process, Fig. 7 is shown as moving in dynamic storage management method of the present invention the schematic flow sheet of File System Processes.
Kernel renewal process as shown in Figure 4, perform step S40, system receives the instruction updating described kernel, when application program send to system more newly requested after, system first passes through the network that is used under starting state, serial ports, the various instruments such as USB obtain the data needing to update. Then step S41 is performed.
In step S41, it is judged that whether above-mentioned steps S3 has memory block one piece continuously available in the free memory district of labelling, if so, then go to step S49, if it is not, then perform step S42.
In step S42, arrange the fragment in free memory district, then perform step S43.
In step S43, scan the service condition of internal memory in described system RAM district, then perform step S44.
In step S44, discrete memory block in system RAM district described in labelling, then perform step S45.
In step S45, the amendment physical address that respectively this discrete memory block virtual address is corresponding, then perform step S46.
In step S46, respectively this discrete memory block is moved, is merged, to obtain memory block large stretch of continuously, say, that, multiple little, discontinuous memory blocks are merged into the available memory block meeting application demand continuously by arranging the mode of memory fragmentation by system, then perform step S47.
In step S47, it is judged that whether the memory block capacity through merging meets the available memory block size of application demand, if so, then goes to step 49, if it is not, then perform step S48.
In step S48, return internal memory application failure information, terminate. It should be noted that when after internal memory application failure, when system re-powers, when starting kernel, load described kernel based on starting the kernel log-on message not being updated in program storage area.
In step S49, distribute new kernel memory area based on described system RAM district, then perform step S410.
In step S410, write the more new data of described kernel, then perform step S411.
In step S411, whether the more new data verifying described kernel is correct, if so, then goes to step 412, if it is not, then perform step S413.
In step S412, update the start-up loading information of described kernel, terminate. Namely start the kernel start-up loading information of program storage area described in system update, so that system is when restarting, when starting kernel, load described kernel based on the kernel log-on message started after updating in program storage area.
In step S413, return data transmission fails information, terminate. It should be noted that when after data transmission fails, when system re-powers, when starting kernel, load described kernel based on starting the kernel log-on message not being updated in program storage area.
As from the foregoing, when updating kernel based on system RAM district, system is primarily based on the memory block that the application of system RAM district is a piece continuously available, and will need to update the memory block of the related data write application of kernel, kernel data after checksum update, initial address and size based on the kernel memory area after updating update and start the relevant information that the loading kernel preserved in program storage area starts.
File system renewal process as shown in Figure 5, perform step S40 ', system receives the instruction updating described file system, when application program send to system more newly requested after, system first passes through the network that is used under starting state, serial ports, the various instruments such as USB obtain the data needing to update. Then step S41 ' is performed.
In step S41 ', it is judged that whether above-mentioned steps S3 has memory block one piece continuously available in the free memory district of labelling, if so, then go to step S49 ', if it is not, then perform step S42 '.
In step S42 ', arrange the fragment in free memory district, then perform step S43 '.
In step S43 ', scan the service condition of internal memory in described system RAM district, then perform step S44 '.
In step S44 ', discrete memory block in system RAM district described in labelling, then perform step S45 '.
In step S45 ', the amendment physical address that respectively this discrete memory block virtual address is corresponding, then perform step S46 '.
In step S46 ', respectively this discrete memory block is moved, merged, to obtain memory block large stretch of continuously, that is, multiple little, discontinuous memory blocks are merged into the available memory block meeting application demand continuously by arranging the mode of memory fragmentation by system, then perform step S47 '.
In step S47 ', it is judged that whether the memory block capacity through merging is continuously available, if so, then goes to step 49 ', if it is not, then perform step S48 '.
In step S48 ', return internal memory application failure information, terminate. It should be noted that when after internal memory application failure, when system re-powers, when startup file system, load described file system based on starting the file system log-on message not being updated in program storage area.
In step S49 ', distribute new file system memory block based on described system RAM district, then perform step S410 '.
In step S410 ', write the more new data of described file system, then perform step S411 '.
In step S411 ', whether correct verify described file system more new data, if so, then go to step 412 ', if it is not, then perform step S413 '.
In step S412 ', update the start-up loading information of described file system, terminate. Namely start the file system start-up loading information of program storage area described in system update, so that system is when restarting, when startup file system, load described file system based on the file system log-on message started after updating in program storage area.
In step S413 ', return data transmission fails information, terminate. It should be noted that when after data transmission fails, when system re-powers, when startup file system, described bootstrap loads described file system based on the log-on message of the file system not being updated in described startup program storage area.
As from the foregoing, during based on system RAM district more new file system, system is primarily based on the memory block that the application of system RAM district is a piece continuously available, and the related data needing more new file system is write the memory block of application, file system data after checksum update, initial address and size based on the file system storage section after updating update the relevant information starting the load document system start-up preserved in program storage area.
Kernel as shown in Figure 6 moves process, performs step S40 ", system receives the instruction moving described kernel, after application program moves request to system transmission, then performs step S41 ".
In step S41 " in, it is judged that whether above-mentioned steps S3 has memory block one piece continuously available in the free memory district of labelling, if so, then goes to step S49 ", if it is not, then perform step S42 ".
In step S42 " in, arrange the fragment in free memory district, then perform step S43 ".
In step S43 " in, scan the service condition of internal memory in described system RAM district, then perform step S44 ".
In step S44 " in, discrete memory block in system RAM district described in labelling, then perform step S45 ".
In step S45 " in, the amendment physical address that respectively this discrete memory block virtual address is corresponding, then perform step S46 ".
In step S46 " in; respectively this discrete memory block is moved, is merged; to obtain continuously large stretch of memory block; that is; multiple little, discontinuous memory blocks are merged into the available memory block meeting application demand continuously by arranging the mode of memory fragmentation by system, then execution step S47 ".
In step S47 " in, it is judged that whether the memory block capacity through merging meets the available memory block size of application demand, if so, then goes to step 49 ", if it is not, then perform step S48 ".
In step S48 " in, return internal memory application failure information, terminate. It should be noted that when after internal memory application failure, when system re-powers, when starting kernel, load described kernel based on starting not allochthonous kernel log-on message in program storage area.
In step S49 " in, distribute new kernel memory area based on described system RAM district, then perform step S410 ".
In step S410 " in, write the moving data of described kernel, namely replicate the data of described kernel to newly assigned kernel memory area, then perform step S411 ".
In step S411 " in, whether the moving data verifying described kernel is correct, if so, then goes to step 412 ", if it is not, then perform step S413 ".
In step S412 " in, update the start-up loading information of described kernel, terminate. Namely start the kernel start-up loading information of program storage area described in system update, so that system is when restarting, when starting kernel, load described kernel based on the kernel log-on message started after updating in program storage area.
In step S413 " in, return data transmission fails information, terminate. It should be noted that when after data transmission fails, when system re-powers, when starting kernel, load described kernel based on starting the kernel log-on message not being updated in program storage area.
As from the foregoing, when moving kernel based on system RAM district, system is primarily based on the memory block that the application of system RAM district is a piece continuously available, and will need to move the memory block of the related data write application of kernel, verifying the kernel data after moving, initial address and size based on the kernel memory area after moving are moved and are started the relevant information loading kernel startup preserved in program storage area.
File system as shown in Figure 7 moves process, performs step S40 " ', system receives the instruction moving described file system, after application program moves request to system transmission, then performs step S41 " '.
In step S41 " ' in, it is judged that whether above-mentioned steps S3 has memory block one piece continuously available in the free memory district of labelling, if so, then goes to step S49 " ', if it is not, then perform step S42 " '.
In step S42 " ' in, arrange the fragment in free memory district, then perform step S43 " '.
In step S43 " ' in, scan the service condition of internal memory in described system RAM district, then perform step S44 " '.
In step S44 " ' in, discrete memory block in system RAM district described in labelling, then perform step S45 " '.
In step S45 " ' in, the amendment physical address that respectively this discrete memory block virtual address is corresponding, then perform step S46 " '.
In step S46 " ' in; respectively this discrete memory block is moved, is merged; to obtain continuously large stretch of memory block; that is; multiple little, discontinuous memory blocks are merged into the available memory block meeting application demand continuously by arranging the mode of memory fragmentation by system, then execution step S47 " '.
In step S47 " ' in, it is judged that whether the memory block capacity through merging is continuously available, if so, then goes to step 49 " ', if it is not, then perform step S48 " '.
In step S48 " ' in, return internal memory application failure information, terminate. It should be noted that when after internal memory application failure, when system re-powers, when startup file system, load described file system based on starting not allochthonous file system log-on message in program storage area.
In step S49 " ' in, distribute new file system memory block based on described system RAM district, then perform step S410 " '.
In step S410 " ' in, write the moving data of described file system, namely replicate the data of described file system to newly assigned file system storage section, then perform step S411 " '.
In step S411 " ' in, whether correct verify described file system moving data, if so, then go to step 412 " ', if it is not, then perform step S413 " '.
In step S412 " ' in, update the start-up loading information of described file system, terminate. Namely start the file system start-up loading information of program storage area described in system update, so that system is when restarting, when startup file system, load described file system based on the file system log-on message started after updating in program storage area.
In step S413 " ' in, return data transmission fails information, terminate. It should be noted that when after data transmission fails, when system re-powers, when startup file system, described bootstrap loads described file system based on the log-on message of the file system not being updated in described startup program storage area.
As from the foregoing, when moving file system based on system RAM district, system is primarily based on the memory block that the application of system RAM district is a piece continuously available, and will need to move the memory block of the related data write application of file system, verifying the file system data after moving, initial address and size based on the file system storage section after moving move the relevant information starting the load document system start-up preserved in program storage area.
In the dynamic storage management method of the present invention, system update refers to and according to functional requirement, subregion in system RAM district is updated, it is achieved operating system nucleus and file system separate renewal, reaches the flexible management of renewal process and updates systemic-function; System is moved and namely the region using more frequent region relatively infrequent with use in system RAM district is adjusted, realizing the dynamic adjustment of kernel and file system storage position in the storage of system RAM district, the equilibrium reaching the erasable use of accumulator system extends its service life.
In sum, the dynamic storage management method of the embedded system based on single type memory of the present invention, memory block shared by kernel and file system is brought into the memory management system of operating system, unify storage architecture, obscure the boundary line of internal memory and external memory, realize kernel, file system and system RAM district memory space to share, this dynamic storage management method also provides for a critical function simultaneously, namely can provide the function of application contiguous memory block to application program based on this dynamic storage management method system.The dynamic memory management method that the present invention proposes is applied to build accumulator system based on single non-volatile random access memory, this storage system logic is divided into startup program storage area and the system RAM district being dynamically adapted, and in system operation, can need to be realized the renewal of system by application program based on system RAM district according to function, both the dynamic adjustment of kernel and file system storage section can have been realized based on the storage of system RAM district, reaching the erasable of accumulator system uses equilibrium to extend its service life, operating system nucleus and file system can be realized again and separate upgrading, the flexible management realizing escalation process and the workload greatly reducing in escalation process, and accelerate escalation process to reach to update the purpose of systemic-function. so, the present invention effectively overcomes various shortcoming of the prior art and has high industrial utilization.
Above-described embodiment is illustrative principles of the invention and effect thereof only, not for the restriction present invention. Above-described embodiment all under the spirit and category of the present invention, can be modified or change by any those skilled in the art. Therefore, art has usually intellectual such as modifying without departing from all equivalences completed under disclosed spirit and technological thought or change, must be contained by the claim of the present invention.

Claims (8)

1. the dynamic storage management method based on the embedded system of single type memory, it is characterized in that, described embedded system includes the startup program storage area of start-up loading information and the bootstrap prestoring kernel and file system and builds the system RAM district of kernel and file system, and described dynamic storage management method at least comprises the following steps:
1) system electrification, described bootstrap starts;
2) described bootstrap loads described kernel based on the start-up loading information of the kernel prestored in described startup program storage area, is then based in described startup program storage area the start-up loading information described file system of loading of the file system prestored;
3) memory field used by the kernel having been turned in described system RAM district and file system is labeled as with memory field, is then free memory district by the zone marker beyond internal memory shared by system RAM district labelling kernel and file system;
4) when system receives the instruction updating or moving described kernel or file system, apply for and judge whether described free memory district has memory block one piece continuously available, if, then write the more new data of described kernel or file system based on this memory block or described kernel or file system moved to this available memory block, if not, then arrange the fragment in described free memory district and by multiple little, discontinuous memory fragmentation is merged into continuously available memory block, write this memory block with the more new data by described kernel or file system or described kernel or file system moved to this available memory block, described step 4) at least comprise the following steps:
4-1) system receives the instruction updating or moving described kernel or file system;
4-2) judge whether described free memory district has memory block one piece continuously available, if so, then go to step 4-9), if it is not, then enter next step;
4-3) arrange the fragment in free memory district;
4-4) scan the service condition of internal memory in described system RAM district;
4-5) discrete memory block in system RAM district described in labelling;
4-6) revise the physical address that respectively this discrete memory block virtual address is corresponding;
4-7) respectively this discrete memory block is moved, merged;
4-8) judge whether the memory block capacity through merging meets the available memory block size of application demand, if so, then enter next step, if it is not, then return internal memory application failure information;
4-9) distribute new kernel or new file system memory block based on described system RAM district;
4-10) write the data updating or moving of described kernel or file system;
Whether the data updating or moving 4-11) verifying described kernel or file system are correct; If so, then update or move the start-up loading information of described kernel or file system, if it is not, then return data transmission or move failure information.
2. the dynamic storage management method of the embedded system based on single type memory according to claim 1, it is characterized in that: described embedded system is the accumulator system built based on single non-volatile random access memory, this accumulator system brings the memory block shared by kernel and file system the memory management system of operating system into, and this memorizer is the one in phase transition storage, resistance-variable storing device, magnetic memory or ferroelectric memory.
3. the dynamic storage management method of the embedded system based on single type memory according to claim 1, it is characterised in that: in described step 4-1) in, system receives renewal instruction when being the instruction updating described kernel, then in follow-up step:
4-9) distribute new kernel memory area based on described system RAM district;
4-10) write the more new data of described kernel;
Whether more new data 4-11) verifying described kernel is correct; If so, the start-up loading information of kernel in described startup program storage area is then updated, if it is not, then return data transmission fails information.
4. the dynamic storage management method of the embedded system based on single type memory according to claim 1, it is characterized in that: in described step 4-1) in, system receives renewal instruction when being the instruction updating described file system, then in follow-up step:
4-9) distribute new file system memory block based on described system RAM district;
4-10) write the more new data of described file system;
Whether more new data 4-11) verifying described file system is correct; If so, the start-up loading information of described startup program storage area file system is then updated, if it is not, then return data transmission fails information.
5. the dynamic storage management method of the embedded system based on single type memory according to claim 1 or 4, it is characterized in that: when after internal memory application failure or data transmission fails, when system re-powers, described bootstrap loads described kernel based on the start-up loading information of the kernel not being updated in described startup program storage area, is then based in described startup program storage area the start-up loading information described file system of loading of the file system not being updated.
6. the dynamic storage management method of the embedded system based on single type memory according to claim 1, it is characterised in that: in described step 4-1) in, system receives moves instruction when being the instruction moving described kernel, then in follow-up step:
4-9) distribute new kernel memory area based on described system RAM district;
4-10) write the moving data of described kernel;
Whether moving data 4-11) verifying described kernel is correct; If so, the start-up loading information of kernel in described startup program storage area is then updated, if it is not, then return data-moving failure information.
7. the dynamic storage management method of the embedded system based on single type memory according to claim 1, it is characterized in that: in described step 4-1) in, system receives moves instruction when being the instruction moving described file system, then in follow-up step:
4-9) distribute new file system memory block based on described system RAM district;
4-10) write the moving data of described file system;
Whether moving data 4-11) verifying described file system is correct; If so, the start-up loading information of described startup program storage area file system is then updated, if it is not, then return data-moving failure information.
8. the dynamic storage management method of the embedded system based on single type memory according to claim 1,6 or 7, it is characterized in that: when after internal memory application failure or data-moving failure, when system re-powers, described bootstrap loads described kernel based on the start-up loading information of the kernel not being updated in described startup program storage area, and the start-up loading information being then based on not allochthonous file system in described startup program storage area loads described file system.
CN201210032785.1A 2012-02-14 2012-02-14 Dynamic storage management method based on the embedded system of single type memory Active CN103246610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210032785.1A CN103246610B (en) 2012-02-14 2012-02-14 Dynamic storage management method based on the embedded system of single type memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210032785.1A CN103246610B (en) 2012-02-14 2012-02-14 Dynamic storage management method based on the embedded system of single type memory

Publications (2)

Publication Number Publication Date
CN103246610A CN103246610A (en) 2013-08-14
CN103246610B true CN103246610B (en) 2016-06-15

Family

ID=48926140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210032785.1A Active CN103246610B (en) 2012-02-14 2012-02-14 Dynamic storage management method based on the embedded system of single type memory

Country Status (1)

Country Link
CN (1) CN103246610B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182358B (en) * 2014-08-21 2017-07-14 飞天诚信科技股份有限公司 A kind of method and device for optimizing reading and writing data
TWI537816B (en) * 2014-10-13 2016-06-11 慧榮科技股份有限公司 Non-volatile memory device and control method for controller
CN107526533B (en) * 2016-06-21 2020-08-11 伊姆西Ip控股有限责任公司 Storage management method and equipment
CN106201717A (en) * 2016-07-01 2016-12-07 珠海市魅族科技有限公司 A kind of method managing Installed System Memory and terminal
CN106648594B (en) * 2016-09-30 2020-07-10 海信视像科技股份有限公司 Terminal starting method and device
CN107301056A (en) * 2017-07-27 2017-10-27 上海斐讯数据通信技术有限公司 A kind of AP online upgradings processing method and processing device
CN110162483B (en) * 2018-02-12 2020-10-20 上海寒武纪信息科技有限公司 Static memory defragmentation method, device, computer equipment and storage medium
CN108959517B (en) * 2018-06-28 2021-06-01 河南思维轨道交通技术研究院有限公司 File management method and device and electronic equipment
CN110377345B (en) * 2019-06-27 2022-08-02 苏州浪潮智能科技有限公司 Method and device for processing system startup file
CN111258789B (en) * 2020-01-19 2022-03-08 苏州浪潮智能科技有限公司 Method, apparatus, device and medium for predicting remaining life of nonvolatile memory device
CN114595162B (en) * 2022-05-10 2022-08-19 紫光同芯微电子有限公司 Method and device for memory defragmentation of JAVA intelligent card
CN116450206B (en) * 2023-06-14 2023-09-01 飞腾信息技术有限公司 Software system construction method, device, equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576890A (en) * 2008-05-08 2009-11-11 深圳市朗科科技股份有限公司 Novel method and system for sorting fragment
CN101950262A (en) * 2010-10-20 2011-01-19 深圳市开立科技有限公司 Method and device for realizing safe mode in embedded system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9058675B2 (en) * 2010-05-29 2015-06-16 Intel Corporation Non-volatile storage for graphics hardware

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576890A (en) * 2008-05-08 2009-11-11 深圳市朗科科技股份有限公司 Novel method and system for sorting fragment
CN101950262A (en) * 2010-10-20 2011-01-19 深圳市开立科技有限公司 Method and device for realizing safe mode in embedded system

Also Published As

Publication number Publication date
CN103246610A (en) 2013-08-14

Similar Documents

Publication Publication Date Title
CN103246610B (en) Dynamic storage management method based on the embedded system of single type memory
CN109478135B (en) Computer system and method for rebooting a computer system
CN100541600C (en) The dynamic multiple display configuration
EP3158452B1 (en) Firmware interface with durable memory storage
CN104216745A (en) Online upgrading system and method for semi-active suspension ECU (Electronic Control Unit) controller software
CN102597963B (en) Dynamic copies volume in cluster exchanges
CN106293824A (en) A kind of from the method and device processing chip upgrade
CN103761088A (en) Multiple operation system switching method applicable to ARM (advanced risc machine) framework mobile equipment
CN1725182A (en) Apparatus and method for updating I/O capability of a logically-partitioned computer system
CN103699398A (en) Terminal equipment and starting control method thereof
CN105264506A (en) Assigning processors to memory mapped configuration
CN109213570A (en) A kind of virtual machine migration method, device, equipment and readable storage medium storing program for executing
JP2011060225A (en) Operating system booting method
CN104850505A (en) Memory management method and system based on chain type stacking
CN110069336A (en) Memory source distribution method, distributor, chip and storage device
CN102253844B (en) Method and device for starting processor
CN115048216A (en) Resource management scheduling method, device and equipment for artificial intelligence cluster
CN108920196A (en) Entire car controller bootload upgrade method, device, entire car controller and vehicle
CN109933358B (en) Control method for reducing program upgrading amount of metering equipment
WO2023169161A1 (en) Method for using dynamic, discrete, and fragmented embedded system nand flash
CN103339603A (en) Computer reprogramming method, data storage medium and motor vehicle computer
CN111984410A (en) Memory protection system with low resource occupation in embedded system
CN109783145B (en) Method for creating multi-image-based multifunctional embedded system
CN103514098A (en) Method and system used for recovering storage space
US20060282698A1 (en) Method and device for operating a secondary operating system auxiliary to a primary operating system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant