Method and system for detecting the validity of configuration data

Methods are provided for detecting the validity of configuration data and recovering configuration data in a computer system. A layout of present configuration data is detected in the computer system. The present configuration data is stored in a memory device which may be a non-volatile random access memory (“NVRAM”) device. Next, a layout of updated configuration data for the computer system is detected. The updated configuration data is stored within program code, such as a BIOS, which includes an updated configuration for the computer system. Next, the layout of the present configuration data is compared to the layout of the updated configuration data in the computer system. If the layout of the present configuration data matches the layout of the updated configuration data, then it is determined that the present configuration data is valid configuration data for the computer system. If the layout of the present configuration data does not match the layout of the updated configuration data, then it is determined that the present configuration data is invalid configuration data and the present configuration data is either reset to a default state or recovered into an updated memory location in the NVRAM.

TECHNICAL FIELD

The present invention is related to computer system configuration. More particularly, the present invention is related to detecting the validity of configuration data and recovering configuration data in a memory device in a computer system.

BACKGROUND OF THE INVENTION

Some computer systems have a type of non-volatile memory (“NVRAM”) for storing user-configurable settings governing the operation of a computer. For example, a user may configure a computer system to boot from the hard disk or boot from a network. The user-configurable settings for the computer system are typically provided in a firmware basic input/output system (“BIOS”). The BIOS contains basic routines which are accessed to boot the computer as well as to initialize and interface hardware with operating system software.

Occasionally, the BIOS may need to be updated to reflect changes in the hardware configuration of the computer system or to add new features. When the BIOS in a computer system is updated, the software that performs the update resets the configuration settings stored in the NVRAM to their default state requiring a user to reconfigure the previous settings in the NVRAM which were deleted as a result of the update. Historically, this reset has been done as a safety measure because different BIOS versions may have different configurable features whose current state is stored in the same locations in the NVRAM. Thus, the configuration reset is done to avoid a potentially serious system malfunction. However, rarely does an updated BIOS version include different configurable features which are stored in the same NVRAM locations as the features provided in a previous BIOS version. As a result, a user's previous configuration settings in the NVRAM are often reset unnecessarily due to a BIOS update and, as a result, many users are unnecessarily required to reconfigure their configuration settings.

It is with respect to these considerations and others that the present invention has been made.

SUMMARY OF THE INVENTION

In accordance with the present invention, the above and other problems are solved by methods for detecting the validity of configuration data stored in the NVRAM of a computer system following a BIOS update in a computer system. Methods are also provided for recovering configuration data stored in the NVRAM.

In accordance with other aspects, the present invention relates to a method of detecting the validity of configuration data for a computer system. According to the method, a layout of present configuration data for the computer system is detected. The present configuration data is stored in a memory device which may be a NVRAM device. Next, a layout of updated configuration data for the computer system is detected. The updated configuration data is stored within program code, such as a BIOS, which includes an updated configuration for the computer system. Next, the layout of the present configuration data is compared to the layout of the updated configuration data in the computer system. If the layout of the present configuration data matches the layout of the updated configuration data, then it is determined that the present configuration data is valid configuration data for the computer system. If the layout of the present configuration data does not match the layout of the updated configuration data, then it is determined that the present configuration data is invalid configuration data and the present configuration data is reset to a default state.

Detecting the layout of the present configuration data may include detecting a first numerical value, such as a checksum value. Similarly, detecting the layout of the updated configuration data may include detecting a second numerical value, such as a checksum value. The checksums may be determined by computing a hash value from at least one data record in the layouts of the present and updated configuration data. Each data record may include a pointer and a map position indicating the location of the data records.

In accordance with other aspects, the present invention relates to a computer system for detecting the validity of computer configuration data. The computer system includes a first memory device for storing a program for detecting the validity of present configuration data stored in the computer system. The computer system further includes a second memory device for storing a layout of the present configuration data and a processor, functionally coupled to the first and second memory devices, and responsive to computer-executable instructions contained in the program. The processor in the computer system is operative to detect the layout of the present configuration data, detect a layout of the updated configuration data and compare the layout of the present configuration data to the layout of the updated configuration data.

