Abstract:
An improved method of managing media defects in disk drives keeps an operating list of the tracks in the disk drive, and for each track enters on the list the number of good sectors (i.e., those free of defects) in that track. Thus the information on the operating list is sufficient for the disk drive microprocessor to avoid use of the defective sectors, each of which is labelled in its header as being defective. This method is compatible with SCSI and other common disk drive interfaces.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to information storage systems, and in particular to a method for the management of storage media defects in disk drives. 
     2. Description of the Prior Art 
     Media are commonly used for storage of information in data processing. Examples of such media are magnetic disks and tapes. An increase in the media storage capacity per unit of area tends to increase the occurrence of defects in the media. Defects are flaws in the media that make portions of the media unusable, and are the result of imperfections in the media manufacturing process. 
     As the storage capability of bulk storage media is increased, it is more difficult to manufacture defect-free storage media devices, and it becomes costly to scrap flawed media. Thus a method is needed to permit the use of storage media having flawed sections. 
     In U.S. Pat. No. 4,498,146, issued Feb. 5, 1985, Martinez discloses a typical prior art method for avoiding accessing defective locations in storage media. A table of addresses of defective locations is first constructed. When an address is obtained for accessing a location in the storage medium, the contents of the address table are read to determine if access to the media will be impacted by defective locations, and the address is modified to avoid usage of defective locations. The storage location designated by the modified address is then accessed. If none of the defective locations impact the access, the storage location designated by the obtained address is accessed. The above process is carried out during execution of the operation for whose execution the address was obtained. The essence of the prior art therefore is keeping a complete list having a separate entry for each of the defective (i.e., &#34;bad&#34;) storage locations on the media of a disk drive. 
     The address table comprises an ordered list of the addresses of defective locations. The obtained address is a logical address, while the modified address is a physical address. Contents of the table are read to determine the number of defective locations that affect the access, and the logical address is translated into the physical address by using the determined number of defective locations in the translation. 
     A typical prior art disk drive 10 is shown in FIG. 1. Disk drive 10 includes disks 53 which are the magnetic storage media. A drive motor 51 spins the disks 53 past read and write heads 57 which access selected portions of the disks 53 for data storage and retrieval. Motion of the heads 57 and selection of one or more particular heads are performed by head positioning and selecting circuitry 52, which operates under control of disk microprocessor 12. 
     As shown in FIG. 1, there are a plurality of disks 53. Each disk 53 has one head 57 associated therewith. The surface of each disk 53 is divided into a plurality of circular concentric tracks 54. In this case, only one surface (i.e., side) of each disk 53 is in use. It is well known to use both surfaces of each disk 53 for recording, by providing a head for each surface. Tracks 54 on all of the disks 53 which lie the same radial distance away from the centers of the disks 53 logically form a cylindrical surface referred to as a cylinder 55. Thus each track 54 of each disk 53 lies in a unique cylinder 55. Each track 54 is furthermore logically subdivided into a plurality of segments or areas, typically referred to as sectors or blocks 56. Disk drive 10 including microprocessor 12 and RAM (Random Access Memory) associated with microprocessor 12 is connected to host computer 15 by means of disk controller 17. 
     The cylinders 55, tracks 54, and sectors 56 are used to define graduations in the size of storage locations of the disk drive 10. Hence, addressing within the disk drive 10 is accomplished by specifying a head 57, to select one of the disks 53, a cylinder 55, to select a particular track 54 on each disk 53, and a sector 56 to select a data block. 
     Prior to providing the disk drive 10 to the user, the manufacturer of the disk drive 10 tests it for defects. The manufacturer&#39;s specifications for the particular disk drive type include the maximum number of defects that the disk drive 10 is allowed to have. If the specified maximum number of defects is not exceeded, the disk drive 10 is considered to be usable. The manufacturer supplies with the disk drive 10 information about the disk drive 10 which includes the sites of the defects in the disk drive 10. The manufacturer typically stores this information in a defect table (further described below) which is located on a particular reserved track 54 (see FIG. 1) of one of the disks 53. 
     Each sector 56 includes conventionally a header area (not shown) at the beginning of the sector 56. The header area includes a place for the sector address. As part of the formatting of the disk drive 10 (either at the factory or by the user), a sector address is written in each sector header area. Bad (i.e., flawed) sectors are typically identified and the defect list is constructed accordingly by specialized testing equipment by the disk drive manufacturer. Some disk drive interface standards (such as SCSI) also include means to detect and list defective sectors when the disk drive is in operation by the user. 
     FIG. 2A shows a typical track &#34;n&#34; with physical sector numbers (i.e., physical addresses) N, N+1, N+2, . . . N+7; physical sector number N corresponds to logical block number (i.e., logical address) N*. Physical sector number N+1 is a bad sector, and so does not correspond to any logical block number. Physical sector number N+2 corresponds to logical block number N*+1, etc, and physical sector number N+4 is also a bad sector and so does not correspond to any logical block number. 
     The above description applies to various kinds of storage devices including magnetic recording disk drives (both floppy and hard disk drives) and optical recording disk drives. 
     Thus in the prior art, a disk drive uses manufacturer-provided information about the location of defects to construct a sequentially ordered defects list of addresses of defective storage locations in the disk drive, and the list is stored in a table on the disk media. 
     FIG. 2B shows in schematic form such a prior art disk drive sector having the above described defect management scheme. The disk surfaces are labelled as surface 0, surface 1, . . . surface 5. In this example, each surface has 822 physical sectors, numbered consecutively on surface 0 through surface 5. As shown, in this prior art defect management scheme, a bad sector (labeled &#34;BAD&#34;) on surface 2 is effectively &#34;replaced&#34; by a good sector selected from one of the good &#34;SPARE SECTORS&#34; on surface 5 by using the replacement list of bad sectors and substitute spare sectors. Thus the good spare sector on surface 5 is assigned the logical block number (i.e., logical block address) that would have been assigned to the bad sector on surface 2 if the bad sector had not been defective. 
     A prior art defects list corresponding to the structure of FIG. 2B is shown in FIG. 2C. The first column is the logical block address (LBA) number; the cylinder number, head number, and sector number of the bad sector that would have had that LBA number if the sector had not been defective are the next three columns. Then the last three columns show the cylinder number, head number, and sector number of the spare sector assigned to replace the bad sector. 
     Also known in the art is the &#34;sector slipping&#34; technique for provision of spare sectors. In this case, instead of using spare sectors provided on a separate disk surface, the bad sector is skipped over and the logical block address that would have been associated with the bad sector had it been good is &#34;slipped&#34; to the next good sector on the same track. This method is used in conjunction with a defects list similar to that shown in FIG. 2C. 
     Such prior art methods have the disadvantage that if a particular disk drive has a significant number of defects, the defects list is very lengthy. This slows down operation of the disk drive whenever the defects list is accessed due to the need to go through the entire list. In addition, in many disk drive controllers (such as the well known SCSI &#34;Small Computer System Interface&#34; controllers) the controller actually keeps track of a logical address of storage locations, rather than a physical address. In this case, the use of a lengthy defects list slows down the calculation of the physical addresses from the logical addresses, since the defects list must be referred to whenever a physical address is calculated. 
     SUMMARY OF THE INVENTION 
     In accordance with the present invention, a disk drive microprocessor (or computer) maintains in its memory an operating table which lists the physical address of each track on the disks that has any defective sectors. The operating table lists for each such track the number of good sectors on that track. The operating table also identifies each track by cylinder number and head number, and by the logical address of the first good sector on that track. 
     The operating table is preferably constructed each time the disk drive is formatted, by scanning the prior art defects list or lists conventionally present on one of the disks. During formatting a &#34;correct&#34; address is written in the header area of each good sector. A &#34;correct&#34; address is an address within a predetermined range of correct addresses. Thus an allowable range of sector numbers is defined for addressing good sectors on each track. The bad (defective) sectors have an out-of-range address written into their header areas during formatting. Thus the bad sectors are designated at formatting as not being available for further use (i.e., for writing data on). When a bad sector is encountered during accessing of data, the next good sector is accessed instead, as described above in the prior art &#34;sector slipping&#34; method. 
     Then, each time the disk drive receives a read, write, seek, or translate command referencing a desired sector by its logical address from the host computer, the disk drive microprocessor searches the operating list for the arithmetically nearest logical address to the desired sector. The microprocessor then calculates, using data in the operating table, the physical address of the sector corresponding to the desired logical sector. Then the read, write, or other operation is performed conventionally using the physical address so calculated. 
     The present invention has the advantage over the prior art of substantially reducing the amount of defects data kept in the typically volatile memory associated with the microprocessor in order to calculate physical addresses, because the operating table is much shorter than the prior art defects list. This makes such calculations, and hence the operation of the disk drive, faster than in the prior art by reducing the time needed to search the defects data. 
     The present invention is compatible with SCSI and other well known disk drive interfaces. The present invention is applicable to hard disk drives, floppy disk drives, optical disk drives, and other storage media devices. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows a prior art disk drive. 
     FIG. 2A shows a prior art disk format. 
     FIG. 2B shows a prior art disk format. 
     FIG. 2C shows a prior art defects list. 
     FIGS. 3A, 3B and 3C show flow charts representing one embodiment of the invention. 
    
    
     Tables 4A to 4M show a computer program corresponding to the embodiment of the invention shown in FIGS. 3A, 3B and 3C. 
     DETAILED DESCRIPTION OF THE INVENTION 
     The preferred embodiment of the present invention is shown in flow chart format in FIG. 3A. The preferred embodiment of the present invention is applicable to a disk drive 10 as shown in FIG. 1. The method of the present invention is preferably under control of microprocessor 12 which is conventionally installed in disk drive 10. The preferred embodiment includes two aspects. The first aspect is shown on the left side of FIG. 3A, and this is the procedure used to format the recording medium (i.e., the disks) in accordance with the invention. A recording medium is typically only formatted once, either by the manufacturer or when first used by the ultimate user. However, reformatting at other times is usually possible. The second aspect is shown on the right side of FIG. 3A, and shows the procedure in accordance with the present invention each time the disk drive translates a logical to physical address or vice-versa. 
     The defect management procedure in accordance with the present invention in its first aspect relating to the recording medium format phase 70 starts with the disk drive microprocessor receiving a format command from the host computer at receiving command step 72. Then the microprocessor ascertains at defect list step 74 if there is any new defect list; i.e., if the host computer or controller has any list of defects on the recording medium in addition to the preexisting manufacturer provided defect list stored on one of the disks. If there are no new defects, the procedure jumps to operating table step 80. If there are new defects, the disk microprocessor receives the list at receive lists step 76 and stores it on a disk at a reserved location at store lists step 78. 
     Then the next step at construct table step 80 is to construct the operating table including information on the defects from all defect lists stored on the disk. 
     The preferred embodiment of the invention (see FIG. 3B which shows an exploded view of construct table step 80 from FIG. 3A) uses a SCSI interface. In this embodiment these various defect lists include the Primary list 120 of defects (i.e., the conventional &#34;P&#34; list) provided by the disk drive manufacturer and also the later provided Grown list 124 (i.e., the conventional &#34;G&#34; list) which lists defects found typically by the computer systems manufacturer who installs the disk drive in his product. 
     As explained above, the operating table 128 lists the logical block address (i.e., LBA) of the first sector for each track having a defective sector, and also lists the cylinder and head numbers for that track (i.e., the track number); and also for that track lists the number of good (i.e., nondefective) sectors. The operating table is then written to the disk at store operating table step 82 (see FIG. 3A). The next step at format drive step 84 is to format (or reformat) the disk surfaces, including the step of marking the defective sectors which are listed in the defects lists so that these sectors will be recognized as being &#34;bad&#34;. The marking preferably involves providing each defective sector with an out-of-limits address in its header as described above. Then at discard lists step 86, the defects lists are discarded (i.e., removed) from the RAM 13 (Random Access Memory) conventionally associated with the microprocessor 12 of FIG. 1; the operating table is kept in RAM 13. Then the format procedure is exited at exit step 88 in FIG. 3A. 
     The operating table 128 (see FIG. 3B), which is typically kept in nonvolatile memory (i.e., on the disk) and copied to the RAM of the microprocessor whenever the disk drive is powered up, has the following format in its preferred embodiment: 
     
         ______________________________________Operating Table (Example)LBA #    Cylinder #  Head #   # Good Sectors(4 bytes)    (2 bytes)   (1 byte) (1 byte)______________________________________    1    1           0        70   71    2           0        69   359   6           0        71.        .           .        ..        .           .        ..        .           .        .270,000  938         3        50______________________________________ 
    
     The data in the operating table is conventionally kept in binary form (not shown). The field for the LBA number for each row (i.e., entry) is preferably 4 bytes wide. The LBA number for each entry is the number of the first LBA of each track (i.e., a particular cylinder and head) listed in the table. Thus LBA 1 in the example is the number of the sequentially first LBA on the track which is the track at cylinder 1, head zero. The cylinder numbers are conventionally numbered radially from the outermost to the innermost track; in the example shown, the innermost track having a defective sector is cylinder 938, head 3. The field for the cylinder number is preferably 2 bytes wide. The heads are conventionally numbered 0, 1, 2, 3, in the example, which is for a drive having only four disk surfaces. The field for the head number is preferably 1 byte wide. For each row of the table, the last item is the number of good (nondefective and hence usable) sectors in that track. The field for the number of good sectors is preferably 1 byte wide. In the example, there is a total (good plus bad) of 72 sectors per track, so the listed entries in the example have 50 to 71 good sectors. As noted above, those tracks with all good sectors (i.e., 72 in the example) are preferably not listed in the version of the operating table kept in RAM 13 of microprocessor 12. 
     Thus for a typical 40 megabyte capacity drive having 200 defective sectors, occurring in sixty different tracks, the operating table would require 8 bytes/entry×60 entries=480 bytes of storage. 
     The defect management procedure for reading, writing, seeking, or translating in accordance with the invention is shown starting at read/write phase step 94 in FIG. 3A. First, the microprocessor receives a read, write, seek (i.e., move the recording heads from one track to another) or translate (i.e., convert logical to physical address or vice versa) command from the host computer or controller at receive command step 96. Then, the microprocessor determines at reassign table step 98 if the Logical Block Address (LBA) sent with the command (i.e., the desired LBA) appears in the reassign table. 
     The conventional reassign table (&#34;R&#34; table) is a defects list sent from the host computer, and shows the reassigned physical address for each logical address that has been reassigned due to a defect found in a sector since the last time the disk drive was formatted. The LBA is the logical address on the disk drive of the particular sector referred to in the command. If the desired LBA does appear in the reassign table, then the microprocessor finds the physical address corresponding to that LBA in the reassign table at information extraction step 100. Normally, the reassign table is empty, i.e., no LBA&#39;s appear in it because no new defects have been found on any of the disks since the last formatting of the disk drive. 
     If the desired LBA does not appear in the reassign table (as is normally the case) the operating table is accessed at find LBA step 102. Then the arithmetically nearest LBA in the operating table to the desired LBA is located by means of a binary search in the operating table. 
     The operating table, as described above, is constructed during formatting of the disk drive by scanning each defects list (of which there may be several) and counting the number of defects in each track. That number of defects is subtracted from the number of sectors per track (72 in the example) to arrive at the number of good sectors per track. 
     As shown in FIG. 3A, the microprocessor in the disk drive finds the nearest LBA in the operating table to the desired LBA at find LBA step 102. The search for the nearest LBA preferably first determines if the desired LBA appears in the operating table; if so, that LBA is used for the calculations in the next calculate step 104. 
     If the desired LBA does not appear in the operating table, then a conventional binary search of the operating table is performed to determine which two LBA entries in the operating table bracket the desired LBA. The operating table entry of interest is then the one which forms the lower boundary of the bracket, i.e., the operating table entry LBA closest to but having a value numerically less than the desired LBA. 
     In calculate step 104, the operating table entry LBA so found, and its corresponding cylinder number, head number, and number of good sectors, are used to calculate the cylinder number, head number, and sector number (i.e., physical address) which correspond to the desired LBA. This calculation is performed as follows: 
     1. Calculate a delta LBA value, which is equal to the number of the desired LBA less the value of the closest LBA found by the search of the operating table, plus the number of good sectors in the operating table entry. 
     2. Calculate a cylinder value, which is equal to the delta LBA value divided by the number of sectors per cylinder plus the number of the cylinder for the LBA found in the operating table search. The number of sectors per cylinder is the nominal number of sectors in a defect free cylinder for the particular disk drive. The remainder from the division of the delta LBA value by the number of sectors per cylinder is not used in this step. 
     3. Calculate a head value, which is equal to the remainder from step (2) divided by the nominal number of sectors per track, plus the number of the head for the LBA found in the operating table search, again ignoring any remainder from the division for this step. 
     4. Calculate a sector value, which is equal to the nominal number of sectors per track (i.e., 72 in the example above) less the remainder from step (3). 
     The resulting cylinder value, head value, and sector value are the physical address corresponding to the desired LBA. This process as described above of converting a logical address to a physical address, as shown in find LBA step 102 and in calculate step 104 of FIG. 3A, is shown in greater detail in flow chart form in FIG. 3C. 
     Thus the physical address corresponding to the desired LBA is determined at calculate step 104 in FIG. 3A, and the routine exited at exit step 106. Then the conventional read or write operations are performed. 
     The above defect management procedure during read/write including read/write phase step 94 to exit step 106 is preferably undertaken at the same time as a conventional seek (i.e., change of cylinder by the recording heads). Since the seek is necessary to operation of the disk drive, the defect management procedure in effect takes up no elapsed time by being done in parallel with the seek, and so does not slow down disk drive operation. 
     In the preferred embodiment of the invention, the method of the invention as shown in flow chart form in FIGS. 3A, 3B and 3C is implemented by means of a computer program written partly in assembly language and partly in &#34;C&#34; language. This program is conventionally installed in the ROM (Read Only Memory, not shown) of microprocessor 12 of FIG. 1, which preferably is a commercially available Motorola 8-bit microcontroller, part no. 68HC11. 
     The listing of the computer program used for defect management in the preferred embodiment is shown in Tables 4A to 4M, with appropriate explanatory comments included in the program listing. 
     Further embodiments of the invention include use of the invention in an optical disk drive, or in a floppy disk drive using defect management. Such a floppy disk drive would typically be a high capacity SCSI interface type floppy disk drive. 
     A portion of this disclosure contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction of the patent disclosure, as it appears in the Patent and Trademark Office patent files or records, but otherwise reserves all copyright rights whatsoever. 
     The above description of the invention is illustrative, not limiting, and other embodiments will be obvious to one skilled in the art in light of the teachings of the invention. ##SPC1##