CN105630622B - A method of hard disk ROM is repaired by Boot Code - Google Patents

A method of hard disk ROM is repaired by Boot Code Download PDF

Info

Publication number
CN105630622B
CN105630622B CN201511025577.9A CN201511025577A CN105630622B CN 105630622 B CN105630622 B CN 105630622B CN 201511025577 A CN201511025577 A CN 201511025577A CN 105630622 B CN105630622 B CN 105630622B
Authority
CN
China
Prior art keywords
rom
hard disk
bootcode
sap
rap
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
CN201511025577.9A
Other languages
Chinese (zh)
Other versions
CN105630622A (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.)
XLY SALVATIONDATA TECHNOLOGY Inc.
Original Assignee
SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd
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 SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd filed Critical SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd
Priority to CN201511025577.9A priority Critical patent/CN105630622B/en
Publication of CN105630622A publication Critical patent/CN105630622A/en
Application granted granted Critical
Publication of CN105630622B publication Critical patent/CN105630622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a kind of methods for repairing hard disk ROM by Boot Code, including below step: S1: reading hard disk ROM by Boot Code mode using faulty disk com port;S2: SAP, RAP, CAP and SHELL data volume in ROM are found, and above-mentioned data volume is covered in adaptation ROM, forms new ROM;S3: by the ROM after adaptation again write-back hard disk.Beneficial effects of the present invention are as follows: repairing hard disk success rate height, reduce because hard disk failure leads to loss brought by loss of data;Compared to the method more safety and stability of scolding tin displacement rom chip.

Description