If the layout of the present configuration data matches the layout of the updated configuration data, then the processor determines that the present configuration data is valid. If the layout of the present configuration data does not match the layout of the updated configuration data, then the processor determines that the present configuration data is invalid and resets the present configuration data to a default state. The processor is operative to detect the layout of the present configuration data by detecting a first numerical value, such as a checksum. The processor is operative to detect the layout of the updated configuration data by detecting a second numerical value, such as a checksum.

In accordance with other aspects, the present invention relates to a method of recovering configuration data for a set of hardware devices in a computer system. A hardware device is selected from the set of devices as a current device. Next, a first map location is retrieved from a layout of present configuration data stored in the computer system. The first map location represents the location of present configuration data for the current device in the NVRAM. Next, a second map location is retrieved from a layout of updated configuration data stored in the computer system for the current device. The second map location represents the location of updated configuration data for the current device in the NVRAM.

Next, a determination is made as to whether the first map location matches the second map location for the current device. If it is determined that the first map location matches the second map location for the current device, then the next hardware device in the set of devices is selected as the current device. If it is determined that the first map location does not match the second map location for the current component, then the present configuration data is copied from the first map location to the second map location in the NVRAM, the present configuration data is erased from the first map location in the NVRAM, and the next hardware device in the set of devices is selected as the current device.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the present invention provide methods for detecting the validity of configuration data and recovering configuration data in a computer system. In the following detailed description, references are made to the accompanying drawings that form a part hereof, and in which are shown by way of illustration specific embodiments or examples. Referring now to the drawings, in which like numerals represent like elements through the several figures, aspects of the present invention and the exemplary operating environment will be described.

FIG. 1and the following discussion are intended to provide a brief, general description of a suitable computing environment in which the invention may be implemented. While the invention will be described in the general context of program modules that execute in conjunction with an application program that runs on an operating system on a computer system, those skilled in the art will recognize that the invention may also be implemented in combination with other program modules.

Turning now toFIG. 1, an illustrative computer architecture for a computer system2which was discussed briefly above, for practicing the various embodiments of the invention will be described. The computer system2includes a standard local or server computer operative to execute one or more application programs, such as update utility29.

Alternatively, the computer system2may include another type of computing device operative to access a network18, such as a personal digital assistant or other type of computer. The computer architecture shown inFIG. 1illustrates a conventional personal computer, including a central processing unit4(“CPU”), a system memory6, including a random access memory8(“RAM”) and a read-only memory (“ROM”)10, and a system bus13that couples the system memory6to the CPU4.

The ROM10comprises a memory device for storing a basic input/output system (“BIOS”)11containing the basic routines that help to transfer information between elements within the computer. These basic routines are accessed to boot the computer as well as to initialize and interface hardware with operating system software. One such routine is the power-on self test (“POST”) routine. The POST routine is executed after the computer system is turned on for performing diagnostics and initializing system components in the computer system. The ROM10further comprises a second memory device, such as a non-volatile random access memory device (“NVRAM”)12, for storing configuration data for the hardware in the computer system2. It will be appreciated by those skilled in the art that NVRAM12may be, for example, a complementary metal oxide semiconductor (“CMOS”) or a static random access memory (“SRAM”) device. In one embodiment, the configuration data stored in the NVRAM12may include a layout checksum58, which is a computed value representing a current hardware configuration or layout of the computer system2. The layout checksum58will be described in greater detail below with respect toFIGS. 2–3. The contents of the NVRAM12will be described in greater detail below with respect toFIGS. 2–4below.

