IMPROVED ERROR CORRECTION SYSTEM

Abstract: An improved method for storing and retrieving digital data. Error detection codes are used in the prior art to identify bad sectors. In this improved method, sectors are collected into groups and one sector per group is reserved for error correction information. The information in this sector is computed in such a way that the information in any sector in the group may be computed from the other sectors. Thus, any bad sector may be recovered. To reduce likelihood of losing two sectors from the same group, groups are allocated in such a way that no group contains two adjacent sectors.

Description: BACKGROUND OF THE INVENTION IMPROVED ERROR CORRECTION SYSTEM Field of the Invention This invention is for the digital encoding of information to provide improved error correction system. Prior Art Because devices that rely on digital data cannot usually tolerate errors, a great deal of attention has been given- to the problem of error detection and correction. In the prior art, correction is usually limited to one or two bits - at most a relatively short burst - while detection is 100% accurate for multiple bursts and better than 99.99% accurate for arbitrary random errors. (Peterson, Wesley, and Weldon, See Error-Correcting -Codes, 2nd ed. , by Camb¬ ridge, MA, M.I.T. Press, 1972) . The only prior art system for dealing with gross errors involves keeping multiple copies of sensitive data on separate media. This method allows for relatively easy recovery even from total destruction of a medium, but is very expensive. In the past, there is usually no provision for convenient partial recovery, so loss of more than a few bits is equivalent to loss of an entire medium. A company's critical data in the past could not survive a single pin¬ prick. One obvious example of the inadequacy of prior art error correction is the flexible disk cartridge or "floppy disk." These storage media are extremely popular because they provide cheap mass storage, but they are very vulner¬ able to errors resulting from normal use. Essentially, any error resulting from improper handling or even old age causes complete loss of the medium and all data stored on it. (See "Floppy Disks: Technological Boon, but So Deli- ,.ΩsτsτJ-rε SH£ET OMPI cate." New York Times, SUMMARY OF THE INVENTION The present invention introduces a practical scheme for correcting errors on the same scale at which they are detected. The medium is divided into sectors for the pur¬ pose of error detection. As in the prior art, each sector contains sufficient additional information to correct all common errors and detect more than 99.99% of all possible errors. In view of the new and improved error correction system, the prior art corrections will appear trivial to one skilled in the art. Unique to this invention, sectors are collected into groups for the purpose of error correction. One sector in each group is reserved for error correction purposes. The contents of this sector are computed from the other sectors ' in such a way that the contents of any sector in the group may be computed from the other sectors. This is most easily accomplished with the exclusive-or function. Upon detection of an error too large to recover by the methods of the prior art, the contents of the affected sector are completely recovered from the other sectors in the group, provided that the error affected no more than one sector in the group. To avoid the problem of a small error occurring at the junction of two sectors, groups are selec- ted in such a way that no two sectors from the same group are physically adjacent. This scheme greatly improves the situation with the floppy disk because most errors from handling and age tend to be localized to one or two sectors, but such errors are easily corrected with the invented system. It is an object of this invention to provide an SUBST2TU7E SHEET error correction method for digital data on a recording medium that retrieves lost data in an entire sector of data recorded in sectors where the sectors are arranged in groups, It is an object of this invention to provide large-scale error correction for digital data stored on media that tend to fail in sectors as opposed to just losing a bit or two. It is another object of this invention to detect the loss of any two sectors in which losses cannot be re- covered. It is another object of this invention to recover from a single error at the junction of two sectors by col¬ lecting sectors into nonadjacent groups that are corrected independently. It is another object of this invention to provide an error correction method where the data is recorded in sectors where the sectors are arranged in groups and no group data is contained in two adjacent sectors. A further object of this invention is to provide an error correction method where the data is recorded in sectors where the sectors are arranged in groups and where an error correction sector is provided for each group. A further object of this invention is to provide an error correction method where the data is recorded in sectors where the sectors are arranged in groups and where an error correction sector is provided for each group and no group data is contained in two adjacent sectors whereby lost data is retrievable. An additional object of this invention is to provide data in the error correction sector for one group from computation of data in other sectors of the same group in such a way that the contents of any sector in the group * ' may be computed from the other sectors in the same group. In accordance with these and other objects which will be apparent hereinafter, the instant invention will now be described with particular reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 illustrates generalized operating system software for input/output purposes. Figure 2 illustrates the geometry of Xerox 820 disk with recovery sectoring. Figure 3 illustrates the structure of internal buffers for Xerox 820. Figure 4 illustrates the geometry of 1MB PC disk with recovery sectoring. Figure 5 illustrates the geometry of IBM. PC disk with recovery sectoring and tracking. Figure 6 illustrates the geometry of half-inch magnetic tape with recovery blocking. Figure 7 illustrates record using XOR computation for correction. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The implementation of this Operating System Soft¬ ware is somewhat dependent on the physical geometry of the medium employed. Details of four different implementations are described herein. It will be apparent to one skilled in the art that the described inventive concepts may be employ¬ ed to direct the operation of any medium with any geometry whatsoever and that the invention may be implemented in hardware, software, or a combination ' of hardware and soft- ware. Referring now to Figure 1 which illustrates the basic structure of the I/O portion, the input/output portion ' i Έ SHEET ' of Operating System Software. User routines 10 submit high- level requests to the file manager 12. The file manager translates these requests to logical block requests which it then submits to a device driver 14, 14', etc. Each device driver translates logical block requests to physical requests, which it makes by directly accessing the media 16, 16 ' , etc., and 18, 18', etc., it serves. The file manager 12 is a high-level component of the operating system and handles a wide variety of mass- storage devices without any concern about their physical structure. There is only one file manager in any given operating system, and all mass-storage I/O requests go through it. Device drivers 14, 14' are low-level components of the operating system which direct the physical process of Storing and retrieving data on the devices they serve. There is a different device driver for each type of mass- storage device, although one device driver usually handles all the devices of a particular type. The invented system software represents a substan¬ tial improvement over the device drivers used in the prior - art; there is no change whatsoever in the file manager or the user software. It will be apparent to one skilled in the art that these device drivers may be implemented in either hardware or software. The implementation on the Xerox 820 operates under the CP/M operating system and consists of a replacement of the device driver for the eight-inch floppy disks, shown in Figure 2. This implementation illustrates the full power of the invention and is completely transparent to CP/M users and programmers. It is the preferred implementation. These are the physical specifications of the __» * ****. * "* __, ,-_,_-_&—1 « eight-inch diskettes on the Xerox 820 used in this imple¬ mentation: - Two 8-inch disk drivers, IBM 3740 format. 77 tracks per disk (.single-sided) , numbered 0 to 76. 26 sectors per tracks, numbered 1 to 26. 128 bytes per sector (single-density, FM recording) . 256,256 bytes per disk (77x26x128). - 512,512 total bytes (256,256x2). Track zero 22 contains the bootstrap, and tracks one and two 24 are reserved for the operating system; the remainder of the disk is available for user data. The protection of the invented software is not extended to the three system tracks because failure in the system tracks on any disk can be surmounted simply by booting the system from any underaged disk and then switching disks. This works because the system area is exactly the same on all disks. The IBM PC implementation (below) describes a method for extending protection to the system area when it is necessary to do so. Figure 2 illustrates the allocation of sectors in the area protected by the invented system. Odd numbered sectors comprise the odd group; even numbered sectors com- prise the even group. User data are stored in sectors stored in sectors 1-22; error correction information is stored in sectors 23 (for the odd group) and 24 (for the even group) . In the sector preamble, the "DELETED" field can contain "NOT-DELETED," "DEL 1," or "DEL 2." On a per- feet disk, all sectors are "NOT DELETED." The principle of the error recovery plan is as follows: Each of the ECC sectors always contains the bit- SUSSTΓ ru un i SHEET - / ^' ' X / . O PI wise logical exclusive-or (XOR) of all the data sectors in its group; write operations always guarantee this. Whenever a read error is detected (.using the methods of the prior art) , the data in the failing sector are recovered simply by computing the XOR of the remaining data sectors and the ECC sector. This cannot recover from the loss of two sectors, but the physical geometry of the disk guarantees that an error at the junction of two sectors will not affect two sectors in the same group unless that error is very large. Referring to Figure 3, there are thirteen internal buffers 26 used for I/O operations. Each buffer consists of a data area 28 and a status word 30. Initially, all status words for all buffers are zero. At any given time, the internal buffers contain all the data in all the sectors from a particular group. Whenever an I/O operation (either read or write) affects data from another group, the invented system first updates the current group according to value of the MODIFIED flag. If the MODIFIED flag is set, the data field of that sector is written with the data in the buffer. The ECC sector differs slightly from the rest in that it is always recom¬ puted before it is written to guarantee that it is up to date. If the attempt to write a sector fails, the system will retry up to ten times, after which the sector is con¬ sidered defective and is deleted. This is what the DELETED field in the sector preamble is for, but the preamble of a damaged sector is not a safe place to put such information. Accordingly, when a sector is deleted, a "one" is written in the DELETED field of the sector 14 sectors ahead on the disk and a "two" is written in the DELETED field of the sector 21 S t ι*~~€i' "°~' t *~ " : --' c ?---__-___T ' χ & ET(r OMPI sectors ahead. The reason for using two marks for one bad sector is that the decay of floppy disks is notoriously unpredictable; it is possible that a sector that failed one day may work on another day. Were only one DELETED field used and were the sector containing the DELETED field to fail and the originally bad sector to read correctly, the system would see only one error and would incorrectly re¬ construct the failing sector. The use of two DELETED flags guarantees that the system will correctly report a failure to read in such a case. Once the old group has been properly updated, the system seeks to the appropriate track, reads the data from all the sectors in the group into the internal buffers, and sets all the MODIFIED flags to zero. The data in the inter- nal buffer corresponding to the ECC sector is checked by XORing it with the data in the other sectors. If the result is not zero, the MODIFIED flag is set on the ECC sector to ensure that it is corrected. This guarantees that any disagreement between the ECC sector and the Data Sectors is resolved in favor of the Data Sectors. If any single Data Sector could not be read after ten attempts, then the data in the failed sector are recovered- by XORing the ECC with the remaining sectors. If more than one sector cannot be read, then their data cannot be recovered and a "hard" read error is signaled. If the DELETED field of the preamble of one or more data sectors indicates that a sector has been deleted according to the scheme described above, then that sector is treated exactly as though it could not be read at all, regardless of whether any attempt to read it succeeded. At this point, the system honors read requests simply by copying data from the .buffers to the file manager. SUBSTΓΓU ! T T * Eϋ* SHEET ■ Write requests are done by copying data from the file mana¬ ger to the buffers and setting the MODIFIED flag on the affected buffers and the ECC buffer. This completes the description. Referring now to Figure 4, the implementation for the IBM PC 30 is simpler than that for the Xerox 820 in that the IBM PC implementation is intended for use on distributed products that never perform "write" operations. The princi¬ pal complication is that the system tracks must be protected because the copy protection system prevents the user from booting with one disk and running on another. Currently, we have implemented this in our Word Challenge product, which will ship as soon as this patent is filed. The remainder of this description will discuss the Word Challenge implementatio although it will be apparent to one skilled in the art that the same implementation will handle any such product for the IBM PC. These are the physical specifications of the five- and-one-quarter-inch floppy disks shown in Figure 4 and used on the IBM PC in this implementation: One 5-1/4 inch disk drive, IBM 3740 format. 40 tracks per disk (single-sided) , numbered 0 to 39. 10 sectors per track, numbered 1 to 10. - 512 bytes per sector (double-density, MFM recording) . 204,800 total bytes (40x10x512). Track zero contains the bootstrap, the data are stored in tracks one through 24, and the program/operating system is stored in tracks 25 through 33. Figure 4 illustrates the allocation of sectors in the area protected by the invented system. As in the SUΘSTST-JT2 " SHEET - Xerox 820 implementation, odd numbered sectors comprise the odd group; even numbered sectors comprise the even group. Data are stored in sectors 1-8; error correction information is stored in sectors 9 (for the odd group) and 10 (for the even group) . Because the disk is assumed to be write pro¬ tected, the "DELETED" field in the sector preamble is not used. The principle of the error recovery plan is basically the same as with the Xerox 820; read errors on data sectors are recovered by XORing the surviving data sectors with the ECC sector. The principal difference is that the IBM PC implementation does not allow the disk to be written; a special manufacturing program that is not distributed produces the disks which are sent to the customer and never modified. A special technique is used to allow recovery from errors occurring on the boot track. The bootstrap is a short program which resides in sector one of track zero and which is read in automatically whenever the IBM PC is star¬ ted up. Because the boot block is read in by the ROMs already in the IBM PC, the above described inventive concepts cannot be used for this purpose. However, these ROMs will detect failure, using the methods of the prior art, and will attempt three times to read the boot block before giving up. Therefore, the manufacturing program writes multiple copies of the bootstrap in track zero and numbers then all sector one. Since the ROMs find sector one by reading the sector header, this technique causes the ROMs to try reading three different copies of the boot block instead of trying to read the same one three times. This system will always recover from any single error in the boot track, so it offers pro¬ tection as good as the invented system, although it wastes the entire boot track. However, the boot track is reserved 5 'ώ_»iiiϋli ≥Jfl-iώ.I / . O MPI anyway, so this is not a real problem. The bootstrap reads in the main program and oper¬ ating system using the invented system to correct errors, and the main program uses the invented system to read its data. Because the invented system need only read in this implementation, its operation is much simpler and goes as follows: Upon receipt of a read request, the invented system seeks to the appropriate track and attempts to read the requested sector into an internal buffer. If that attempt succeeds, no further processing is done. If that attempt fails, the invented system attempts to read all the remaining sectors in the same group as the failing sector and computes their XOR into a second buffer. If it succeeds in this, the second buffer contains the data that was in the failing sector and the invented system returns that to the file manager. Because the sectors in each group alternate about the disk, the invented system can easily accomplish this while the disk rotates only once. If it fails to read any of the other sectors in the group, the invented system records which sectors it still needs to read. By the time every sector ' in the group has been tried once, the disk rotated around to the original sector again and the invented system tries again to read it. If that succeeds this time, it simply returns that data. If it fails again, the inven¬ ted system goes around the disk again and tries to read the sectors that failed the time before. If ten spins of the disk do not suffice, the system performs a disk reset and repeats the cycle. After ten disk resets, the system admits defeat and reports to the user that the- disk is defective. The immense number of retrys are justified by the fact that the owner of the diskette cannot make a copy of it, so any error that cannot be recovered results in an irrevocable loss. It will be apparent to one skilled in the art that both of the previous two implementations are vulnerable to " an error that arcs along the same track for more than one sector. Such errors seem to be quite rare on floppy disks, but a proposed modification for the IBM PC would handle those errors as well. Using the same hardware as before, the invented system divides the sectors into two groups 40 as shown in Figure 5 the same as before. In addition, it divides the tracks (excluding track zero) into three groups 42 of thir¬ teen tracks, called zero, one, and two, based on the remain— der obtained when dividing the track number by three as shown in Figure 5. The innermost three tracks, (Nos. 37, 38, and 39) are used for error correction by writing track 37 with the logical XOR of the one group, track 38 with the XOR of the two group, and track 39 with the XOR of the three group. Read errors are recovered exactly as before, except that after ten disk spins have failed to recover the data in a track, an attempt is made to recover the missing blocks by XORing the other tracks in the same track group with the ECC track. Ten attempts can be made on each track, but only those sectors corresponding to those missing on the original track need to be read to accomplish error recovery. Only if every track fails on ten tries is the error unrecov¬ erable. The invented system can be implemented on half- inch magnetic tape 50 in the following manner as shown in Figure 6. Block the data 2050 bytes to the record. (It Sϋ_337.7ϋ7_i SHEET will be apparent to one skilled in the art that the specific numbers in this section may be modified considerably. ) Write the record number, starting with zero at the beginning of the tape, in the first two bytes and write the data in the other 2048. Collect the records into groups of sixteen, using the data field of the sixteenth record to contain the XOR of the other fifteen. Finally, interleave the groups such that each successive group element follows the previous one by sixteen records (see Figure 5) . On rereading the tape, -the invented system keeps a running XOR for each group, starting -over again every 256 records. Errors are detected by prior art methods. Any error of less than sixteen consecutive records out of every 256 is easily recovered by spacing over the bad section. Because the record number is stored in each record, the invented system can tell exactly which records were missed and make a note of them. If any lost record belongs to a group that has already lost a record, no recovery is possible. When the 256 record set is complete, the contents of the lost records will be stored in their respective buffers. An illustration of XOR where XOR is 1 for odd numbers of l's and XOR is 0 for even numbers of l's. Word 1 110101 Word 2 101000 Data Word 3 011011 Data and ECC GCC Word 000110 XOR 000000 Total XOR (always zero) If first word is lost, recovery by XORing 2, 3, and ECC. S SUW3Ϊ3S- T1TJ Word 2 101000 Word 3 011011 ECC 000110 Word 4 110101 XOR The instant invention has been shown and described herein in what is considered to be the most practical and preferred embodiment. It is recognized, however, that departures may be made therefrom within the scope of the invention and that obvious modifications may occur to a person skilled in the art. SUBSTITUTE SHEET f , Q MPI

