1. Field of the Invention
The invention relates to firmware extensions, and in particular, to a method for adding user customized functionalities into a baseline firmware image without compromising baseline firmware source codes.
2. Description of the Related Art
Firmware extension is generally required in a manufacture line of a product, especially between upstream suppliers and downstream vendors. An upstream supplier usually provides hardware bundled with a baseline firmware image, and when various additional applications are required to deploy on a single embedded system, a baseline firmware image can only provide basic functions that are incapable of performing the variable functionalities. Thus, the downstream vendor may need to further modify the baseline firmware image to provide additional features before selling the product. Conventionally, source codes are required to modify functionalities of the baseline firmware image, and release of the source codes is usually very undesirable for the upstream suppliers because confidential information involved with the hardware design may be compromised.
An exemplary embodiment of a firmware extension method is provided, particularly adaptable for an embedded system. Firstly, a baseline firmware image is provided with a header file. Secondly, an extension firmware image is generated based on the header file, comprising one or more extended functions. Thereafter, a callback table is generated, comprising pointers pointing to entries of the extended functions in the extension firmware image. The baseline firmware image, the extension firmware image and the callback table are then merged to generate a merged firmware image.
Furthermore, memory allocation parameters may also be provided, comprising a base address where the extension firmware image starts. The step of merging is therefore performed based on the memory allocation parameters.
The baseline firmware image may comprise an extension pointer for storing the entry of the callback table. The callback table comprises an enablement flag indicating whether the extended functions are enabled, and the baseline firmware image is programmed to conditionally load and execute the extended functions through the callback table based on the extension pointer and enablement flag.
The baseline firmware image may comprise a plurality of Application Program Interface (API) functions, and the header file declares the API functions whereby the API functions are usable by the extended functions.
To generate the extension firmware image, source codes of the extended functions and a symbol table are provided. The symbol table comprises pointers pointing to entries of the API functions. The source codes are then compiled with the header file and the symbol table to generate the extension firmware image.
In an alternative embodiment, a firmware builder is provided to implement the firmware extension method. The firmware builder comprises a compiler and a building module. The compiler compiles source codes of one or more extended functions into an extension firmware image based on a header file associated with the baseline firmware image. The building module merges the extension firmware image with the baseline firmware image to generate a merged firmware image. Specifically, the building module generates a callback table comprising pointers pointing to entries of the extended functions in the extension firmware image, whereby the building module merges the baseline firmware image, the extension firmware image and the callback table to generate the merged firmware image.
In a further embodiment, the callback table is generated by the compiler instead of the building module. The building module simply merges the extension firmware image, the baseline firmware image and the callback table to generate a merged firmware image. A detailed description is given in the following embodiments with reference to the accompanying drawings.
The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
a shows an embodiment of a merged firmware image;
b shows embodiments of a baseline firmware image and a symbol table based on
c shows embodiments of an extension firmware image and a callback table based on
a shows an embodiment of a firmware builder;
b is a flowchart of a firmware extension method according to the invention; and
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
a shows an embodiment of a merged firmware image. The merged firmware image 200 comprises a baseline firmware image 210 and an extension firmware image 220 linked with a callback table 222. The baseline firmware image 210 is provided by the upstream supplier, which stays uncompromised while merging with the extension firmware image 220. The uncompromised status means, by means of various known code protection techniques, the baseline firmware image 210 can be made executable but is difficult to be decompiled by reverse engineering. Meanwhile, the extension firmware image 220 is generated based on an open standard, allowing the downstream supplier to implement additional functions. Originally, the baseline firmware image 210 is stored in a memory device of an embedded system (not shown), and the capacity of the memory device is limited. The extension firmware image 220 and callback table 222 may be stored in free spaces of the memory device while the baseline firmware image 210 remains at the same place. To specify how much capacity is available in the memory device, the upstream supplier may provide a configuration field 202 recording memory allocation parameters such as the size of the free space, and a base address where the extension firmware image 220 should be allocated. In the embodiment, the baseline firmware image 210 is programmed to periodically or conditionally branch to the callback table 222 according to an extension pointer 204, such that extended functions in the extension firmware image 220 can be loaded and executed. Specifically, the entry address of the callback table 222 may be an absolute address on the memory device, obtained and written to the extension pointer 204 when merging the extension firmware image 220 and callback table 222.
b shows embodiments of a baseline firmware image 210 and a symbol table 212 based on
c shows embodiments of an extension firmware image 220 and a callback table 222 based on
a shows an embodiment of a firmware builder 300, by which the merged firmware image 200 in
As described, a configuration field 202 may be provided with the baseline firmware image 210, comprising memory allocation parameters such as available capacity for storage of the extension firmware image, and a base address where the extension firmware image starts. The memory allocation parameters are required so the compiler 320 can control the extension firmware image 220 size and correctly derive entry addresses of each function in the extension firmware image 220. The extension pointer 204 is a preserved area for storage of the entry of the callback table 222, and the enablement flag 224 in the callback table 222 defines whether the extended functions are enabled. The baseline firmware image 210 may periodically or conditionally trigger a sub-function call to check the enablement flag 224 via the extension pointer 204. For example, a timer may be configured, so that the extended functions are executed periodically. Certain events or interruptions may also be defined to trigger the sub-function call, and if the extended functions are enabled by the enablement flag 224, they are loaded and executed.
The baseline firmware image 210 may comprise a plurality of Application Program Interface (API) functions, and the header file #H is used as a reference to declare the API functions. A symbol table 212 is provided by the upstream supplier, comprising pointers pointing to entries of the API functions. The symbol table 212 may be part of the baseline firmware image 210, or an independent file as well as the header file #H. The downstream vendor may include the header file #H when producing the source codes #SRC, and the compiler 320 then compiles the source codes #SRC with the header file #H and the symbol table 212 to generate the extension firmware image 220 so that the API functions are usable by the extended functions. Basically, the firmware builder 300 may be a software module employed in the manufacturing stage of a product. As will be appreciated by person skilled in the art, the proposed firmware builder 300 can be stored in a non-transitory computer readable medium.
b is a flowchart of a firmware extension method according to the invention. The firmware extension method is particularly used when a downstream vendor intends to add new features into the original baseline firmware image, and the method does not require any source code from the upstream supplier. In step 301, the downstream vendor initiates the firmware extension process. In step 303, a baseline firmware image 210 is acquired from the upstream supplier, with a predefined configuration field 202, a header file #H and a symbol table 212. An extension pointer 204 is preserved for storage of a value, which is determined later on. In step 305, the downstream vendor produces source codes #SRC of one or more extended functions using the header file #H. In step 307, the source codes #SRC is compiled into an extension firmware image 220 with the header file #H reference. In step 309, a callback table 222 is established from the extension firmware image 220, comprising entry addresses of each extended functions. In step 311, the baseline firmware image 210, extension firmware image 220 and callback table 222 are merged into a merged firmware image 200. The merged firmware image 200 may be stored at the same memory device where the baseline firmware image 210 is provided, whereby the baseline firmware image 210 is replaced. In step 313, the extension pointer 204 is the baseline firmware image 210 and is updated with the entry address of the callback table 222, such that the callback table 222 can be referred to, to load the extended functions in the extension firmware image 220 when a sub-function call in the baseline firmware image 210 is conditionally triggered.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
The present application is a Continuation Application of U.S patent application Ser. No. 12/352,692, filed on Jan. 13, 2009, now U.S. Pat. No. 8,392,895, which is incorporated by reference herein.
Number | Name | Date | Kind |
---|---|---|---|
6219834 | Soroker et al. | Apr 2001 | B1 |
6954923 | Yates et al. | Oct 2005 | B1 |
7007159 | Wyatt | Feb 2006 | B2 |
7260848 | Zimmer | Aug 2007 | B2 |
7533368 | Ford | May 2009 | B1 |
7676800 | Kinney | Mar 2010 | B2 |
7694291 | Chen et al. | Apr 2010 | B2 |
7809918 | Samuel | Oct 2010 | B1 |
8271964 | Zorn et al. | Sep 2012 | B2 |
20020062400 | Holze et al. | May 2002 | A1 |
20030135848 | Krishnan | Jul 2003 | A1 |
20040015941 | Sekine | Jan 2004 | A1 |
20040030768 | Krishnamoorthy et al. | Feb 2004 | A1 |
20050010902 | Takacsi-Nagy et al. | Jan 2005 | A1 |
20050022161 | Burger et al. | Jan 2005 | A1 |
20050027971 | Williams et al. | Feb 2005 | A1 |
20050097523 | Uchida | May 2005 | A1 |
20050138610 | Terunuma | Jun 2005 | A1 |
20050246693 | Plum | Nov 2005 | A1 |
20050251583 | Rothman et al. | Nov 2005 | A1 |
20060020936 | Wyatt | Jan 2006 | A1 |
20060184924 | Hsieh | Aug 2006 | A1 |
20070079283 | Kuninobu et al. | Apr 2007 | A1 |
20070271080 | Tatsuoka et al. | Nov 2007 | A1 |
20070300150 | Davis | Dec 2007 | A1 |
20080052699 | Baker et al. | Feb 2008 | A1 |
20080072211 | Rothman et al. | Mar 2008 | A1 |
20080127066 | Kang Min et al. | May 2008 | A1 |
20080127136 | Hino et al. | May 2008 | A1 |
20090064124 | Chung | Mar 2009 | A1 |
20090126017 | Chahal | May 2009 | A1 |
20090144711 | Chang | Jun 2009 | A1 |
20090282399 | Kamrowski | Nov 2009 | A1 |
20100077387 | Callaghan et al. | Mar 2010 | A1 |
Number | Date | Country |
---|---|---|
1904853 | Jan 2007 | CN |
Entry |
---|
Feng Zhou, SafeDrive: Safe and Recoverable Extensions Using Language-Based Techniques, 2006, pp. 1-18. |
Maxim Grabarnik, Dynamic Offloading Infrastructure for Programmable Devices, 2007, pp. 24-34. |
Alexey Smirnov, A User-Level Development Environment for In-Kernel Network Protocol/Extension Implementations, 2005, pp. 2-10. |
Chinese language office action dated May 4, 2012. |
Mukesh Agrawal, Simplifying Distributed Application Upgrades with Simultaneous Execution, 2005, pp. 7-10. |
Sun Microsystems, Sun Storage Tek Common Array Manager Software Release Notes, 2008, pp. 26-29. |
Microsoft Corporation, Microsoft Portable Executable and Common Object File Format Specification, 1999, pp. 10-32. |
Number | Date | Country | |
---|---|---|---|
20130145353 A1 | Jun 2013 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 12352692 | Jan 2009 | US |
Child | 13755385 | US |