The computer system2further includes a mass storage device14for storing an operating system16, an update utility29, an update file31, and other application programs30. The update utility29contains program code for updating an existing version of the BIOS11to an updated version with update code in the update file31. The update utility29is launched from the mass storage device14on the CPU4which executes code for updating the BIOS11with the update code. Upon launching the update utility29the update file31is loaded into the RAM8. In one embodiment, the updated BIOS code in the update file31may include a layout checksum59, which is a computed value representing an updated hardware configuration or layout of the configuration data stored in the NVRAM12of the computer system2. In another embodiment, the update file31may include updated configuration data describing the hardware configuration of the computer system2. The update utility29and the update file31will be described in greater detail with respect toFIGS. 5–6below.

The mass storage device14is connected to the CPU4through a mass storage controller (not shown) connected to the bus13. The mass storage device14and its associated computer-readable media, provide non-volatile storage for the computer system2. Although the description of computer-readable media contained herein refers to a mass storage device, such as a hard disk or CD-ROM drive, it should be appreciated by those skilled in the art that computer-readable media can be any available media that can be accessed by the computer system2.

According to various embodiments of the invention, the computer system2may operate in a networked environment using logical connections to remote computers through the network18. The computer system2may connect to the network18through a network interface unit20connected to the bus13. It should be appreciated that the network interface unit20may also be utilized to connect to other types of networks and remote computer systems. The computer system2may also include an input/output controller22for receiving and processing input from a number of devices, including a keyboard, mouse, or electronic stylus (not shown inFIG. 1). Similarly, an input/output controller22may provide output to a display screen, a printer, or other type of output device. It should be understood that the input/output controller22may be a serial port interface (not shown) or other type of interface, such as a game port or a universal serial bus (USB), that is coupled to the bus13.

FIGS. 2A–2Bare tables showing illustrative layouts of the hardware configuration of the computer system2according to various embodiments of the invention. The table shown inFIG. 2Ais a setup control database50illustrating the hardware configuration in the computer system2for a current version of the BIOS11. As shown inFIG. 2Athe current BIOS version is version 1.0. The setup control database50is stored in the computer system2. The setup control database50allows a user to access the contents of the NVRAM12to setup or configure hardware devices in the computer system2(such as specifying a hard disk drive or memory configuration) during boot-up of the computer system2by the BIOS11.

The setup control database50includes a Handles column51which lists numbers assigned to each of the configurable hardware devices in the computer system2. As is known to those skilled in the art, a handle is a token, typically a pointer, that points a memory location. Each handle in the setup control database50points to memory addresses in the NVRAM12for each of the configurable hardware devices. The memory addresses for each of the devices are shown in Map Position column56. The setup control database50further includes a Setup Question column52which lists the configurable hardware devices for the computer system2. For example, in the setup control database50ofFIG. 2A, the configurable hardware devices are a boot device52A, a serial port52B, and a USB keyboard52C.

The setup control database50further includes an Options column53listing the number of options available for each of the configurable hardware devices listed in the Setup Question column52. For example, the Options column53indicates that the boot device52A has sixteen configurable options for booting the computer system2. For example, one option may be booting the computer from the hard disk while another option may be booting the computer from the CD-ROM drive.

The setup control database50further includes a Bits column54listing the number of binary bits in the NVRAM12allocated to each of the configurable hardware devices listed in the Setup Questions column52. It should be understood that the number of binary bits allocated for each device in the Bits column54corresponds to the number of options for each device in the Options column53. For example, the boot device52A is configured to have sixteen options and requires four binary bits to represent all sixteen options in the NVRAM12.

The setup control database50further includes a Setup Value column55listing a setup value for each of the configurable hardware devices in the computer system2. Each setup value may be a default value or a value selected by a user of the computer system2. For example, in the setup control database50, the serial port52B has a setup value of two indicating, for example, that the serial port in the computer system2is assigned the second communications port (i.e., “COM2”).

The setup control database50further includes a Map Position column56listing the memory addresses in a “map” of the NVRAM12for each of the devices listed in the Setup Questions column52. Each memory address in the Map Position column56corresponds to a byte and bit location in the map for each device. For example, the configuration data for the boot device52A, which is allocated four bits in the Bits column54, is located in byte70, bits0–3(70:0–3) in the map of the NVRAM12. The map of the NVRAM12will be described in greater detail below with respect toFIGS. 3A–3Bbelow.

