Summary of the invention
In view of this, the invention provides a kind of be applicable to SOC (system on a chip) system backup and recovery device and method thereof.
Be applicable to system backup and the recovery device of SOC (system on a chip), it comprise on-chip system chip, first memory, to be backed up and/or recover peripheral hardware;
First memory, peripheral hardware are all electrically connected with on-chip system chip; First memory is for storing BIOS data and system mirror data;
On-chip system chip comprises processor, second memory, peripheral interface module; Processor is used for reading system mirror image data from first memory, and system mirror data is write peripheral hardware; Second memory is used for storage system mirror back-up control documents; Peripheral interface module is for controlling the communication of on-chip system chip and first memory, peripheral hardware, serial ports.
In the system backup being applicable to SOC (system on a chip) of the present invention and recovery device, it also comprises serial ports, host computer;
Host computer is connected with on-chip system chip by serial ports; Host computer to carry out the backup of system mirror data to peripheral hardware for controlling on-chip system chip; Second memory is also for storing serial port service file; Peripheral interface module is also for controlling the communication of on-chip system chip by serial ports and host computer.
Be applicable to a system backup method for SOC (system on a chip), its system backup being applicable to SOC (system on a chip) by above-mentioned and recovery device realize, and comprise the steps:
S1, host computer are communicated by serial ports with on-chip system chip; And keep on-chip system chip to be in off-position;
S2, host computer initialization serial ports, select the system image file needing backup, and arrange the offset address that first memory treats programming;
S3, host computer send the request connecting on-chip system chip, constantly send to on-chip system chip control word of shaking hands by serial ports;
S4, on-chip system chip to be powered on, start on-chip system chip, and after receiving the control word of shaking hands that host computer sends, send response control word to host computer;
S5, host computer are after receiving response control word, control on-chip system chip and treat the offset address of programming according to the first memory in step S2, in erasing first memory corresponding block as system mirror data memory address and treat that system mirror data is write corresponding address in first memory by the offset address of programming according to first memory.
Be applicable to a system recovery method for SOC (system on a chip), its system backup being applicable to SOC (system on a chip) by above-mentioned and recovery device realize, and it comprises the steps:
S01, the BIOS started in first memory, before the hard disk moved in peripheral hardware guides operating system;
S02, receive the request of recovery system preset for sending;
S03, the BIOS passed through in operation first memory, by the hard drive space of the system backup data write peripheral hardware in first memory.
Provided by the invention be applicable to SOC (system on a chip) system backup and recovery device and method thereof, tool has the following advantages: (1) data backup procedure, without the need to the hard disk of peripheral hardware to be backed up, does not need the interfaces such as CD-ROM drive, floppy drive, network interface, USB yet.(2) during System recover, without the need to dismantling hard disk, the interfaces such as serial ports, CD-ROM drive, floppy drive, USB are not needed yet.(3), during System recover, adopt the direct programming of system mirror data, compared with the backup method based on file, the speed of backup is fast.
Embodiment
As shown in Figure 1, a kind of system backup and recovery device being applicable to SOC (system on a chip), it comprise on-chip system chip 10, first memory 20, to be backed up and/or recover peripheral hardware 30.
Alternatively, wherein first memory 20 can be nonvolatile memory.Further, nonvolatile memory can be flash memory (Flash) chip.The present invention is not limited thereto.
First memory 20, peripheral hardware 30 are all electrically connected with on-chip system chip 10; First memory 20 is for storing BIOS data and system mirror data.
On-chip system chip 10 comprises processor 11, second memory 12, peripheral interface module 13; System mirror data for reading system mirror image data from first memory 20, and is write peripheral hardware 30 by processor 11; Second memory 12 is for storage system mirror back-up control documents; Peripheral interface module 13 is for controlling the communication of on-chip system chip 10 and first memory 20, peripheral hardware 30, serial ports 40.Second memory 12 can be ROM in sheet.
Alternatively, system mirror data, not only comprises operating system mirror image, also comprises the Master boot sector of DISK to Image, partitions of file table, and partition content etc. are all normally starts relevant data message to hard disk operation system.Usually, be limited to capacity, system image file leaves nonvolatile memory in be needed to intercept and compression process, and its concrete form of implementation is unrelated to the invention.
Alternatively, the system backup and the recovery device that are applicable to SOC (system on a chip) can also comprise serial ports 40, host computer 50.Host computer 50 can be common PC, the present invention is not limited thereto.
Host computer 50 is connected with on-chip system chip 10 by serial ports 40; Host computer 50 carries out the backup of system mirror data for controlling on-chip system chip 10 pairs of peripheral hardwares 30; Second memory 12 is also for storing serial ports 40 service document; Peripheral interface module 13 is also for controlling on-chip system chip 10 by the communication of serial ports 40 with host computer 50.
Wherein system mirror data can be made in advance, and is stored in host computer 50.
Can program code in memory feature in ROM in second memory 12, ordering for receiving host computer 50 serial ports 40 of this section of program code, judges whether to need system mirror data to write in first memory 20.
As shown in Figure 2, the embodiment of the present invention also provides a kind of system backup method being applicable to SOC (system on a chip), and it is realized by the system backup being applicable to SOC (system on a chip) described in above-mentioned any one embodiment and recovery device, comprises the steps:
S1, host computer 50 are communicated by serial ports 40 with on-chip system chip 10; And keep on-chip system chip 10 to be in off-position.
S2, host computer 50 initialization serial ports 40, select the system image file needing backup, and arrange the offset address that first memory 20 treats programming;
S3, host computer 50 send the request connecting on-chip system chip 10, constantly send to on-chip system chip 10 control word of shaking hands by serial ports 40.
S4, on-chip system chip 10 to be powered on, start on-chip system chip 10, and after receiving the control word of shaking hands that host computer 50 sends, send response control word to host computer 50.Receive handshake request control word, represent that backup image wished by host computer 50 software.
S5, host computer 50 are after receiving response control word, control on-chip system chip 10 and treat the offset address of programming according to the first memory 20 in step S2, in erasing first memory 20 corresponding block as system mirror data memory address and treat that system mirror data is write corresponding address in first memory 20 by the offset address of programming according to first memory 20.
Alternatively, as shown in Figure 3, described step S5 comprises:
S51, host computer 50, after receiving response control word, send erasing control word and block address to be erased to on-chip system chip 10; On-chip system chip 10 receives erasing control word and block address to be erased, and according to corresponding block in block address to be erased erasing first memory 20, and the response word of erasing is sent to host computer 50;
S52, host computer 50, after receiving the response word of erasing, judge in first memory 20, whether all blocks are all wiped complete, if all erasings, jump to step S53; If all erasings, jump to step S51, and repeated execution of steps S51, step S52 are not until blocks all in first memory 20 is all wiped complete, and jump to step S53;
S53, host computer 50, after receiving the response word of erasing, send to on-chip system chip 10 and write control word and write address, write data; On-chip system chip 10 receives and writes control word and write address, writes data, and according to write address by block corresponding in first memory 20 in data write step S51, and the response word of write is sent to host computer 50;
S54, host computer 50 are after receiving the response word of write, judge that whether system mirror data all writes in first memory 20 in corresponding block, if all writes, be sent completely control word to on-chip system chip 10, on-chip system chip 10 normally starts after having received control word; If all writes, jump to step S53, and repeated execution of steps S53, step S54 are until system mirror data all to write in first memory 20 in corresponding block.
As shown in Figure 4, the embodiment of the present invention also provides a kind of system recovery method being applicable to SOC (system on a chip), and it is realized by the system backup being applicable to SOC (system on a chip) described in above-mentioned any one embodiment and recovery device, and it comprises the steps:
S01, the BIOS started in first memory 20, before the hard disk moved in peripheral hardware 30 guides operating system;
S02, receive the request of recovery system preset for sending;
S03, the BIOS passed through in operation first memory 20, by the hard drive space of the system backup data write peripheral hardware 30 in first memory 20.In this step, described image file writes hard drive space successively, and wiring method can be write successively by disk C HS (cylinder, head, sector) address.
Alternatively, described step S02 also comprises:
By bios program, trust authentication is carried out to the request of recovery system,
When being proved to be successful, redirect also performs step S03; When authentication failed, stop this flow process.By implementing the present embodiment, improve the security of System recover.The implementation method of described trust authentication, can be but be not limited only to password confirming.
The software module that the method described in conjunction with embodiment disclosed herein or the step of algorithm can directly use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in any other forms of storage medium known in random access memory, internal memory, ROM (read-only memory), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
Be understandable that, for the person of ordinary skill of the art, other various corresponding change and distortion can be made by technical conceive according to the present invention, and all these change the protection domain that all should belong to the claims in the present invention with distortion.