A kind of method removing the non-resident defect map of Seagate hard disk
Technical field
The present invention relates to field of information security technology, particularly a kind of method removing the non-resident defect map of Seagate hard disk.
Background technology
The front good rear bad fault of Seagate hard disk always is a difficult problem of data industry, and the probability that this fault occurs is very high, and is difficult to repair.The reason gone wrong be disk occur capacity be 0 and BUSY after, compiler must be rebuild to deal with problems, but cause the compiler rebuild not mate with original section because defect map itself exists fault, cause sector scanning before data field to read normal, reading all cannot be scanned in the sector of rear section.
Core ensures that compiler and original section match, and defect map full scale clearance must be rebuild compiler again.But currently available technology is removed slowly, and need each strip defect all will read one by one, time repair time is long.
Summary of the invention
The present invention is directed to the defect of prior art, provide a kind of method removing the non-resident defect map of Seagate hard disk, effectively can solve above-mentioned prior art Problems existing.
In order to realize above goal of the invention, the technical scheme that the present invention takes is as follows:
Remove a method for the non-resident defect map of Seagate hard disk, comprise the following steps:
S1: connect hard disk entry instruction pattern, enter T level pattern, and check whether in T level pattern, if T level then performs S2, otherwise terminates;
S2: check under T level pattern and whether also have non-resident property G to show defect, if there is execution S3, otherwise to terminate;
S3: judge under T level pattern whether this dish supports that obtaining non-resident property G shows, if support, the instruction of choice for use T level should obtain non-resident property G and show, execution S4.Otherwise use the instruction of A level to obtain non-resident property G to show to perform S5;
S4:T level mode: obtain non-resident property G table address and size under T level pattern, performs S6;
S5:A level mode: the address looking for non-resident property G to show under A level pattern and size, in cache contents and the appointment size of 1 grade of pattern acquiring non-resident property G table, performs S6;
S6: obtain total entry number that non-resident property G shows;
S7: remove entry number.
Compared with prior art the invention has the advantages that: T level and A level two kinds of different modes can be used to obtain non-resident property G and show information, the address that accurate discovery non-resident property G shows and size, the defect entries number directly removing non-resident defect map reaches the object directly removing non-resident defect list; Save time cost, and faster and better reaching recovers data object, and reparation hard disk efficiency is high.
Embodiment
For making object of the present invention, technical scheme and advantage clearly understand, by the following examples, the present invention is described in further details.
Remove a method for the non-resident defect map of Seagate hard disk, comprise the following steps:
S1: connect hard disk entry instruction pattern, enter T level pattern, and check whether in T level pattern, if T level then performs S2, otherwise terminates;
Call function:
UART0_Sendchar (0x1A); // entry instruction pattern
IRQ_READ_UART0 (); // read data to buffer
CheckT (); // detect whether buffer data are T>
S2: check under T level pattern and whether also have non-resident property G to show defect, if there is execution S3, otherwise to terminate;
Call function:
UART0_SendBuf("V40");
S3: judge under T level pattern whether this dish supports that obtaining non-resident property G shows, if support, the instruction of choice for use T level should obtain non-resident property G and show, execution S4.Otherwise use the instruction of A level to obtain non-resident property G to show to perform S5;
Call function:
S4:T level mode: obtain non-resident property G table address and size under T level pattern, performs S6;
Call function:
UART0_Sendchar(0x1A);
UART0_SendBuf("r35,3,0");
S5:A level mode: the address looking for non-resident property G to show under A level pattern and size, in cache contents and the appointment size of 1 grade of pattern acquiring non-resident property G table, performs S6.
Call function:
UART0_SendBuf("/A");
UART0_SendBuf (" R (non-resident property G table address), 100,20 ");
UART0_SendBuf("/1");
UART0_SendBuf (" D buffer address,, 800,1 ")
S6: obtain total entry number that non-resident property G shows, obtains the cache contents that S5 obtains, and extracts the byte content of Offest0x00 ~ 0x03 in cache contents;
S7: remove entry number, null value is write in the address of entry sum and cover.
The above-mentioned function called is by following codes implement:
Those of ordinary skill in the art will appreciate that, embodiment described here is to help reader understanding's implementation method of the present invention, should be understood to that protection scope of the present invention is not limited to so special statement and embodiment.Those of ordinary skill in the art can make various other various concrete distortion and combination of not departing from essence of the present invention according to these technology enlightenment disclosed by the invention, and these distortion and combination are still in protection scope of the present invention.