Referring now toFIG. 2B, the table shown inFIG. 2Bis a setup control database60illustrating the hardware configuration for the boot device52A, the serial port52B, and the USB keyboard52C in the computer system2for an updated version of the BIOS11. As briefly discussed above, the update file31may include updated BIOS code and updated configuration data describing the hardware configuration of the computer system2. In this example, the updated version of the BIOS11is version 1.1. Similar to the setup control database50described above inFIG. 2A, the setup control database60includes a Handle column61, a Setup Questions column62, an Options column63, a Bits column64, a Setup Value column65, and a Map Position column66. As shown inFIGS. 2A and 2B, the number of options for the serial port52B has increased from five options in the setup control database50to nine options in the setup control database60. The increase in the number of options may be, for example, an increase in the number of COM ports assignable to the serial port52B in the updated BIOS version. As a result of the increase in the number of options, the number of binary bits allocated to the serial port52B has increased from three bits in the setup control database50to four bits in the setup control database60. As shown inFIG. 2B, the memory addresses for the serial port52B in the Map Position column66have also changed from byte70, bits4–6(70:4–6) in the setup control database50to byte71, bits0–4(71:0–3) in the setup control database60.

FIGS. 3A–3Bare block diagrams illustrating the configuration data stored in the NVRAM12in the computer system2described above inFIGS. 1–2, according to various embodiments of the invention. Referring now toFIG. 3A, the configuration data in the NVRAM12corresponds to a current version of the BIOS11(i.e., v 1.0) in the computer system2. As shown inFIG. 3A, the NVRAM12includes 256 bytes of memory with the configuration data being stored in byte70. The byte70includes bits70A–70H for storing the current configuration for the hardware devices52A,52B, and52C in the setup control database50in binary format. For example, the Map Position column56in the setup control database50allocates the configuration data for the serial port52to byte70, bits4–6with a setup value of two. As shown inFIG. 3A, the bits70E–70G in the byte70store the configuration for the serial port52B with a setup value (i.e., binary value) equal to two. In one embodiment of the invention and as briefly described above, the NVRAM12may also include a layout checksum58, which is a computed value representing the layout or contents of the NVRAM12. The layout checksum58may be stored in a fixed location in the NVRAM12such as the byte38.

It will be appreciated by those skilled in the art that the layout checksum58may be computed as a hash value generated from the records stored in the setup control database50. For example, the layout checksum58may be generated from the values in the Handles column51and the Map Position column56in the setup control database50. It should be understood that methods for computing hash values from data records are known to those skilled in the art and that other methods for computing the layout checksum58may also be utilized without departing from the scope of the present invention.

Referring now toFIG. 3B, the NVRAM12is shown corresponding to an updated version of the BIOS11(i.e., v1.1) in the computer system2. As shown inFIG. 3B, the updated NVRAM12includes 256 bytes of memory with the updated configuration data being stored in the bytes70and71. The byte70includes bits70A–D and70H for storing the updated configuration for the boot device52A and the USB keyboard52C while the byte71includes bits71A–71D for storing the updated configuration for the serial port52B in binary format. For example, the Map Position column66in the setup control database60allocates the configuration data for the serial port52B to byte71, bits0–3with a default setup value of one. As shown inFIG. 3B, the bits71A–71D in the byte71store the configuration for the serial port52B with a setup value (i.e., binary value) equal to one. As briefly described above, in an alternative embodiment, the update file31may only include the layout checksum59which may be a hash value generated from the values in the Handles column61and the Map Position column66in the setup control database60.