A method of hard disk ROM is repaired by Boot Code
Technical field
The present invention relates to field of information security technology, in particular to a kind of method that hard disk ROM is repaired by BootCode.
Background technique
With the development of hard-disk capacity and technology, the organizational structure of firmware has occurred that variation.Firmware internal structure is got over Hair is complicated and changeable.Microcode required for hard disk works normally is more and more, needs to be loaded into the firmware content of hard disk cache Also more and more.
In the routine use of Seagate hard disk, since error or version are unstable when guidance code loads in ROM, it may lead Cause can not correctly read firmware area initial address and hard disk section information.Since bad track causes the mistake of firmware, may lead The error of hard disk firmware area is caused, it is serious to lead to not read firmware information, it can not be made to be loaded into caching.
Summary of the invention
The present invention in view of the drawbacks of the prior art, provides a kind of method for repairing hard disk ROM by BootCode, can have Solution the above-mentioned problems of the prior art of effect.
A method of hard disk ROM, including below step are repaired by BootCode:
S1: hard disk ROM is read by BootCode mode using faulty disk com port, the detailed step of the S1 is as follows:
S101: check whether disk C OM mouthfuls connect normally;
S102: judging whether hard disk is under bootcode, if so then execute S103;If not then opening again electric and continuous " U " instruction is sent to hard disk, allows hard disk to enter bootcode, executes S103;
S103: it is offset to address " 0x100000 ";
S104: since the offset address, 512 bytes are read, and the data of return are stored in Buffer1;
S105: judging whether the value that the position 0xAC is deviated in buffer1 is less than " 0x200000 ", if so then execute S106, If guidance file otherwise is written in bootcode, bootcode is initialized;
S106: by the value of the position 0xAC in S105 and " 0xFFFFFF00 " progress " with operation ", acquisition refetches address;
S107: it is offset to and refetches address: by instructing AP " 0x refetches address " to be deviated;
S108: reading refetches 512 bytes behind address, and returned data is stored in buffer2;
S109: the value and " 0xFF " progress " with operation " of the position 0xAC, one word of obtained low level are deviated in buffer1 It saves as the deviation post in Buffer2 for determining 512 stressed bytes;
S110: the content and " 0000C0C1C1810140C30103C00280C2 of 16 byte lengths are taken backward from the position 41 " compare;If equal execution S111, guidance file is modified if unequal can normally read ROM, execute S111;
S111: hard disk is written into guidance file, " 0x401 " is navigated to, inputs 1024 GO, obtain in returned ROM Hold;
S2: SAP, RAP, CAP and SHELL data volume in ROM are found, and above-mentioned data volume is covered in adaptation ROM, shape The ROM of Cheng Xin;
S3: by the ROM after adaptation again write-back hard disk.
Preferably, the detailed step of the S2 is as follows:
S201: the storage location of intracorporal SAP, RAP, CAP and SHELL data volume of ROM data is found;
S202: the size of SAP, RAP, CAP and SHELL data volume is calculated, and is extracted;The calculation method of the size is 4 A byte is one group, rear three bytes of one group of data after SAP, RAP, CAP and SHELL feature subtract SAP, RAP, CAP and The value of three bytes is equal to the size of SAP, RAP, CAP and SHELL data volume after SHELL feature;
S203: looking for a kind of adaptation ROM code of lowest version, finds SAP, RAP, CAP and SHELL data volume of adaptation ROM, Faulty disk SAP, RAP, CAP and SHELL data volume is covered in adaptation ROM, forms new ROM, and by new ROM Write fault Disk.
The detailed step of the S3 is as follows:
S301: check whether disk C OM mouthfuls connect normally;
S302: judging whether hard disk is under bootcode, if so then execute S304;If not then opening again electric and continuous " U " instruction is sent to hard disk, allows hard disk to interrupt it and normally leads into bootcode, re-execute S302;
S304: check ROM integrality: whether the size for judging the ROM is 512kb, if so then execute S305, if not Then indicate that ROM is abnormal, re-executes S203;
S305: positioning to address 0x1000000;
S306: 256 bytes are read since the position and return to buffer3;
S307: it takes 4 bytes to be judged at the 0xAC of buffer3, if it is greater than 0x200000, then modifies write-in Guidance file allow to be normally written execute S308, on the contrary it is then it is not necessary to modify execution S309;
S308: amended guidance file is written at 0x400 in positioning address;
S309: then positioning address starts the write-in of ROM data at 0x401.
Compared with prior art the present invention has the advantages that repairing hard disk success rate height, reduce because hard disk failure causes to count According to loss brought by loss.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention more comprehensible, by the following examples, to the present invention do into One step is described in detail.
A method of hard disk ROM, including below step are repaired by BootCode:
S1: hard disk ROM is read by BootCode mode using faulty disk com port;
S2: SAP, RAP, CAP and SHELL data volume in ROM are found, and above-mentioned data volume is covered in adaptation ROM, shape The ROM of Cheng Xin;
S3: by the ROM after adaptation again write-back hard disk.
The detailed step of the S1 is as follows:
S101: check whether disk C OM mouthfuls connect normally;
S102: judging whether hard disk is under bootcode, (by whether BootCmds can be obtained: character string determines, energy Obtaining then representative is under bootcode), if so then execute S103;If not then opening electricity again and continuously being sent to hard disk " U " instruction allows hard disk to interrupt it and normally leads into bootcode, executes S103;
S103: it is offset to address " 0x100000 ";
S104: since the offset address, 512 bytes are read, and the data of return are stored in Buffer1;
S105: judging whether the value that the position 0xAC is deviated in buffer1 is less than " 0x200000 ", if so then execute S106, If guidance file otherwise is written in bootcode, bootcode is initialized;
S106: by the value of the position 0xAC in S105 and " 0xFFFFFF00 " progress " with operation ", acquisition refetches address;
S107: it is offset to and refetches address: by instructing AP " 0x refetches address " to be deviated;
S108: reading refetches 512 bytes behind address, and returned data is stored in buffer2;
S109: the value and " 0xFF " progress " with operation " of the position 0xAC, one word of obtained low level are deviated in buffer1 It saves as the deviation post in Buffer2 for determining 512 stressed bytes;
S110: the content and " 0000C0C1C1810140C30103C00280C2 of 16 byte lengths are taken backward from the position 41 " compare;If equal execution S111, guidance file is modified if unequal, and (guidance file is at BootCode Read ROM, the file write in advance) ROM can be normally read, execute S111;
S111: hard disk is written into guidance file, " 0x401 " is navigated to, inputs 1024 GO, obtain in returned ROM Hold;
The detailed step of the S2 is as follows:
It should be noted that " XX " that appear below is random number;
S201: the storage location of intracorporal SAP, RAP, CAP and SHELL data volume of ROM data is found;Here SAP is found Storage address there are two types of mode, the first are as follows: look for the head ROM, with 4 bytes for one group, find SAP feature " 05XXXXXX ", RAP feature " 04XXXXXX ", CAP feature " 06XXXXXX " and SHELL feature " 0BXXXXXX ", the value are The head bias feature of SAP, RAP, CAP and SHELL data volume jumps and SAP, RAP, CAP and SHELL data volume head can be obtained Portion position.
Second are as follows: be one group in the head ROM with 4 bytes and retrieved, find the base address SAP, RAP, CAP and SHELL Offsets " 24XXXXXX " are retrieved backward for one group with 4 bytes after being jumped by this feature and find SAP feature " 05XXXXXX ", RAP feature " 04XXXXXX ", CAP feature " 06XXXXXX " and SHELL feature " 0BXXXXXX ".
Such as: the base address SAP feature is " 24000001 ", then " 0x10000 " is exactly SAP base address offset feature, is jumped It is one group after turning with 4 bytes and retrieves " 05866800 " backward,
Obtaining SAP data volume head bias position by " 0x10000 "+" 0x6886 "=" 0x18668 " is “0x18668”。
S202: the size of SAP, RAP, CAP and SHELL data volume is calculated, and is extracted;The calculation method of the size is 4 A byte is one group, rear three bytes of one group of data after SAP, RAP, CAP and SHELL feature subtract SAP, RAP, CAP and The value of three bytes is equal to the size of SAP, RAP, CAP and SHELL data volume after SHELL feature.
Such as SAP feature is that " 05000007 " is followed by RAP feature " 06005007 ", then passing through " 0x075000 "-" 0x070000 " obtains SAP data volume size.
S203: looking for a kind of lowest version (lowest version relative to current ROM) ROM code of adaptation, finds adaptation ROM's SAP, RAP, CAP and SHELL data volume cover faulty disk SAP, RAP, CAP and SHELL data volume in adaptation ROM, composition New ROM, and by new ROM Write fault disk.
The detailed step of the S3 is as follows:
S301: check whether disk C OM mouthfuls connect normally;
S302: judging whether hard disk is under bootcode, (by whether BootCmds can be obtained: character string determines, energy Obtaining then representative is under bootcode).If so then execute S304;If not then opening electricity again and continuously being sent to hard disk " U " instruction, allows hard disk to interrupt it and normally leads into bootcode, re-execute S302;
S304: check ROM integrality: whether the size for judging the ROM is 512kb, if so then execute S305, if not Then indicate that ROM is abnormal, returns to S203;
S305: positioning to address 0x1000000;
S306: 256 bytes are read since the position and return to buffer3;
S307: it takes 4 bytes to be judged at the 0xAC of buffer3, if it is greater than 0x200000, then modifies write-in Guidance file allow to be normally written execute S308, on the contrary it is then it is not necessary to modify execution S309;
S308: amended guidance file is written at 0x400 in positioning address;
S309: then positioning address starts the write-in of ROM data at 0x401.
Those of ordinary skill in the art will understand that the embodiments described herein, which is to help reader, understands this hair Bright implementation method, it should be understood that protection scope of the present invention is not limited to such specific embodiments and embodiments.Ability The those of ordinary skill in domain disclosed the technical disclosures can make its various for not departing from essence of the invention according to the present invention Its various specific variations and combinations, these variations and combinations are still within the scope of the present invention.

