1. Field of the Invention
The present invention stores a functional patching program at a read/write memory location inside a memory device, thereby correcting or updating a functional program in a firmware so as to achieve the purposes of reducing cost and simplifying firmware update.
2. Description of Related Art
Because the data processing of computers is becoming increasingly complicated, the conventional storage device, which has a small capacity or is not easily carried, is already insufficient for the access of general files. Therefore, computer manufacturers are devoted to finding a portable and repeatedly readable/writable technology. However, since this kind of portable device with large capacity should match a convenient and commonly practiced transmission protocol and interface, the general portable storage device on the market, e.g., the memory card for a digital video camera/camera, conveniently portable USB drive or recording pen, was created. All of them take a flash memory as a main memory device.
Reference is made to
Reference is made to
During the operation of the above-mentioned configuration, if an error module 23 is found in the chip read-only memory 24, then in accordance with the defined corresponding addresses, the operation will directly be transferred to the patch module 221 for continuing execution.
Although the conventional technology shown in
The present invention is a method for patching a firmware in a memory device, characterized in that at least one functional patch is stored at a read/write memory location inside the memory device, thereby correcting or updating a functional program in the firmware so as to achieve the purposes of reducing cost and simplifying firmware update.
The patch method of the firmware includes initiating the system, detecting if the firmware function of one or plural memory location needs to be patched, selecting use of the function firmware, determining if the firmware function has a patching program, and using the patching program loaded into the memory block and corresponding to the firmware function.
The foregoing aspects and many of the attendant advantages of this invention will be more readily appreciated as the same becomes better understood by reference to the following detailed description, when taken in conjunction with the accompanying drawings, wherein:
The present invention utilizes the configuration of a conventional USB drive or memory card, such as, for example, an SD, CF or MS, and also utilizes the memory device therein for storing the patch program. When the firmware in the device executes a certain function and finds a need for patching, the present invention uses the patch program stored in the read/write memory block directly without exchanging or re-burning the firmware.
As shown in
In the above-mentioned memory block 31, a partial continued or not continued program-patching block 311 has already and previously been defined according to the preset invention. A program status of the program-patching block 311 is indicated by plural flags defined by the micro codes in the firmware. If the functional program in the firmware 333 needs to be patched or updated, then a burning program is used to memorize the patch program at the pre-defined location and the flag is set as 1 (on) for notifying the system. Therefore, when it needs a certain function and a flag thereof is indicated as 1, the functional program inside the program-patching block 311 will be used to replace the original old program in the firmware 333.
Step 41: When the system is activated, namely, a system initialization is started, the micro codes in the firmware are loaded into the microprocessor for preparing to receive a control signal and an memory data access signal from an apparatus connected with this memory device, and a step of defining an address of the pre-schemed program-patching block is further included;
Set 42: Then, any update data or any destruction in the firmware function that needs patching is detected;
Step 43: If a patch is needed, the burning program is employed to load the patched functional program for the patch-needed function into the program-patching block of the memory block;
Step 44: Whether the patching program, including the version thereof or compatibility, is correct or not is detected;
Step 45: If the patching program is damaged or there is a problem of unmatchable version or compatibility, then the original functional program in the firmware is continuously used;
Step 46: If not, the loaded location sets a flag to 1 (on), where the step of setting one or plural flags is employed to define that the firmware function of the memory device has been replace by a corresponding patching program; and
These above-described steps are repeatedly performed until every patch-needing function has been patched.
Step 47: When no more patches are needed, the process ends.
Step 51: After the system is activated, namely, the initialization is started, then drivers in the firmware are loaded into a system memory, generally a RAM, in a computer system connected to this memory device and the microprocessor is also initiated, and further, the step of defining an address of the pre-schemed program-patching block is included;
Step 52: Whether a patch mode is needed is redetermined;
Step 53: If the patch mode is needed, the procedure enters the steps for loading a patching program, as shown in
Step 54: If it is negative, a system operation mode is initiated and a user may choose to use one function of the system;
Step 55: Whether the function needs a patch program according to the flag set to each function in the firmware is 0 (off) or 1 (on) is determined;
Step 56: If the function has a patch program, then the patch program loaded into the memory block corresponding to the firmware function is used, and then the procedure enters Step 58;
Step 57: If the function does not own a corresponding patch program, then the firmware functional program originally pre-loaded in the firmware is used;
Step 58: The function program stored in the program-patching block or in the firmware is loaded into the system memory for execution according to the conditions of Steps 56 and 57;
Afterward, the procedure enters a loop for selecting functions in the system to be used or will continue a step of determining if needs to use other firmware function or if there is patching program.
The present invention employs partial capacity of the original read/write memory used for data storage in the memory device for leaving the patch without additional memory so as to achieve the purposes of patching or updating firmware.
It is to be understood, however, that even though numerous characteristics and advantages of the present invention have been set forth in the foregoing description, together with details of the structure and function of the invention, the disclosure is illustrative only, and changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the invention to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
93136053 | Nov 2004 | TW | national |