FIGS. 4–5shows illustrative logical operations performed in the computer system2for detecting the validity of configuration data and recovering configuration data in the NVRAM12described above inFIGS. 1–3according to various embodiments of the invention. The logical operations of the various embodiments of the present invention are implemented (1) as a sequence of computer implemented acts or program modules running on a computing system and/or (2) as interconnected machine logic circuits or circuit modules within the computing system. The implementation is a matter of choice dependent on the performance requirements of the computing system implementing the invention. Accordingly, the logical operations making up the embodiments of the present invention described herein are referred to variously as operations, structural devices, acts or modules. It will be recognized by one skilled in the art that these operations, structural devices, acts and modules may be implemented in software, in firmware, in special purpose digital logic, and any combination thereof without deviating from the spirit and scope of the present invention as recited within the claims attached hereto.

The logical operations400ofFIG. 4begin at operation402where the update utility29is launched in the computer system2and retrieves the layout of the present configuration data for the computer system2. As described above inFIG. 2A, the layout of the present configuration data is the setup control database50for the current version of the BIOS11(i.e., v. 1.0) which is stored in the computer system2. After the layout of the present configuration data has been retrieved, the operational flow400continues at operation404where the update utility29determines the layout checksum58from the records in the setup control database50. As described above with respect toFIG. 3A, the layout checksum58may be determined by generating a one-byte hash value from the values in the Handles column51and the Map Position column56in the setup control database50.

After the first layout checksum has been determined operation404, the operational flow400continues at operation406where the update utility29stores the layout checksum58in a fixed location, such as the byte38, in the NVRAM12as shown above inFIG. 3A. It should be understood that, in an alternative embodiment of the invention, the layout checksum58may be determined prior to the BIOS11being compiled in the computer system2. In this alternative embodiment, the layout checksum is hard-coded into the NVRAM12when the BIOS code is compiled in the computer system2.

After the layout checksum58has been stored in the NVRAM12, the operational flow400continues at operation408where the update utility29retrieves the layout of the updated configuration data for the computer system2from the update file31. As briefly described above, the layout of the updated configuration data is the setup control database60for the updated version of the BIOS11(i.e., v. 1.1) which may be stored in the update file31in the computer system2.

After the layout of the updated configuration has been retrieved at operation408the operational flow400continues at operation410where the update utility29determines the layout checksum59from the records in the setup control database60. As described above, the layout checksum59may be determined by generating a one-byte hash value from the values in the Handles column61and the Map Position column66in the setup control database60. After the layout checksum59has been determined at operation408, the operational flow400continues at operation412where the update utility29stores the layout checksum59in the update file31. It should be understood that the layout checksum59may be stored in the code containing the updated configuration data for the NVRAM12. It should be understood that, in an alternative embodiment of the invention, the layout checksum59may be pre-determined and inserted into the updated BIOS code prior to launching the update utility29.

After the layout checksum59has been stored in the update file31at operation412, the operational flow400continues at operation414where the update utility29updates the BIOS11with the updated code in the update file31which contains the layout checksum59. After the BIOS11has been updated at operation414, the operational flow400continues at operation416where the layout checksum58stored in the NVRAM12is compared to the layout checksum59stored in the updated code in the BIOS11. In one embodiment, the comparison may be performed by the POST routine during a boot of the computer system2following the update of the BIOS11. As briefly discussed above, the POST routine performs diagnostics and initializes system components in the computer system including comparing data stored in the BIOS with data stored in the NVRAM12.

If at operation416it is determined that the layout checksum58is not equal to the layout checksum59, the BIOS update has caused a change in the configuration data and a layout checksum error is generated in the computer system2at operation418. Once a layout checksum error is generated the BIOS11clears the layout checksum58from the NVRAM12and resets the configuration options in the NVRAM12to their default state. The operational flow400then ends. If however, at operation416it is determined that the layout checksum58is equal to the layout checksum59, the BIOS update has not caused a change in the configuration data and the configuration data in the NVRAM12is left unchanged by the BIOS11at operation418. The operational flow400then ends.

FIG. 5shows illustrative logical operations500performed in the computer system2for recovering configuration data in the NVRAM12described above inFIGS. 1–3according to an alternative embodiment of the invention. The logical operations500ofFIG. 5begin at operation502where the update utility29is launched in the computer system2and retrieves the layout of the present configuration data for the computer system2. As described above inFIG. 2A, the layout of the present configuration data is the setup control database50for the current version of the BIOS11(i.e., v. 1.0) which is stored in the computer system2.

