1. Field of the Invention
The present invention relates to a method for recovering BIOS and a computer system thereof, and more particularly, to a method capable of utilizing a control unit to control a recovery process and the computer system thereof.
2. Description of the Prior Art
A basic input/output system (BIOS) plays a very important role in the functioning of a computer during boot-up. In general, from the time a user presses a power-on button to the time the computer system has completed loading the OS, the BIOS performs various processes in succession, such as a power on self test (POST), hardware initialization, default settings record of the computer system, providing runtime programs, or loading the operating system (OS). Thus, through the BIOS, hardware configurations of all components can be initialized and the computer system can load the OS successfully during boot-up. BIOS code is usually stored in a storage device in practice. As the computer system provides system power to a CPU, the CPU further accesses and executes the BIOS code stored in the storage device in order to perform a boot process for the computer system.
However, since the BIOS code stored in the storage device may be corrupted or incomplete, and therefore nonfunctional, due to physical damage or other factors, the CPU will not be able to execute a complete BIOS code for performing the boot process, resulting in a boot failure. To prevent the boot failure when the BIOS code is broke, the prior art utilizes several storage devices for storing several backup BIOS codes and sets priority orders for accessing the backup BIOS codes. Therefore, the prior art is able to selectively access other backup BIOS codes stored in other storage devices when the BIOS code is broken. Although the prior art can resolve the boot failure problem by using the above method, this results in increased manufacturing cost. Therefore, the prior art further proposes another method. Please refer to
It is therefore an objective of the invention to provide a method for recovering basic input/output system (BIOS) and a computer system thereof.
An embodiment of the invention discloses a method for recovering a BIOS in a computer system, the computer system comprising a host unit, a control unit, and a first storage device, the control unit for controlling system power provided to the host unit, the host unit for accessing a BIOS code stored in the first storage device via a first data transmission unit to perform a boot process, the method comprising the steps of: turning the system power off when the computer system has a recovery requirement; restoring a backup BIOS code into the first storage device; and turning the system power on to make the host unit access the restored BIOS code in the first storage device for performing the boot process.
An embodiment of the invention further discloses a computer system which comprises a first storage device, for storing a BIOS code; a second storage device, for storing a control code and a backup BIOS code; a host unit, coupled to the first storage device via a first data transmission unit, for accessing the BIOS code to perform a boot process; and a control unit, coupled to the host unit, for controlling system power provided to the host unit according to the control code; wherein when the computer system has a recovery requirement, the control unit controls the system power to be turned off and controls the backup BIOS code to be restored into the first storage device, and controls the system power to be turned on to make the host unit access the restored BIOS code in the first storage device for performing the boot process.
An embodiment of the invention further discloses a method for recovering a BIOS in a computer system, the computer system comprising a host unit, a control unit, and a first storage device, the control unit for controlling system power provided to the host unit, the host unit for accessing a BIOS code stored in the first storage device via a first data transmission unit to perform a boot process, the method comprising the steps of: utilizing the control unit to turn the system power off when the computer system has a recovery requirement; utilizing the control unit to control the host unit to access data and turn the system power on; utilizing the host unit to access a BIOS boot block code stored in a second storage device; utilizing the host unit to execute the BIOS boot block code to restore a backup BIOS code stored in a third storage device into the first storage device; utilizing the control unit to turn the system power off; and utilizing the control unit to turn the system power on to make the host unit access the restored BIOS code in the first storage device via the first data transmission unit for performing the boot process.
An embodiment of the invention further discloses a computer system which comprises: a first storage device, for storing a BIOS code; a second storage device, for storing a control code and a BIOS boot block code; a third storage device, for storing a backup BIOS code; a host unit, coupled to the first storage device via a first data transmission unit, for accessing the BIOS code to perform a boot process; and a control unit, coupled to the host unit, for controlling system power provided to the host unit according to the control code; when the computer system has a recovery requirement, the host unit accesses the BIOS boot block code, restores the backup BIOS code stored in the third storage device into the first storage device after executing the BIOS boot block code, and accesses the restored BIOS code of the first storage device for a boot process.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
As stated in the prior art, since the BIOS code stored in the first storage device 206 is corrupt or incomplete due to suffering physical damage, and therefore nonfunctional, the host unit 202 will fail to execute the complete BIOS code for performing a boot process. In such a condition, the conventional technique must utilize the host unit 202 equipped with a required system power supply to check the above-mentioned error situation and perform a BIOS recovery process. That is, in the prior art, the host unit 202 cannot accomplish the BIOS recovery process without required system power. Comparatively, the embodiment of the invention can utilize the control unit 204 to check an error state of the BIOS code without being supplied the system power and may further control the recovery process and the on/off operation of the system power for recovering the BIOS code when the computer system has a BIOS recovery requirement. Accordingly, the embodiment of the invention can also prevent a boot failure situation that may happen due to the corrupted test program stored in another storage device. Regarding the detailed operations of the computer system 20, please refer to the following statements.
Please refer to
Step 300: Start.
Step 302: Utilize control unit 204 to turn the system power required by host unit 202 off when computer system 20 has recovery requirement.
Step 304: Utilize control unit 204 to restore backup BIOS code into first storage device 206.
Step 306: Utilize control unit 204 to turn the system power on to make host unit 202 access the restored BIOS code in first storage device 206 for performing boot process.
Step 308: End.
According to the procedure 30, the computer system 20 can realize the BIOS recovery process through the control operation of the control unit 204. In Step 302, when the computer system 20 has a recovery requirement, such as when a corrupted BIOS code stored in the first storage device 206 is checked or a recovery hot key is pressed, the system power supplied to the host unit 202 is turned off by the control unit 204. In this situation, the host unit 202 stops accessing the BIOS code from the first storage device 206, and the computer system 20 enters a recovery process state. Note that, in the embodiment of the invention, any method or scheme used for indicating that the computer system 20 has a recovery requirement to the control unit 204 is suitable. For example, in the embodiment of the invention, when a hot key(s), a combination key(s), or a specific button(s) is (are) pressed, a recovery requirement is triggered to the control unit 204. The combination key can be a combination of various keys. The specific button can be a recovery starting button. Therefore, the control unit 204 is capable of turning the system power provided for the host unit 202 off according to the triggered recovery requirement. Optionally, the control unit 204 can determine whether the computer system 20 has a recovery requirement or not by observing operation status of routine procedures. For example, in a normal computer system, the control unit 204 will receive a notification after a successful boot process is completed. In other words, the control unit 204 can examine whether the successful boot notification is transmitted after the power-on button is pressed. If no successful boot notification is transmitted within a specific duration, the control unit 204 determines that a boot failure occurs. In such a condition, when the control unit 204 checks the number of boot failures occurring in the computer system 20 is greater than a threshold value (ex. three times), the control unit 204 is able to turn the system power off, and the procedure goes to Step 304 to Step 308. In addition, the control unit 204 can also check whether the computer system 20 has a recovery requirement through considering the status of any connection port, such as the status of port 80. For example, when the control unit 204 checks that the number of accumulated boot failures generated by the port 80 is greater than a threshold value (ex. five times), the control unit 204 can turn the system power off, and further perform the BIOS recovery procedure.
Besides, in Step 304, the control unit 204 can further check whether an error occurs in the BIOS code of the first storage device 206 and restore the backup BIOS code stored in the second storage device 208 into the first storage device 206 when the error occurrence of the BIOS happens. Preferably, when no error occurrence exists in the BIOS code, the control unit 204 need not perform the process of restoring the backup BIOS code into the first storage device 206, and the procedure goes to Step 308. On the other hand, the control unit 204 can employ any error check technique. For example, the control unit 204 can perform a checksum process, a parity check process, or acyclic redundancy check process on the BIOS code stored in the first storage device 206 in order to check the BIOS error status.
In Step 306, since the control unit 204 has restored the backup BIOS code into the first storage device 206, the control unit 204 controls the system power to be re-turned on to provide power to the host unit 202. In such a condition, the host unit 202 can further access the restored BIOS code stored in the first storage device 206 to perform the boot process successfully.
Please refer to
In addition, when the control unit 204 cannot support sufficient input/output ports during the recovery process, please refer to
Preferably, as shown in
Please refer to
Please refer to
Step 1000: Start.
Step 1002: Utilize control unit 904 to turn the system power off when computer system 90 has recovery requirement.
Step 1004: Utilize control unit 904 to configure host unit 902 to access data and turn the system power on.
Step 1006: Utilize host unit 902 to access BIOS boot block code stored in second storage device 908.
Step 1008: Utilize host unit 902 to execute BIOS boot block code to restore backup BIOS code stored in third storage device 910 into first storage device 906 accordingly.
Step 1010: Utilize control unit 904 to turn the system power off.
Step 1012: Utilize control unit 904 to turn the system power on to make host unit 902 access the restored BIOS code in first storage device 906 via first data transmission unit 912 for performing boot process.
Step 1014: End.
Furthermore, in Step 1002, when the computer system 90 has a recovery requirement, the computer system 90 utilizes the control unit 904 to turn the system power supplied to the host unit 902 off, so that the host unit 902 stops accessing the BIOS code from the first storage device 906. In general, the host unit 902 can access the external data via the first data transmission unit 912 or the second data transmission unit 914 by configuring the strap pin. In Step 1004, the control unit 904 can configure the strap pin and returns the system power, so that the host unit 902 can access data from the control unit 904 via the second data transmission unit 914. In Step 1006, the host unit 902 transmits an access request to the control unit 904 via the third data transmission unit 916, and the control unit 904 reads the BIOS boot block code from the second storage device 908 according to the access request. After that, the host unit 902 can access the BIOS boot block code read by the control unit 904 via the third data transmission unit 916. In Step 1008, the host unit 902 can read the backup BIOS code stored in the third storage device 910 via the fourth data transmission unit 918 and restore the read backup BIOS code into the first storage device 906 via the first data transmission unit 912 accordingly after the host unit 902 executes the BIOS boot block code. In Step 1010, the computer system 90 utilizes the control unit 904 to turn the system power off and configure the strap pin so that the host unit 902 can access the BIOS code from the first storage device 906 via the first data transmission unit 912 in the normal boot process. Finally, the computer system 90 utilizes the control unit 904 to turn the system power on and the host unit 902 can further perform the boot process with the recovered BIOS code. Therefore, compared with the prior art, the invention can utilize the control unit 908 to control the recovery process to avoid the boot failure situation that happens due to the corrupted test program, and the invention requires fewer storage devices (ex. second storage device 908) for storing the BIOS boot block code.
Note that, the computer systems 20 and 90 are exemplary embodiments of the invention, and those skilled in the art can make alternations and modifications accordingly. For example, the host unit 202 and 902 can be a CPU, a chipset (northbridge chip, southbridge chip), or any combination thereof, and this should not be a limitation of invention. The control unit 204 and 904 can be an embedded controller, a keyboard controller, a microprocessor, an I/O controller, or any other similar element having the same function. The above-mentioned storage devices 206, 208, 906, 908, and 910 can be any kind and any type of storage apparatus, such as read only memories (ROMs), flash memories, electrically erasable programmable read only memories (EEPROM), non-volatile memories, etc. The above-mentioned data transmission unit 210, 212, 214, 912, 914, 916, and 918 can be any kind of data transmission unit. For example, the first data transmission unit 912 and/or the second data transmission unit 914 can be implemented with a serial peripheral interface (SPI), the third data transmission unit 916 can be implemented with a low pin count (LPC) interface, the fourth data transmission unit 918 can be implemented with a universal serial bus (USB) interface, and those should not be a limitation of the invention. Besides, the mentioned hot key comprises one or more keys. For example, a function key Fn, a character key J, and a switch key as a default hot key, may be set so that when the three keys are pressed simultaneously, a recovery requirement is triggered correspondingly. The mentioned specific button can be any type of button, such as an existing button or an extra physical button of the computer system.
In summary, compared with the prior art, the invention need not check the situation of the BIOS code on each booting process. The invention can utilize the control unit to control the recovery process when the computer system has a recovery requirement and also avoid the boot failure situation that happens due to the corrupted test program. On the other hand, the invention requires fewer storage devices for storing the BIOS boot block code, so that the manufacturing cost is reduced accordingly.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.
Number | Date | Country | Kind |
---|---|---|---|
098134935 | Oct 2009 | TW | national |