Claims (3)

1. a kind of method for repairing hard disk ROM by BootCode, including below step:
S1: hard disk ROM is read by BootCode mode using faulty disk com port, the detailed step of the S1 is as follows:
S101: check whether disk C OM mouthfuls connect normally;
S102: judging whether hard disk is under BootCode, if so then execute S103;If not then open again electricity and continuously to Hard disk sends " U " instruction, and hard disk is allowed to enter BootCode, executes S103;
S103: it is offset to address " 0x100000 ";
S104: since the offset address, 512 bytes are read, and the data of return are stored in buffer1;
S105: judging whether the value that the position 0xAC is deviated in buffer1 is less than " 0x200000 ", if so then execute S106, if not Guidance file then is written in BootCode, initializes BootCode;
S106: by the value of the position 0xAC in S105 and " 0xFFFFFF00 " progress " with operation ", acquisition refetches address;
S107: it is offset to and refetches address: by instructing AP " 0x refetches address " to be deviated;
S108: reading refetches 512 bytes behind address, and returned data is stored in buffer2;
S109: the value and " 0xFF " progress " with operation " of the position 0xAC are deviated in buffer1, one byte of obtained low level is made For the deviation post in buffer2 for determining 512 stressed bytes;
S110: the content of 16 byte lengths and " 0000C0C1C1810140C30103C00280C241 " is taken to compare backward from the position Compared with;If equal execution S111, guidance file is modified if unequal can normally read ROM, execute S111;
S111: hard disk is written into guidance file, " 0x401 " is navigated to, inputs 1024 GO, obtain returned ROM content;
S2: SAP, RAP, CAP and SHELL data volume in ROM are found, and above-mentioned data volume is covered in adaptation ROM, is formed new ROM;
S3: by the ROM after adaptation again write-back hard disk.
2. a kind of method for repairing hard disk ROM by BootCode according to claim 1, it is characterised in that the S2's Detailed step is as follows:
S201: the storage location of intracorporal SAP, RAP, CAP and SHELL data volume of ROM data is found;
S202: the size of SAP, RAP, CAP and SHELL data volume is calculated, and is extracted;The calculation method of the size is 4 words Section is one group, and rear three bytes of one group of data after SAP, RAP, CAP and SHELL feature subtract SAP, RAP, CAP and SHELL The value of three bytes is equal to the size of SAP, RAP, CAP and SHELL data volume after feature;
S203: looking for a kind of adaptation ROM code of lowest version, finds SAP, RAP, CAP and SHELL data volume of adaptation ROM, by event Barrier disk SAP, RAP, CAP and SHELL data volume covers in adaptation ROM, forms new ROM, and by new ROM Write fault disk.
3. a kind of method for repairing hard disk ROM by BootCode according to claim 2, it is characterised in that the S3's Detailed step is as follows:
S301: check whether disk C OM mouthfuls connect normally;
S302: judging whether hard disk is under BootCode, if so then execute S304;If not then open again electricity and continuously to Hard disk sends " U " instruction, allows hard disk to interrupt it and normally leads into BootCode, re-executes S302;
S304: check ROM integrality: whether the size for judging the ROM is 512kb, if so then execute S305, if not then table Show that ROM is abnormal, re-executes S203;
S305: positioning to address 0x1000000;
S306: 256 bytes are read since the position and return to buffer3;
S307: taking 4 bytes to be judged at the 0xAC of buffer3, if it is greater than 0x200000, then modifies the guidance of write-in File allow to be normally written execute S308, on the contrary it is then it is not necessary to modify execution S309;
S308: amended guidance file is written at 0x400 in positioning address;
S309: then positioning address starts the write-in of ROM data at 0x401.
CN201511025577.9A 2015-12-30 2015-12-30 A method of hard disk ROM is repaired by Boot Code Active CN105630622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511025577.9A CN105630622B (en) 2015-12-30 2015-12-30 A method of hard disk ROM is repaired by Boot Code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511025577.9A CN105630622B (en) 2015-12-30 2015-12-30 A method of hard disk ROM is repaired by Boot Code