After the layout of the present configuration data has been retrieved, the operational flow500continues at operation504where the update utility29selects a hardware device from the Setup Questions column52in the layout. After a hardware device has been selected at operation504, the operational flow continues at operation506where the update utility29retrieves the current position of the current device in the NVRAM12from the Map Position column56in the setup control database50. After the position of the current hardware device has been retrieved at operation506, the operational flow500continues at operation508where the update utility29retrieves the layout of the updated configuration data for the computer system2. As described above inFIG. 2B, the layout of the updated configuration data is the setup control database60for the updated version of the BIOS11(i.e., v. 1.1) which may be stored in the update file31.

After the layout of the updated configuration data has been retrieved at operation508, the operational flow500continues at operation510where the update utility29retrieves the updated map position of the current device in the NVRAM12from the Map Position column56in the setup control database60. As discussed above, the setup control database60, which contains the updated configuration data for the NVRAM12, may be stored in the update file31. After the updated map position of the current hardware device has been retrieved from the setup control database60, the operational flow500continues at operation512where the update utility29compares the current map position for the current device as shown inFIG. 3Ato the updated map position for the current device as shown inFIG. 3B.

If at operation512it is determined that the current map position of the current hardware device is not equal to the updated map position of the current hardware device, then a change in the configuration of the current hardware device has occurred and the update utility29copies the setup value for the current hardware device from the current map position in the NVRAM12to the updated map position in the NVRAM12at operation514. In this manner, the current setup for the current hardware device is recovered into the updated configuration data for the NVRAM12. The operational flow then continues to operation516where the update utility29erases the current setup value for the current hardware device from the current map position in the NVRAM12.

For example, as shown in the setup control database50inFIG. 2A, the serial port52B has a current map position of byte70, bits4–6(70:4–6) and a current setup value of2, which may indicate, for example, that the serial port is currently assigned the second communications port (i.e., COM2) in the computer system2. In this example, the serial port52B also has a map position of byte71, bits0–3(71:0–3) in the updated configuration data with a default setup value of 1 as shown in the setup control database60ofFIG. 2B. Since the current map position for the serial port52B is not the same as the updated map position, the update utility29copies the current setup value for the serial port52B from byte52, bits4-6in the NVRAM12(represented in binary number format as010inFIG. 3A) to the updated map position of byte71, bits0–3in the NVRAM12(represented in binary number format as0010inFIG. 3C). Thus, the current setup for the serial port52B is recovered into the updated configuration data for the NVRAM12. The operational flow then continues from operation516to operation518.

If at operation512it is determined that the current map position of the current hardware device is equal to the updated map position of the current hardware device, then no change in the configuration of the current hardware device has occurred and the NVRAM12is left unchanged. For example, as shown in the setup control database50inFIG. 2A, the current map positions for the boot device52A and the USB keyboard52C are the same as the updated map positions for these devices. Therefore, the setup values for these devices are left unchanged in the NVRAM12by the update utility29. The operational flow then continues from operation512to operation518.

At operation518, the update utility29determines whether there are any additional devices to be selected in the setup control database50. If, at operation518, it is determined that there are additional devices to be selected in the setup control database50, the operational flow500continues to operation520where the update utility selects the next device listed in the Setup Questions column51in the setup control database50. The operational flow500then returns to operation506where the update utility retrieves the map location of the selected device from the setup control database50. If, at operation518, it is determined that there are no additional devices to be selected in the setup control database50, the operational flow500then ends.

Although the invention has been described in language specific to computer structural features, methodological acts and by computer readable media, it is to be understood that the invention defined in the appended claims is not necessarily limited to the specific structures, acts or media described. Therefore, the specific structural features, acts and mediums are disclosed as exemplary embodiments implementing the claimed invention.