Abstract:
A virus-resistant disk has a &#34;hidden partition&#34; in which anti-virus software is stored; the hidden partition not only shields the software from many viruses, but provides storage space that does not reduce the disk&#39;s formatted or advertised capacity. The disk includes software to cause the computer to execute the anti-virus software. The invention provides a hidden partition by utilizing storage space on the disk that is not reflected in the size and geometry information stored on the disk, e.g., in the BIOS Parameter Block.

Description:
COPYRIGHT NOTICE 
     A portion of the disclosure of this patent contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document of the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserve all copyright rights whatsoever. 
     FIELD OF THE INVENTION 
     The invention relates to detecting, identifying and removing computer viruses from components of a computer, and more particularly to a startup (bootstrap) disk that stores anti-virus software and facilitates the execution of this software at bootstrap time, i.e., before the computer begins executing an ultimate operating system (e.g., MS-DOS). 
     BACKGROUND OF THE INVENTION 
     A computer virus is software that is executed by a computer without the knowledge or authorization of the computer&#39;s user and that causes unauthorized and unwanted changes to components of the computer or to information stored on the computer. For example, some viruses alter or destroy data stored on disk, scramble characters on video display screens, display misleading messages to users, and consume computer or network resources thereby preventing users from performing desired tasks. A virus usually attempts to propagate itself to other computers by making copies of itself on any accessible diskettes or hard disks (collectively &#34;disks&#34;) or other non-volatile memory such as &#34;flash&#34; read-only memory (ROM). A virus &#34;attack&#34; herein means any change made to a computer component by a virus, such as a change to stored information or the making of a propagation copy of the virus. 
     Viruses typically propagate by opportunistically copying themselves to (&#34;infecting&#34;) any disks that happen to be accessible when a computer executes the virus. If a user transports an infected disk to a second computer and the second computer executes the virus, the virus then attempts to infect disks on the second computer, and so on. Viruses generally employ one of two techniques to cause a subsequent execution of themselves. Some viruses attach themselves to application programs that are stored on a disk. When a user runs the infected program, the virus also executes. Most viruses, however, are &#34;bootstrap-time viruses&#34; that replace the startup (bootstrap) program located on the infected disk with a program that causes the computer to execute the virus if the disk is subsequently used as a startup disk on this or another computer. Once the virus executes, it arranges for itself to remain in the memory of the computer after bootstrap, but causes the computer to execute the normal bootstrap program so as to mask its presence. Following completion of bootstrap, the virus remains stored on the computer and capable of causing further mischief. 
     Bootstrap programs execute as part of a bootstrap sequence initiated by the application of power or a reset signal to a computer. During this sequence, the computer performs a power-on self-test (&#34;POST&#34;), then locates a bootstrap program on a disk and then executes the bootstrap program. The bootstrap program is always stored at a characteristic, fixed location (the &#34;boot block&#34;) on the disk. Generally, the bootstrap program readies the computer for normal functioning by causing it to load and execute an operating system, such as MS-DOS, OS/2, NetWare, UNIX, or Windows-NT, although the bootstrap program can also cause the computer to execute one or more other programs prior to executing the operating system. Accordingly, as used herein, the term &#34;bootstrap&#34; includes the time and steps taken between the application of power or reset signal and the execution of the last program prior to the operating system; and &#34;operating system&#34; is software that manages a computer&#39;s resources (e.g., disks and memory) and provides low-level services (e.g., I/O, timer, memory management, interprogram communication) to application programs. An &#34;application program&#34; is not part of an operating system and can only execute under the control of an operating system. 
     To overcome the problems created by viruses, practitioners have developed a variety of &#34;anti-virus&#34; programs that both detect and remove known viruses. Anti-virus software searches for &#34;signatures&#34;, including characteristic behaviors, of viruses and removes any found viruses. Examples of commercially available anti-virus programs include Command Software Systems F-PROT, IBM AntiVirus, and Sophos Sweep. However, and quite problematically, bootstrap-time viruses can interfere with the operation of prior art anti-virus software. In addition, the presence of an operating system can obscure the presence of a virus in the memory of a computer. 
     As noted previously, a bootstrap program is stored at a characteristic disk location or address. For &#34;addressing&#34; purposes, disks are divided into surfaces, tracks, and sectors. The &#34;formatted capacity&#34;, in bytes, of a disk (also known as the &#34;advertised capacity&#34;) equals the product of the number of: surfaces, tracks per surface, sectors per track, and bytes per sector of the disk. A hard disk can be further o divided into one or more logical &#34;partitions&#34;, each partition being treated as a separate disk. Generally, the first sector of a diskette and the first sector of each partition of a hard disk contains a disk descriptor block which contains size and geometry information about the disk, such as the number of sectors per track. &#34;BIOS Parameter Block&#34; herein refers to the area on the disk where this information is characteristically stored. The following Table 1 lists the relevant fields of the BIOS Parameter Block. &#34;Conventional storage capacity&#34; of a disk herein means the formatted capacity of the disk as reflected by information in the BIOS Parameter Block of the disk. 
     
                       TABLE 1______________________________________Selected Fields of the BIOS Parameter BlockSize (bytes)   Field______________________________________2       Number of bytes per sector2       Total number of sectors in volume (logical partition)2       Number of sectors per track2       Number of surfaces (heads)2       Number of entries in root directory______________________________________ 
    
     It is therefore an objective of the invention to provide a startup disk (diskette or hard disk) that causes the computer to automatically execute anti-virus software each time the computer starts from the disk, i.e., during bootstrap, so as to detect bootstrap-time viruses before or after they have executed and implanted themselves in the system. 
     It is a further objective to provide a disk that stores the anti-virus software without reducing the amount of conventional storage capacity on the disk. 
     It is a further objective to provide a disk that stores the anti-virus software so as to make it inaccessible to many viruses. 
     It is a further objective to provide a mechanism to detect and repair virus-inflicted damage to the anti-virus software. 
     It is a yet further objective to provide a virus-tolerant disk (startup and other disk) that can withstand an attack by a virus without incurring damage to information stored on the disk. 
     Other objectives will, in part, be obvious and will, in part, appear hereinafter. The invention accordingly comprises an article of manufacture possessing the features and properties exemplified in the constructions described herein and the several steps and the relation of one or more of such steps with respect to the others and the apparatus embodying the features of construction, combination of elements and the arrangement of parts which are adapted to effect such steps, all as exemplified in the following detailed description, and the scope of the invention will be indicated in the claims. 
     SUMMARY OF THE INVENTION 
     The invention provides a virus-resistant disk on which is stored anti-virus software and software to cause a computer to execute the anti-virus software whenever the disk is used to start the computer. 
     Alternatively, the invention provides a virus-resistant disk having a &#34;hidden partition&#34; in which the anti-virus software is stored; the hidden partition not only shields the software from many viruses, but provides storage space that does not reduce the disk&#39;s formatted or advertised capacity. The disk also includes software to cause the computer to execute the anti-virus software. The invention provides a hidden partition by utilizing storage space on the disk that is not reflected in the size and geometry information stored on the disk, e.g., in the BIOS Parameter Block. Heretofore, no reason existed for a virus to assume storage space existed on a disk beyond that reflected by the BIOS Parameter Block or to access such space because the BIOS Parameter Block is the standard mechanism for identifying the configuration and storage capacity of a disk. 
     A &#34;conventional program&#34; herein means a program that either relies on the accuracy of the BIOS Parameter Block to access the disk or accesses the disk via an operating system that so relies. Most viruses are conventional programs. Advantageously, the invention utilizes the hidden partition to make programs and information stored in the hidden partition inaccessible to most existing viruses. In addition, storing programs and information in the hidden partition does not reduce the amount of available space on the disk, as reflected by the BIOS Parameter Block. 
     The invention provides the hidden partition by taking advantage of unutilized storage capacity on the disk. For example, diskettes commonly have gaps between the sectors of a track. The invention provides a diskette in which at least some of the gaps have been reduced in size, thereby bringing closer together the sectors of the track and leaving enough room for one or more additional sectors on the track. Not all tracks need have the same number of additional sectors. The additional sectors on all the tracks collectively form the hidden partition. Information in the BIOS Parameter Block does not reflect the existence of the additional sectors. 
     Hard disks generally have unutilized storage capacity in the form of spare sectors and/or spare tracks, the existence of which is not reflected by information in the BIOS Parameter Block. A hard disk lacking such spares generally can be formatted to contain them. 
     The invention provides a disk on which a special bootstrap program is stored in the boot block and, if the disk is a startup disk, the normal bootstrap program is stored elsewhere on the disk. The special bootstrap program causes the computer to execute the anti-virus software stored in the hidden partition and then, upon completion of the anti-virus software and if the disk is a startup disk, to execute the normal bootstrap program, which causes the computer to execute the operating system. A source listing of an example special bootstrap program appears later in this specification. 
     Alternatively, the disk also contains a bootstrap-time operating system (&#34;BTOS&#34;) and the special bootstrap program causes the computer to execute the BTOS. The BTOS causes the computer to execute one or more anti-virus, disk-maintenance (described below), and/or other programs stored in the hidden partition and then, upon completion of the programs and if the disk is a startup disk, to execute the normal bootstrap program. The normal bootstrap program causes the computer to perform an otherwise-normal startup, including executing the operating system (e.g., MS-DOS) with which the user can interact and which provides services to application programs. The operating system invoked by the normal bootstrap program is herein referred to as the &#34;ultimate operating system&#34; to distinguish it from the BTOS. &#34;Post-bootstrap&#34; herein means the time and steps taken after execution of the normal bootstrap program. 
     The BTOS facilitates the development and use of programs that must be executed before an ultimate operating system is executed. Executing before the ultimate operating system provides advantages to anti-virus software because the software can take advantage of conditions within the computer that only exist during bootstrap and do not exist after the computer begins executing the ultimate operating system. For example, an &#34;interrupt vector&#34; contains the address of a routine that is associated with the vector and that handles requests for service from a program or device. Whenever the program or device (e.g., a hard disk) requests service (&#34;generates an interrupt&#34;), the computer uses the address in the vector to pass control to the service routine. During bootstrap, the disk vector initially points to a well-known routine within the Basic Input/Output System (BIOS), but the ultimate operating system changes the vector to point to a routine within itself. Many viruses modify the disk vector to point to themselves, but it is difficult for an anti-virus application program to distinguish a disk vector that points to a virus from one that points to a routine within an ultimate operating system; thus it is easier for anti-virus software to detect the presence of a virus by examining the disk vector before the computer begins executing an ultimate operating system. The BTOS provides additional advantages in that developers of programs that must be executed before an ultimate operating system are relieved of developing special mechanisms that alter normal startup operations in order to invoke the programs; in addition, the BTOS provides low-level services to the programs and so simplifies them, and relieves users from concerning themselves with the details of invoking potentially several bootstrap-time programs. 
     Software that accesses the hidden partition is written with the knowledge that the additional sectors exist. The software accesses the additional sectors via program calls to the BIOS or BTOS rather than to the ultimate operating system because the BIOS and BTOS allow access to arbitrary addresses on the disk regardless of the contents of the BIOS Parameter Block and the ultimate operating system does not. 
     Alternatively, the disk also contains an application program that causes the computer to execute the anti-virus, disk-maintenance and/or other software that is stored in the hidden partition. This application program is not a conventional program because it is capable of accessing the hidden partition without relying on the BIOS Parameter Block or using an operating system that so relies. Such a program allows the user to run the anti-virus software even if a virus has attacked the special startup program and thereby prevented execution of the anti-virus software at bootstrap time. The anti-virus program examines the special startup program located in the boot block and repairs any damage done to it so it will function properly on subsequent bootstraps. 
     In case a virus attacks a disk having the anti-virus capabilities described above, the invention enables the disk to withstand the attack without incurring damage to files stored on the disk. The invention provides a virus-tolerant disk that prevents an operating system from placing files in sectors that are known to be attacked by several viruses, thereby shielding the files from attack by the viruses. An operating system uses a file system to manage storage space on a disk and create, delete, catalog and facilitate access to files on the disk. Storage space on a disk is allocated in units of &#34;clusters&#34; (contiguous groups of sectors). All clusters on a disk contain the same number of sectors and each cluster has a &#34;cluster number&#34; and a corresponding entry in a file system allocation table, e.g., the File Allocation Table or &#34;FAT&#34; in MS-DOS. The file system &#34;chains&#34; together clusters to allocate space to a file. Each FAT entry records whether the corresponding cluster is available, bad, or in use by a file. If it is in use, the entry contains the cluster number of the next cluster in the chain for the file or, if it is the last cluster of the file, a &#34;last-cluster&#34; flag. The following Table 2 lists the relevant field of a FAT entry. A &#34;directory&#34; catalogs files stored on a disk. For each file, a directory stores the file&#39;s attributes, e.g., read-only, and correlates the file&#39;s name and extension to its first cluster number. Directories can be organized into a hierarchy starting at a &#34;root&#34; directory. The following Table 3 lists the relevant fields of a directory entry. Disk-maintenance software, such as CHKDSK, SCANDISK and SpinRite, uses well-known techniques to detect and repair damage to information, such as the FAT and directory, stored by the file system and to overcome recording errors, such as signals that are recorded off-center on a track. The invention provides a disk having entries in its file system allocation table that prevent the allocation to any file of sectors that are known to be attacked by viruses. For example, the entries can mark the sectors as being &#34;bad&#34; or already in use. 
     
                       TABLE 2______________________________________Selected Field of a FAT (File Allocation Table) EntrySize             Field______________________________________3 nibbles (for 12-bit FAT)            Next cluster number or flag2 bytes (for 16-bit FAT)4 bytes (for 32-bit FAT)______________________________________ 
    
     
                       TABLE 3______________________________________Selected Fields of a Directory EntrySize (bytes)    Field______________________________________8               File Name3               File Extension1               File Attributes (e.g. read-only)2 (4 for 32-bit FAT)           First Cluster Number______________________________________ 
    
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The foregoing discussion will be understood more readily from the following detailed description of the invention, when taken in conjunction with the accompanying drawings, in which: 
     FIG. 1 is a diagram of the sectors of one surface of a diskette that has a hidden partition according to the invention; 
     FIG. 2 is a diagram of the sectors of one surface of a hard disk having a hidden partition according to the invention; and 
     FIG. 3 is a flowchart illustrating a bootstrap sequence involving a disk provided by the invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 shows generally at 100 a surface of a diskette according to the invention, with representative tracks 102a-d and 104a-c. Each track has sectors, such as sector 106. On a prior art high-density 1.44 MB (formatted capacity) diskette, each track contains 18 sectors (numbered 1-18). Tracks 102a-d each contain 18 sectors, as in the prior art. As a diskette spins, the gaps between sectors provide an opportunity for circuitry within the diskette drive to synchronize itself with the carrier and data signals recorded on the diskette. The size of the gap between the sectors of tracks 102a-d is represented by angle 108. The size of the gap, represented by angle 110, between the sectors of tracks 104a-c is smaller than the size of the gap 108 between the sectors of tracks 102a-d, leaving room for, preferably, two additional sectors per track without negatively impacting the ability of the circuitry to synchronize itself. The gap can be further reduced, leaving room for three additional sectors per track, but with current technology such small gaps negatively impact the ability of the circuitry to synchronize itself. The additional sectors in track 104c are sector number &#34;19&#34; (112a in FIG. 1) and sector number &#34;20&#34; (112b in FIG. 1). Collectively, all the additional sectors on the diskette, such as sectors 112a-f, make up the hidden partition 114. (FIG. 1 assumes that only tracks 104a-c have additional sectors.) 
     Not all tracks need contain additional sectors, thus making it difficult for a virus to detect the existence of the hidden partition 114 and the location of the tracks 104a-c that contain additional sectors. The manufacturer of diskettes can vary, from diskette to diskette, which tracks have additional sectors. Preferably, all tracks contain two additional sectors, providing a total of 160 KB in the hidden partition of an 80-track diskette. Advantageously, these two additional sectors at the end of each track provide a rotational delay between the last conventional sector (e.g., sector number &#34;18&#34;) of a track and the first sector of the next track. This delay allows the diskette drive enough time to reposition the head on the next track before the first sector of the next track passes under the head, thereby speeding up access to data on the diskette. Without this delay, the first sector of the next track would pass under the head before the diskette drive could reposition the head and, once the drive repositions the head, the drive would incur a time penalty of nearly one revolution before it could read the first sector in the next track. 
     Table 1 lists the fields of the BIOS Parameter Block that are relevant to the invention. The BIOS Parameter Block located on diskette contains the value &#34;18&#34; in the &#34;Number of sectors per track&#34; field. The &#34;Total number of sectors in volume (logical partition)&#34; field contains the product of 18, the number of tracks per surface and the number of surfaces on the diskette. Thus, the BIOS Parameter Block located on the diskette hides the additional sectors 112a-f, therefore making the hidden partition 114 inaccessible to conventional programs. 
     FIG. 2 shows generally at 200 a surface of a hard disk according to the invention, including representative tracks 202a-e and representative sectors, such as sector 204. If the hard disk does not have spare sectors and/or spare tracks, or if it is not desirable to utilize these spares to form a hidden partition, the hard disk can be formatted so that the BIOS Parameter Block on the disk does not reflect the existence of selected sectors. For example, by reducing the &#34;Number of sectors per track&#34; field in the BIOS Parameter Block by two and reducing the &#34;Total number of sectors in volume (logical partition)&#34; field by the product of two, the number of tracks per surface and the number of surfaces on the disk, sector number &#34;681&#34; and sector number &#34;682&#34; in each track 202a-e, i.e., sectors 206a-j, become part of the hidden partition 208, and therefore inaccessible to conventional programs. However, I prefer to create a hidden partition on the last sectors of a disk by simply reducing the &#34;Total number of sectors in volume (logical partition)&#34; field in the BIOS Parameter Block because this enables the creation of a hidden partition of arbitrary size. 
     FIG. 3 is a flowchart illustrating a bootstrap sequence involving a disk provided by the invention. Upon application of power or a reset signal, the computer starts at step 300 performs a power-on self-test (&#34;POST&#34;) at step 301 and executes the special bootstrap program at step 302. 
     At decision step 304, the special bootstrap program ascertains whether the computer was started from a diskette or from a hard disk. If the computer was started from a diskette, at step 306 the special startup program warns the user of the risk of propagating a virus inherent in starting the computer from a diskette. The risk exists because a diskette that was previously inserted in another computer may have been infected by a virus running on the other computer, even if the diskette was not used to start the other computer. 
     At step 308 the special startup program performs an integrity test on itself to ascertain whether it has been damaged, e.g., by a virus attack, and announces the results of the self-test. 
     At step 310 the special startup program causes the computer to execute the BTOS, which is stored in the hidden partition 114 or 208. At step 312 the BTOS checks for indication of the existence of viruses in the computer and announces the results of the check. For example, the BTOS examines the disk vector, as described earlier. At step 314 the BTOS then causes the computer to load and execute virus removal and integrity check software, which is stored in the hidden partition 114 or 208. 
     At decision step 315, if all detected viruses have been removed, the software checks at decision step 316 whether the special bootstrap program in the boot block had been attacked. If so, at step 317 the software copies one of several backup copies of the special bootstrap program, which are stored in the hidden partition 114 or 208, to the boot block. 
     In addition to being capable of detecting the existence of viruses in the computer, the BTOS is an operating system and can provide services to application programs (&#34;compliant programs&#34;) written to make program calls to it. At step 318 the BTOS causes the computer to search the hidden partition for compliant programs, such as third-party anti-virus, disk-maintenance or other software, and to load and execute any such programs it finds. Alternatively, the BTOS can search for compliant programs on portions of the disk in addition to the hidden partition, but I prefer to store all such software on the hidden partition so it does not reduce the conventional storage capacity of the disk and to make it inaccessible to conventional viruses. 
     At step 320 the BTOS restores the memory and registers of the computer to an &#34;initialization&#34; state, i.e., substantially the state that existed immediately after the POST. This state is well known, particularly to practitioners who write BIOS programs, and the step is necessary to enable the normal bootstrap program to execute correctly. For example, when a virus modifies the disk vector, the virus stores within itself the original contents of the vector so the virus can pass control to the disk handling routine after performing its mischief. When the anti-virus software detects such a modified vector, it examines the virus, retrieves the original contents of the vector and restores the vector&#39;s original contents. The location at which a virus stores the original contents can be ascertained by &#34;disassembling&#34; the virus. Disassembly is a well-known process of converting object code to source code. 
     As a second example, the anti-virus software recovers memory utilized by a virus when it removes the virus. Viruses often mask their presence by reducing the apparent amount of memory on the computer by an amount equal to their size (including buffers, etc.), e.g., by reducing a field in the BIOS Data Area that contains the number of kilobytes of memory that exist below memory address 640KB. Generally, an ultimate operating system examines the BIOS Data Area when it begins executing and configures itself accordingly. Application program anti-virus software removes a virus after the ultimate operating system begins executing, thus after the ultimate operating system has examined the BIOS Data Area, so despite having removed the virus the application program anti-virus software does not enable the ultimate operating system to utilize the memory previously utilized by the virus. Anti-virus software provided by the invention executes before the ultimate operating system so, after removing a virus, it increases the field in the BIOS Data Area by the amount of memory recovered, thereby enabling the ultimate operating system to utilize the recovered memory. 
     At step 322 the BTOS causes the computer to execute the normal bootstrap program and then finishes at step 324. The normal bootstrap program causes the computer to execute the ultimate operating system. 
     Several viruses are known to attack certain sectors and certain clusters of a disk. In case a virus attacks a disk having the anti-virus capabilities just described, these sectors and clusters are preferably allocated to a &#34;dummy&#34; file, thereby preventing their being allocated to any other files or used by directories, thus preventing these viruses from inflicting any damage on the files or directories. Some viruses attacked the two sectors of a disk that generally contain the last two sectors of the root directory. Reducing the size of the root directory by two sectors (see Table 1, &#34;Number of entries in root directory&#34; field of the BIOS Parameter Block) prevents this type of attack on the root directory. Preferably, the dummy file includes the first two sectors removed from the root directory, i.e., the first two clusters on the disk after the root directory, and the cluster comprising the last track on the last surface. (Assuming the cluster size is equal to one.) The dummy file, named &#34;ViToler8.(c)&#34;, has an entry in the directory and entries, corresponding to the above-listed sectors and clusters, in the FAT. The directory entry marks the file as &#34;hidden&#34; in the MS-DOS sense. MS-DOS does not list hidden files when it provides a directory listing of files, so users will not generally know the file exists. While users can remove the hidden attribute from the file, marking the file hidden reduces the possibility that a user will delete the file and thereby make the virus-targeted clusters and sectors available for allocation to other files. 
     While I prefer to use a hidden partition to store the anti-virus, disk:maintenance and other software and the BTOS, it is also possible to utilize a disk with no hidden partition and store any of these within the conventional storage capacity of the disk. In such a case, the special bootstrap program causes the computer to execute the anti-virus software or BTOS and then, if the disk is a startup disk, to execute the normal bootstrap program. When the anti-virus, disk-maintenance, or other software or the BTOS is stored within the conventional storage capacity of the disk, its files should be marked as hidden in the MS-DOS sense to reduce the possibility that a user will delete them or that a virus will attack them. 
     It will therefore be seen that I have developed a virus-tolerant and virus-resistant disk and method of executing software prior to an ultimate operating system, which can be utilized with a variety of anti-virus, disk-maintenance, and other software to address a range of computer viruses. The terms and expressions employed herein are used as terms of description and not of limitation, and there is no intention, in the use of such terms and expressions, of excluding any equivalents of the features shown and described or portions thereof, but it is recognized that various modifications are possible within the scope of the invention claimed. ##SPC1##