Patent Publication Number: US-6711660-B1

Title: System and method for performing disk drive diagnostics and restoration using a host-inaccessible hidden partition

Description:
BACKGROUND OF THE INVENTION 
     Field of the Invention 
     The present invention relates generally to digital information storage, and more particularly to a computer system and method for performing disk drive diagnostics and restoration using a host-inaccessible hidden partition. 
     Description of the Prior Art 
     A small percentage of computer users may encounter a situation where an error message is displayed when attempting to boot the computer from a hard disk drive. Despite the small percentage of these occurrences, the huge numbers of installed personal computer makes the actual number of boot error occurrences significant. In many of these instances, the user calls for technical support from the system manufacturer. Technical support staff may attempt to diagnose the problem by having the user load a diagnostic program or recovery program from a floppy disk or CD ROM, however many users are unable to locate the disks provided with the system. 
     In most boot error situations the problem is either a corrupted image on the disk drive or, more infrequently, a failing hard disk drive. Because the situation is undiagnosed when the user cannot locate system disks, technical support staff usually advises the user to send the disk drive back for exchange. As a result, many fully working disk drives are returned and exchanged for new ones, causing unnecessary expense for the manufacturers of computers and disk drives. 
     The industry has attempted to alleviate this problem by creating partitions on the disk drive to store recovery software. In one variation, a separate logical partition is created using conventional partition tables. In another more recent attempt, a “host protected area” is created by issuing commands to the disk drive for truncating the range of logical block addresses (LBAs) that are visible to the operating system. Unfortunately, this truncating method is well documented in the AT Attachment (ATA) specifications for disk drive interface and therefore, the partition thus created can be easily corrupted by a virus or other malicious programs. 
     What is needed therefore, is a solution to the boot error problem that doesn&#39;t depend on a user locating removable media which is subject to loss or misplacement and which cannot easily be corrupted by a virus or other malicious programs. 
     SUMMARY OF THE INVENTION 
     One embodiment of the invention comprises a disk drive for use with a computer system including a host memory and a host processor for generating a boot command. The disk drive comprises: a host-accessible user partition; a host-inaccessible hidden partition independent of the host-accessible user partition; and a disk controller. The host-accessible user partition includes a user partition address range; a host-selected operating system within the user partition address range; and a host-selected master boot record within the user partition address range, the host-selected master boot record identifying the host-selected operating system. The host-inaccessible hidden partition includes: a hidden partition address range outside the user partition address range; diagnostic software within the hidden partition address range, the diagnostic software for determining a condition of the computer system; and a drive-selected master boot record within the hidden partition address range. The drive selected master boot record waits for a user input within a predetermined time period. If the user input is received within the predetermined time period, the master boot record loads and executes the diagnostic software. If the user input is not received within the predetermined time period, the master boot record loads the host-selected master boot record and loads and executes the host-selected operating system identified by the host-selected master boot record. The disk controller receives the boot command and sends the drive-selected master boot record to the host memory in response to the boot command. 
     Another embodiment of the invention comprises a computer system including: a disk drive and a host computer coupled to the disk drive. The disk drive includes: a host-accessible user partition; and a host-inaccessible hidden partition independent of the host-accessible user partition. The host-accessible user partition includes: a user partition address range; a host-selected operating system within the user partition address range; and a host-selected master boot record within the user partition address range, the host-selected master boot record identifying the host-selected operating system. The host-inaccessible hidden partition includes: a hidden partition address range outside the user partition address range; diagnostic software within the hidden partition address range, the diagnostic software for determining a condition of the computer system; and a drive-selected master boot record within the hidden partition address range. The host computer includes: a host processor for generating a boot command to read the host-selected master boot record; and a host memory for loading the drive-selected master boot record to define a loaded drive-selected master boot record. After the disk drive receives the boot command, the host processor executes the loaded drive-selected master boot record by waiting for a user input within a predetermined time period. If the user input is received within the predetermined time period, the host processor loads and executes the diagnostic software. If the user input is not received within the predetermined time period, the host processor loads the host-selected master boot record and loads and executes the host-selected operating system identified by the host-selected master boot record. 
     Another embodiment of the invention comprises a computer system including: a host computer; and a disk drive coupled to the host computer. The disk drive comprises: a host-accessible user partition and a host-inaccessible hidden partition independent of the host-accessible user partition. The host-accessible user partition includes: a user partition address range; and user partition data within the user partition address range, the user partition data comprising at least one host-selected operating system and configuration data. The host-inaccessible hidden partition includes: a hidden partition address range outside the user partition address range; a drive-selected operating system within the hidden partition address range; a drive-selected master boot record within the hidden partition address range, the drive-selected master boot record for loading the drive-selected operating system; and restorable user partition data within the hidden partition address range, the restorable user partition data comprising a copy of the user partition data, the restorable user partition data for restoring the user partition data. 
     Another embodiment of the invention comprises a method of restoring a user system image on a disk drive for use with a computer system including a host processor for generating a boot command and a host memory. The method comprises: loading user partition data comprising at least one host-selected operating system and configuration data on a host-accessible user partition of the disk drive; and loading a restorable user system image comprising the user partition data on a host-inaccessible hidden partition of the disk drive. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The accompanying drawings illustrate embodiments of the present invention, and, together with the description, serve to explain the principles of the invention. 
     FIG. 1 is a block diagram of a computer system, having a host computer coupled to a disk drive having a hidden partition for storing a restorable user system image and diagnostic software; 
     FIG. 2 is a block diagram illustrating the organization of data storage sectors in the disk drive of FIG. 1; 
     FIG. 3 is a flow diagram illustrating exemplary logic for loading a user system image and diagnostics software in the hidden partition of the disk drive of FIG. 1; 
     FIG. 4 is a flow diagram illustrating exemplary logic for booting a computer such that a user can load and execute PC Services software for performing diagnostics and/or restoring a user system image in accordance with the present invention; 
     FIG.  5 . is a flow diagram illustrating exemplary logic for load loading and executing PC Services software that allows a user to run the diagnostic software and/or restore the user system image; 
     FIG. 6 is a flow diagram illustrating exemplary logic for running diagnostic software; 
     FIG. 7 is a flow diagram illustrating exemplary logic for restoring the user system image; 
     FIG. 8 is a flow diagram illustrating exemplary logic for loading and executing a host-selected operating system; and 
     FIGS. 9A-9C illustrate exemplary PC Services menus. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     U.S. patent application Ser. No. 09/796,915, filed Feb. 28, 2001, titled “COMPUTER SYSTEM AND METHOD FOR ACCESSING A PROTECTED PARTITION OF A DISK DRIVE THAT LIES BEYOND A LIMITED ADDRESS RANGE OF A HOST COMPUTER,” the entire contents of which are incorporated herein by reference, discloses a computer system having a host computer coupled to a disk drive having a user partition and a hidden partition and a system and method for accessing the hidden partition. As shown in the drawings and explained in further detail herein, the present invention stores a user system image in the hidden partition. Diagnostic software is also stored in the hidden partition. The user can execute the diagnostic software in the hidden partition and/or restore the user system image stored in the hidden partition. 
     The present invention may be embodied in a computer system (FIG. 1) and a related method (FIGS.  4 - 8 ). The computer system  10  includes a host computer  12  and a disk drive  14 . The host computer  12  has a host processor  16  and a host memory  17 . The disk media of the disk drive  14  is accessed using a head assembly  30  and may be divided into data storage sectors, each generally storing 512 data bytes. Each sector may be addressed using a logical block address (LBAs). A linear addressing scheme using the LBAs for addressing the sectors is shown in FIG.  2 . The data storage sectors are organized into a host-accessible user partition  52 , a drive management partition  54 , and a protected area also referred to herein as a disk-drive selected application partition (DDSAP) or a host-inaccessible hidden partition  56 . The user partition  52  includes a user area  18  and may be assigned to LBA numbers 0 through a native maximum (MAX) LBA. The host computer  12  may access the data storage sectors in the user partition  52  using an industry standard interface protocol, such as the ATA Interface between host computers and storage devices. The ATA standard also defines a host protected area  58  within the user partition  52  for data storage outside the normal file system of the user&#39;s preferred operating system  20 . The operating system cannot change data in the host-protected area  58 . A host-selected master boot record (MBR)  24  includes a small program for loading and executing the user&#39;s preferred or host-selected operating system  20 . The host-protected area  58  is intended for use only by the host computer&#39;s basic input/output system (BIOS) or other low-level boot time process when the storage device is initially configured. 
     The drive management partition  54  may be assigned to negative LBA numbers and the corresponding data storage sectors may be accessed using drive management commands. The data in the drive management partition  54  generally includes disk drive configuration and physical format information written by the disk-drive manufacturer during initial testing and configuration of the disk drive  14 . The drive management commands generally vary from manufacturer to manufacturer. 
     DDSAP  56  is assigned to “spare” data storage sectors above the native MAX LBA number. It will be appreciated that the DDSAP could be assigned to negative LBA numbers instead of or in addition to storage sectors above the native MAX LBA number. Generally, the DDSAP is configured by the disk drive manufacturer before shipment of the disk drive  14 . The DDSAP sectors are visible to the disk drive&#39;s microprocessor-based internal controller  31  (FIG. 1) but normally are not visible to the host computer  12 . Accordingly, data stored in the DDSAP may not be destroyed by logical partitioning and formatting processes (e.g., FDISK) performed on the user partition  52 . Typically, the DDSAP includes at least one drive-selected master boot record  26 , at least one extended disk access routine  28  and at least one interrupt routine or application  29 . In the present invention, the DDSAP delivered by the disk drive manufacturer includes applications  29  for waiting for a user input that allows the user to run the diagnostics and/or restore a user system image, as well as applications for running the diagnostics and restoring a user system image. A drive-selected master boot record  26  causes the logic to wait for the user input to be loaded and executed. The DDSAP delivered by the disk drive manufacturer also includes an application  29  that allows a computer manufacturer to load a restorable user system image  32  into the DDSAP. 
     FIG. 3 is a flow diagram illustrating exemplary logic for loading a restorable user system image and diagnostics software in the hidden partition  22 . A user partition  52  and hidden partition  56  are created as shown in FIG. 2 (step  100 ). Diagnostic software is stored in the hidden partition  56  (step  101 ). A user preferred operating system, also known herein as a host-selected operating system, is loaded in the user area of the user partition  18  (step  102 ). Configuration data is also loaded in the user area  18  (step  104 ). Configuration data includes data specific to the computer system components and/or the host-selected operating system. A restorable user system image that includes the host-selected operating system and the configuration data (factory image) is created (step  106 ). The restorable user system image is loaded in the hidden partition  56  (step  108 ). Typically, the disk drive manufacturer performs the steps of creating the user partition and the hidden partition (step  100 ) and loading the diagnostic software in the hidden partition (step  101 ). The hidden partition delivered by the disk drive manufacturer includes application software that allows the computer system manufacturer to perform the remaining logic in FIG. 3, e.g., creating and loading a restorable user system image (steps  106  and  108 ). After the logic of FIG. 3 has been performed, the computer system is ready to be delivered to a consumer or user. Use of the computer system  10  having diagnostics and a restorable user system image in a hidden partition  56  is described next. 
     From the user&#39;s perspective, the delivered system is basically the same as any typical computer system. When the user powers on the computer system, the computer typically loads and executes the user&#39;s preferred operating system. However, as shown in the drawings and described in further detail below, at the beginning of the boot process, there is a short time window in which the user can load and execute PC Services rather than the user&#39;s preferred operating system. The PC Services allow the user to load and execute diagnostic software and/or to restore the user system image. 
     FIG. 4 is a flow chart illustrating exemplary logic for booting a computer having PC Services. When the user boots the computer, the host computer sends a boot command to the disk controller requesting a master boot record to read the host-selected operating system (step  120 ). This is the normal or typical boot procedure. Normally, the disk controller sends the master boot record identifying the host-selected operating system. Typically, there is an MBR located at cylinder  0 , head  0 , sector  1  of a hard disk. The MBR is first of what could be many partition sectors, each containing a partition table. The MBR contains a small program that attempts to locate an active (bootable) partition in its partition table. Each operating system has its own boot sector format. The small program in the boot sector locates the first part of the operating system&#39;s kernel loader program, the kernel itself, or a boot manager program. The located first part of the operating system&#39;s kernel (or the kernel itself or a boot manager program) is then read into memory. In other words, the host-selected or user preferred operating system is loaded and executed. However, in the present invention, the disk controller uses address spoofing as described in U.S. patent application Ser. No. 09/796,915 to send an alternate master boot record that allows the user to run PC Services (step  122 ). The master boot record loads and executes logic that causes the host processor to wait a predetermined period of time (e.g., five seconds) for a predetermined key sequence (e.g., &lt;CTRL&gt;&lt;ALT&gt;&lt;F 10 &gt;). A timer is set to the predetermined period of time (step  124 ). The host processor then waits for the predetermined period of time or until user input is received (step  126 ). If the predetermined key sequence for requesting PC services is received within the predetermined time period (yes in decision block  128 ), the PC Services logic is loaded and executed from the hidden partition (step  130 ). Exemplary logic for performing PC services in accordance with the present invention is shown in FIG.  5  and described below. If the timer expires, the host-selected operating system is loaded and executed, e.g., normal boot process continues (step  132 ) as shown in FIG.  8  and described later. It will be appreciated that the user may enter keystrokes other than those designated as invoking PC Services prior to the expiration of the timer. Such user input will be processed normally, e.g., ignored. 
     FIG. 5 illustrates exemplary logic for loading and executing PC Services in accordance with the present invention. After the appropriate code is loaded, execution begins and a menu of PC Services is displayed (step  140 ). FIG. 9A illustrates an exemplary PC Services menu that allows the user to either: run diagnostics, restore the user system image; or boot to the normal (e.g., host-selected) operating system, for example, Windows® 95™, Windows ME®, etc. The user selects one of the available options. After the user input is received (step  142 ), appropriate logic is executed based on the user&#39;s input. If the user opts to run diagnostics (yes in decision block  144 ), diagnostics are run (step  146 ) as shown in FIG.  6  and described next. 
     FIG. 6 is a flow diagram illustrating exemplary logic for running diagnostics. It will be appreciated that in order to run the diagnostics, an “operating system” may first be loaded and executed. A diagnostics menu, such as that shown in FIG. 9B is displayed (step  160 ). In exemplary embodiments, an off-the-shelf diagnostics product, such as PC Doctor™ is used. In the example menu illustrated in FIG. 9B, the user can run one of the specific tests (e.g., A 5  memory test, central processing unit (CPU) test, hard disk drive test) or all tests. The user can also return to the previous (PC Services) menu shown in FIG.  9 A. The user selects one of the menu options. The user input is received (step  161 ) and the appropriate logic is performed. If the user selects one of the diagnostic functions, e.g., run a specific test or run all tests (yes in decision block  162 ), the appropriate test(s) is run (step  163 ). In exemplary embodiments, after completion of a diagnostic test, a menu such as the one shown in FIG. 9C is displayed (step  164 ). If the user wishes to view results of the diagnostic test (yes in decision block  166 ), the diagnostic results are displayed (step  167 ). The user can also return to the diagnostics menu shown in FIG. 9B (no in decision block  166 ). The user may then run additional diagnostics if desired. When the user has performed the desired diagnostic test(s), the user returns to the main PC Services menu shown in FIG.  9 A. The user can then restore the user system image or boot the host-selected operating system (e.g., continue with the normal boot process). 
     FIG. 7 illustrates exemplary logic for restoring a user system image. If the user initiates the restore user system image function, the user system image that includes the user preferred operating system and configuration data stored in the hidden partition, also known as a factory image, (FIG. 3) can be restored. In exemplary embodiments, user data is stored to create a restorable updated system image and the updated system image is restored. The user partition data is restored by copying the restorable user system image or the restorable updated system image from the host-inaccessible hidden partition to the host-accessible user partition (step  170 ). In exemplary embodiments, after the user system image is restored, the system is automatically rebooted (step  172 ) so that the restored host-selected operating system can be loaded and executed. The process of booting a system having system diagnostics and a restorable user system image in a hidden partition is illustrated in FIG.  4  and described above. 
     FIG. 8 illustrates exemplary logic for loading and executing the host-selected operating system (e.g., normal boot). The disk controller sends the master boot record for loading and executing the host-selected operating system to the host computer (step  180 ). The host computer loads and executes the host-selected operating system specified by the master boot record (step  182 ).