The content of the invention
For above mentioned problem existing for upgrading operation system kernel image in the prior art, one kind is now provided and aims at liter
A kind of method of level upgrade-system kernel image simple to operate.
Concrete technical scheme is as follows:
A kind of method of upgrade-system kernel image, applied to embedded device, comprises the following steps:
Step S1, a random memory unit is provided, to load a source file;
Step S2, a converting unit is provided, a system partition holding to be mapped as in the random memory unit
One file destination;
Step S3, instructed using system copies and the source file is copied to the file destination;
The file destination is converted to the matching system partition holding form by step S4, described converting unit, and is write
Enter the system partition holding.
Preferably, in the step S1, there is provided a host computer, for the source file to be transmitted to the random storage list
Member.
Preferably, in the step S1, the source file is a system image file.
Preferably, in the step S2, the system partition holding is located on a flash chip.
Preferably, in the step S2, the converting unit by the metadata of the file destination be loaded onto it is described with
In machine memory cell, the data of the file destination are remained in the system partition holding, and in the random storage list
The initial address of the data of file destination and end address described in the system partition holding are indicated in member.
Preferably, in the step S3, there is provided a detection module is to detect the instruction of user's input, if the instruction
Meet that preparatory condition is then ignored.
Preferably, the preparatory condition is that the instruction is Rename file or creaties directory.
Preferably, the data space-consuming of the file destination is identical with the size of the system partition holding.
Preferably, the converting unit is based on (SuSE) Linux OS.
Preferably, in the step S2, there is provided a searching modul, the specific bit of the data for searching the file destination
Put.
Above-mentioned technical proposal has the following advantages that or beneficial effect:Source file is led to by providing a converting unit and realizing
Cross system command and be copied into system partition holding, overcome upgrade-system kernel image file in the prior art needs into equipment
The problem of special programming operation.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art obtained on the premise of creative work is not made it is all its
His embodiment, belongs to the scope of protection of the invention.
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the present invention can phase
Mutually combination.
The invention will be further described with specific embodiment below in conjunction with the accompanying drawings, but not as limiting to the invention.
Technical scheme includes the method for a upgrade-system kernel image.
As shown in figure 1, a kind of method of upgrade-system kernel image, applied to embedded device, comprises the following steps:
Step S1, a random memory unit is provided, to load a source file;
Step S2, one converting unit is provided, to by a system partition holding in being mapped as a mesh in random memory unit
Mark file;
Step S3, instructed using system copies and source file is copied to file destination;
Step S4, file destination is converted to matching system partition holding form, and writing system storage point by converting unit
Area.
In above-mentioned technical proposal, source file is loaded by random memory unit, and system is stored by converting unit
Subregion is mapped as file destination in random memory unit, and it is laggard that source file is copied into file destination by system copies order
File destination is converted into matching system partition holding form by one step by converting unit, and file destination writing system is deposited
Subregion is stored up, it is achieved thereby that need not program, the operation of upgrade-system kernel image, operation are completed using only system copies order
It is simple and convenient.
In a kind of preferably embodiment, in step S1, there is provided a host computer, for source file to be transmitted to depositing at random
Storage unit.In further preferred embodiment, host computer can be computer.
As a kind of preferable embodiment, random memory unit can be a RAM chip, or RAM chip group.
In a kind of preferably embodiment, in step S1, source file is a system image file.
In a kind of preferably embodiment, in step S2, system partition holding is located on a flash chip.
In a kind of preferably embodiment, in step s 2, converting unit by the metadata of file destination be loaded onto with
In machine memory cell, the data of file destination are remained in system partition holding, and system is indicated in random memory unit
The initial address of the data of file destination and end address in partition holding.
As a kind of preferred embodiment, file destination can be named as OS.IMG.Further, can be by the text of file destination
In the storage of part name information and random memory unit.
In a kind of preferably embodiment, in step S3, there is provided a detection module is detecting the finger of user's input
Order, ignore if instruction meets preparatory condition.
In a kind of preferably embodiment, preparatory condition is to instruct as Rename file or create directory.
As a kind of preferred embodiment, operational order is if deleting file or re-create file then in step s3
Perform respective operations.
In a kind of preferably embodiment, the data space-consuming of file destination and the size phase of system partition holding
Together.
As a kind of preferred embodiment, system partition holding can be to allocate the one of address and size in advance on flash chip
Block region.
In a kind of preferably embodiment, converting unit is based on (SuSE) Linux OS.
In a kind of preferably embodiment, in step S2, there is provided a searching modul, for searching the data of file destination
Specified location.
Illustrated below with a kind of specific embodiment, be the embodiment based on (SuSE) Linux OS in converting unit
Under, source file is transmitted to random memory unit, random memory unit by a host computer and starts to add by the source file received
Carry, system partition holding is mapped as the file destination in random memory unit by converting unit, by random memory unit
Source file is copied in file destination using system copies order, further changed file destination by conversion unit
After form for matching system partition holding, by file destination writing system partition holding, it is achieved thereby that passing through system copies
Order system kernel image file writing system partition holding, overcome upgrade-system kernel image file in the prior art and arrive
The problem of special programming operation is needed in equipment.
Above-mentioned technical proposal has the following advantages that or beneficial effect:Source file is led to by providing a converting unit and realizing
Cross system command and be copied into system partition holding, overcome upgrade-system kernel image file in the prior art needs into equipment
The problem of special programming operation.
Preferred embodiments of the present invention are the foregoing is only, not thereby limit embodiments of the present invention and protection model
Enclose, to those skilled in the art, should can appreciate that all with made by description of the invention and diagramatic content
Scheme obtained by equivalent substitution and obvious change, should be included in protection scope of the present invention.