Claims: What I Claim is: 1. A method of storage of digital data on a recording medium and providing retrievable stored digital data for error correction comprising the steps of: dividing the recording medium into sectors; arranging said sectors into groups; providing one error correction sector in each group for error correction data purposes; computing and storing the contents of said error correction sector in each group from the sectors in the same group by the bit-wise logical ex- clusive-or of all the data sectors in its group. 2. A method of storage of digital data as set forth in Claim 1, including: positioning said sectors of each group apart from one another to avoid sector junction error in the same group; whereby gross error corrections are possible. 3. A method of retrieving storaged digital data on a recording medium that includes digital data in sectors positioned in groups and including an error correction sector for each groups with bit-wise logical exlusive-or of all the data sectors in its group comprising: said recording medium; providing a device drive for said recording medium; detecting an error in said recording medium; recovering the data in a failing sector by computing the XOR of the remaining data sectors and the error correction sector; whereby loss of an entire sector may be recorded. 4. A method as set forth in Claim 3, wherein: said recorded sector data in a group is spaced from a SUSST.T 7 SH • ( - oy - 1 sector of data in the same group to prevent loss of data due to a single error at the junction of two sectors adjacent sectors. 5. A method as set forth in Claim 4, wherein: a detecting loss of any two sectors in which losses cannot be recovered. 6. A record of data comprising: a plurality of sectors of recorded data; said sectors grouped into at least two groups; said groups of sectors positioned from unlike groups to avoid like groups from being positioned ad¬ jacent one another; at least one error correction sector for each group of sectors; and XOR data correction means to provide gross data correction. SUSSTϊT S SHEET • OMH

Inventors: HULLENDER GREGORY N, YIANILOS PETER N, HULLENDER, GREGORY, N., YIANILOS, PETER, N.
Applicants: HULLENDER GREGORY N, YIANILOS PETER N, HULLENDER, GREGORY, N., YIANILOS, PETER, N.
Application year: 1983
Main classification: G06F11
IPC codes: G11B20