Publications (2)

Publication Number Publication Date
CN105630622A CN105630622A (en) 2016-06-01
CN105630622B true CN105630622B (en) 2019-04-23

Family

ID=56045599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511025577.9A Active CN105630622B (en) 2015-12-30 2015-12-30 A method of hard disk ROM is repaired by Boot Code

Country Status (1)

Country Link
CN (1) CN105630622B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107507631B (en) * 2017-08-29 2019-07-09 四川巧夺天工信息安全智能设备有限公司 A method of improving the magnetic head read or write speed of Seagate hard disk
CN107967433B (en) * 2017-12-25 2021-03-30 四川巧夺天工信息安全智能设备有限公司 Method for releasing Seagate hard disk motor lock
CN111694763B (en) * 2020-05-29 2022-11-08 四川效率源信息安全技术股份有限公司 Method for accessing failed INTEL solid state disk

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887351A (en) * 2010-06-22 2010-11-17 杭州华三通信技术有限公司 Fault-tolerance method and system for redundant array of independent disk

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100625811B1 (en) * 2005-12-09 2006-09-18 엠텍비젼 주식회사 Method and apparatus for correcting code data error

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887351A (en) * 2010-06-22 2010-11-17 杭州华三通信技术有限公司 Fault-tolerance method and system for redundant array of independent disk

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
希捷硬盘ROM损坏企业级raid数据恢复案例及方法;佚名;《http://www.intohard.com/article-629-1.html》;20150629;第1-4页
效率源全新技术:屏蔽硬盘损坏磁头以提取数据;佚名;《效率源科技》;20151123;第1-2页

Also Published As

Publication number Publication date
CN105630622A (en) 2016-06-01

Similar Documents

Publication Publication Date Title
CN105630622B (en) A method of hard disk ROM is repaired by Boot Code
US7743424B2 (en) Method for protecting data in a hard disk
JP6342339B2 (en) Electronic device, MBR restoration method, and computer-readable recording medium
US9817725B2 (en) Flash memory controller, data storage device, and flash memory control method with volatile storage restoration
CN100375049C (en) Method for recoverying basic inputting and outputting system chip
US9690642B2 (en) Salvaging event trace information in power loss interruption scenarios
CN105893178A (en) Data backup method for mobile hard disk
JP2015508929A5 (en)
CN103810421A (en) Application program verification method and device and terminal device
CN107315616A (en) A kind of loading method of firmware, device and electronic equipment
CN108170495A (en) A kind of BIOS upgrade methods, system, equipment and computer readable storage medium
CN106650464A (en) Security detection method and terminal
CN103594120A (en) Memorizer error correction method adopting reading to replace writing
WO2017143843A1 (en) Metadata recovery method and device
CN109426440A (en) The data store system and method for non-volatile memory
CN106325916A (en) System upgrading method of GNSS (Global Navigation Satellite System) receiver
CN104751062A (en) Method and device improving operation system reliability
KR101999617B1 (en) Electronic apparatus, method for restore of guid partition table and computer-readable recording medium
CN105808385A (en) Anti-loss method of hard disk data
CN105321534B (en) A kind of method for changing Seagate hard disc magnetic head bitmap
CN107957921B (en) Wear-balanced intelligent card power-down data protection method
CN106372538A (en) Firmware protection method based on SoC (System on Chip)
CN106648969A (en) Method and system for inspecting damaged data in disk
CN109857708A (en) A kind of data access method and computer readable storage medium of embedded system
CN106354680A (en) Method and device for quickly recognizing removable storage equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: No. 183 Songshan Road, Neijiang, Sichuan, Sichuan

Patentee after: Sichuan Miwu Traceless Science and Technology Co.,Ltd.

Address before: No. 183 Songshan Road, Neijiang, Sichuan, Sichuan

Patentee before: SICHUAN MWH INFORMATION SECURITY TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211019

Address after: 641100 No.1 Hanyu Avenue, Shizhong District, Neijiang City, Sichuan Province

Patentee after: XLY SALVATIONDATA TECHNOLOGY Inc.

Address before: No. 183 Songshan Road, Neijiang, Sichuan, Sichuan

Patentee before: Sichuan Miwu Traceless Science and Technology Co.,Ltd.