Method and apparatus for downloading executable code in a non-disruptive manner

Information

  • Patent Application
  • 20040044997
  • Publication Number
    20040044997
  • Date Filed
    August 27, 2002
    22 years ago
  • Date Published
    March 04, 2004
    20 years ago
Abstract
A method and apparatus for achieving a non-disruptive code load that includes staging the new version of executable code, stacking the hardware events during code copy and code switch over, copying the code into the runtime area, restarting the system upon completion of copying the new code without reinitializing the hardware and processing the stacked hardware events with the same system state (hardware and firmware) information.
Description


FIELD OF THE INVENTION

[0001] The present invention relates generally to downloading firmware code onto a processor controlling hardware devices. More particularly, the present invention relates to downloading firmware code to a processor in an active system such that it does not disrupt the system operation (hardware and firmware).



BACKGROUND OF THE INVENTION

[0002] The field of computer technology advances at almost a lightening pace. Equipment rarely has more than a five-year life. In most instances, the life is only two to three years. In some instances, it is possible to replace various pieces of the equipment. In other instances, all that is required is an upgrade of the firmware or firmware. The problem arises in that system up time is required to be approximately one hundred percent in today's world of the Internet. Computer equipment owners demand near perfect operation of their equipment. Owners talk in terms of anything less than 99.999% availability as being unacceptable.


[0003] Shutting down a computer system can cost a company thousands and thousands of dollars for each hour the system remains unavailable. Upgrades of computer equipment usually result in some downtime of the processing. This has resulted in technology assistants upgrading equipment at odd hours of the morning. This results in additional costs to the company as well. Even this has become difficult due to different time zones and globalization.


[0004] Firmware upgrades on larger computer systems are needed to add additional features or fix reoccurring problems or bugs. In light of the financial consequences of shutting down a system, there is a need to upgrade firmware without disrupting the system operation. Prior systems involve halting the realtime system, while the upgrade in code is performed. This is not ideal for the aforementioned reasons. Furthermore, the owner of the equipment is more reluctant to perform upgrades or fix bugs unless absolutely necessary.


[0005] Accordingly, it is desirable to provide an apparatus and method that enables the owner of computer systems to upgrade their firmware to add new features or fix firmware bugs without any system down time. The computer system would run or operate in real time and continue to process requests.



SUMMARY OF THE INVENTION

[0006] It is therefore a feature and advantage of the present invention to provide a method and apparatus for downloading a new version of an executable code onto a system without the need to bring the system to a halt, thereby sacrificing system up time.


[0007] It is another feature and advantage of the present invention to provide a fast and efficient means of processing time to upgrade a system to the new version of code.


[0008] The above and other features and advantages are achieved through the use of a novel fixed area to store state information as well as keeping key components of the previous version of executable code from being upgraded as herein disclosed. In accordance with one embodiment of the present invention, a non-disruptive code load apparatus can include a storage device for storing state information for a computing system such that the state information is retained through a new version of executable code, a staging device for receiving a new version of executable code and a runtime area or processing area that receives the new version of executable code. Upon executing the new version of executable code, the system is restarted and the old version of executable code removed from the system. The system is restarted from the last state prior to the code upgrade.


[0009] In another embodiment of the invention, the code is transferred from the staging area to the runtime area with the copy part of the old version of executable code. This copy part of the executable code remains the same through all the upgrade versions.


[0010] In another embodiment of the invention, the state information is stored in a memory device. The staging area for the new version of executable code is also stored in a memory device such as random access memory.


[0011] In another aspect of the invention, a method for non-disruptive code loading includes staging a new version of executable code, transferring the executable code to a runtime area and restarting a system with the new version of the executable code without reinitializing the hardware and the system (hardware and firmware) state information.


[0012] During operation of the system, state/runtime information concerning the system is stored in a fixed area. This fixed area and the state information contained therein is not altered or changed during upgrades of the executable code.


[0013] The transferring of the new version of executable code can be achieved with the copy part of the previous version of the executable code. As a result, the copy part of the code remains the same between these upgrades.


[0014] In another aspect of the present invention, a non-disruptive code load apparatus includes means for staging a new version of executable code, means for transferring the executable code to a runtime area and means for restarting a system with the new version of the executable code. A further element includes means for storing state information about the system in a fixed area, which is not altered with new version of the executable code without reinitializing the hardware and the system (hardware and firmware) state information.


[0015] In a further aspect of the present invention, a method for non-disruptive code loading includes storing state information about a system in a fixed area that is not altered upon a new version of executable code, staging the new version of executable code in memory, copying the executable code to a runtime area and restarting the system with the new version of the executable code wherein the new executable code uses the same system state information.


[0016] There has thus been outlined, rather broadly, the more important features of the invention in order that the detailed description thereof that follows may be better understood, and in order that the present contribution to the art may be better appreciated. There are, of course, additional features of the invention that will be described below and which will form the subject matter of the claims appended hereto.


[0017] In this respect, before explaining at least one embodiment of the invention in detail, it is to be understood that the invention is not limited in its application to the details of construction and to the arrangements of the components set forth in the following description or illustrated in the drawings. The invention is capable of other embodiments and of being practiced and carried out in various ways. Also, it is to be understood that the phraseology and terminology employed herein, as well as the abstract, are for the purpose of description and should not be regarded as limiting.


[0018] As such, those skilled in the art will appreciate that the conception upon which this disclosure is based may readily be utilized as a basis for the designing of other structures, methods and systems for carrying out the several purposes of the present invention. It is important, therefore, that the claims be regarded as including such equivalent constructions insofar as they do not depart from the spirit and scope of the present invention.







BRIEF DESCRIPTION OF THE DRAWINGS

[0019]
FIG. 1 is a block diagram illustrating several elements of a preferred embodiment of the present invention.


[0020]
FIG. 2 is a diagram illustrating the interaction between the shadow area and runtime area of the present invention.


[0021]
FIG. 3 is a block diagram of an alternate embodiment of the present invention.







DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS OF THE INVENTION

[0022] A preferred embodiment of the present invention provides an apparatus for downloading executable code in a manner that is non-disruptive to the system such that the system is able to continue operating without the need to sacrifice any system down time.


[0023] In the compiling of most high-level computer programming languages such as C, the resulting output generally partitions the memory usage into three default sections. The first is a text section, which is the machine level instructions, the native assembly code. This section appears as part of the binary output file. The second section is labeled the data section, which is initialized data. The data section contains any literal data values or strings that may be acted upon. The data section can consist of initialized global and/or private data, as well as constant data. This section appears as part of the binary output file. The third and final section is labeled Bss, which is unintialized data. This section represents data structures that exist in code, but are not initialized at compile time. It is assumed that they are initialized before used during execution. This section is part of the binary file.


[0024] A programmer may create other memory sections, assign variables, code and data program elements to each section as desired. A programmer may then assign these sections to specific locations in memory. In general, these new additional sections derive from one of the three default sections, text, data and Bss.


[0025] In the preferred embodiment, the executable code is written such that any information that needs to persist between code revisions is assigned to a specific user defined memory section known as the fixed_data section. Some of the information that is saved in this section is the system (hardware and firmware) state information, volatile data information and runtime information that is required to be preserved between these code revisions.


[0026] The make-up of the fixed_data section is rigid. It is usually at approximately the same memory location through every code revision. The layout of this section is approximately the same except for addition at the end of the section. However, it is possible for this section to be adjusted based on the programmer's needs or requirements. For example, this section may be enlarged to support new data elements for new features in newer executable code versions. In the preferred embodiment, this section is given a maximum allocation limit to which it may expand. This occurs upon the original design limitation of the programmer. Therefore, it is important that the programmer leave sufficient space to grow with new versions of the code. In the preferred embodiment, the obsolete features, e.g. data elements no longer used, remain in this section to preserve its integrity and fixed layout. Furthermore, the fixed_data section derives from the Bss section (unintialized) category and is not part of the binary output file that is generated upon compiling the code.


[0027] Another user defined memory section of the executable code is the copier section or function. This section consists of usually a fixed number of lines of code, approximately fifty, that in the preferred embodiment, does not change between code revisions. The copier section is written in assembly language to ensure that this code is not altered as well as to be extremely fast. The assembly language, the basic language of all computing devices, requires less translation and compiling and therefore less processing time. This results in a fast efficient process.


[0028] In the preferred embodiment of the present invention, the copier section's purpose is to copy code from one area of the memory to another. The copier section is derived from the text section and is part of the binary output file.


[0029] A preferred embodiment of the present inventive apparatus and method is illustrated in FIG. 1, which is a block diagram illustrating several elements of a preferred embodiment of the present invention. The present invention is used with the channel director product, CD/9000, of Inrange Technologies Inc. Lumberton, N.J. The new version 102 of executable code is presented to the system 104 for upgrade purposes. The upgrade of firmware code occurs due to individual feature specific needing upgrade or a need to upgrade the overall ability of the code.


[0030] The system 104, at its most basic level includes a processor 106, shadow area 108 and a runtime area 110. The new code 104 or version 102 is assembled outside the system 104 and made available for incorporation therein. The shadow memory 108 accepts the initial download of the new version 102 of executable code. In other words, the shadow area 108 is essentially a staging area prior to the new version 102 taking effect in the system 104. Once the new version 102 is placed in the shadow area 108, the system waits for an opportunity to transfer it to the runtime area 110 via the copier section of the code of the executable code in the runtime area.


[0031] The shadow area 108 is a section of memory reserved for staging the new version 102. The new code is staged in this shadow area 108 to take advantage of the fast transfer of data from one memory location, shadow area 108, to another area, runtime area 110. The fast transfer is accomplished by maintaining the copier section of the code through all upgrades of the executable firmware. While the new code is being loaded into the shadow area 108, the current or older code in the system continues to operate. Essentially, the new version 102 is loaded as a background event.


[0032] The runtime area 110 is a part of the memory where processor 106 executes the executable code. The memory area consists of all memory sections, the normal text, Data and Bss sections as well as the user defined fixed_data section and copier functions. Once the new version 102 is loaded, the system 104 and its firmware is requested to switch to the new code. The current firmware then stops processing all the hardware events, after time sensitive events are completed. Maximum time to process these pending hardware events is less than the actual code switching time from old code to new code. During the switching time, hardware events of the system 104 are stacked in the hardware since the design requires the hardware events to be processed by the firmware. When the new code does begin to execute or run, the common database, firmware state information and hardware are not initialized. Since the firmware is state driven and new hardware events are stacked, the preferred embodiment allows non-disruptive executable code load. The preferred embodiment stops the system 104 operation while switching to the new version 102 from shadow area 108 to runtime area 110. With the CD/9000 FICON Bridge QPA product from Inrange Technologies, the elapsed time is approximately fifty milliseconds.


[0033] The executable code does not initialize the hardware, which it is controlling, during restart. Hardware events, which occur during the code switch over are not processed during the code switch over. System requires hardware events to be acknowledged by the firmware. Since system states (hardware and firmware) are saved during the code switch over, new executable code processes pending hardware events, without disrupting the system operation.


[0034]
FIG. 2 is a diagram illustrating the interaction between the shadow area 108 and runtime area 110 of the present invention. This diagram shows the memory layout for the shadow area 108 and the runtime area 110 of the system 104. Each memory location includes a copier section 200, 202, a text section 204, 206, a data section 208, 210, and a Bss section 212, 214. The runtime area 110 also includes a fixed_data section 216.


[0035] In the preferred embodiment, some sections of the memory have fixed start addresses as well as a maximum expansion size. The actual size however is dependent upon each code release. However, the size allocated to the code downloaded into the system is usually chosen to be large enough to allow for code expansion for various versions or upgrades of the executable code.


[0036] Fixed addresses in FIG. 2 are denoted with solid lines and varying addresses are denoted with dashed lines. In general, the varying end address is limited by the fixed start address of the next section.


[0037] The diagram of FIG. 2 shows an order of the fixed section 216 of the memory. This orientation is completely arbitrary. However, in the preferred embodiment, the other sections of memory, are grouped together. Again this is not by design but due to the default. For example, the copier section 200, the text section 204 and the data section 208 are coupled because this is essentially the downloaded file. This is also the output file from the compiler. With regard to the Bss sections 212, 214, they appear immediately after the data section. However, like the previous section, this position is the default set by most compilers. Note that the memory addresses in the runtime area 108 are hardlinked. This means that the compiler is expecting the code to run at these locations.


[0038]
FIG. 3 is a block diagram of an alternate embodiment of the present invention. In this embodiment, the new version 102 of executable code is staged in step 300 into the shadow area 108. The new code is not running or executed but merely resident in memory. As stated previously, the staging 300 the new version 102 is done as a background process and is not time critical unless so desired.


[0039] After staging step 300, the system waits for an opportunity to copy the new code version 102 from shadow area 108 to runtime area 110 in step 302 and restart step 304. The copy and restart stages 302 and 304 are time critical and usually must take place within a short period of time. In one embodiment of the invention, the time criticality is several milliseconds and generally less than ten milliseconds.


[0040] When the system 104 determines a good opportunity to copy new version 102 from shadow 108 to runtime area 110, system interrupts are disabled and the copying step 302 process begins. The system does not always need to make a determination of when to begin the copying step 302 of the new version 102 of the executable code from shadow area 108 to the runtime area 110. The system, through artificial means, can be forced to begin the copying process.


[0041] During the copying process 302, no other code is executed in the system 104. Furthermore, during the copying process 302, the copier process 302 overwrites its instruction memory as it is executing these instructions. Therefore, the present inventions relies on the premise that the copier section 200 of the code is not altered or changed from one version to the other.


[0042] Once the copying process 302 has ceased, the new version 102 of executable code is restarted. The code is made to restart in step 304 or reboot in a fast and efficient manner. To accomplish this, much of the initialization routine done through a traditional power-up is skipped, specially all the hardware initialization. In one preferred embodiment of the invention, the new version 102 of executable code is restarted at the same state the system 104 was in prior to the copying process 302.


[0043] The state/runtime information is stored in the fixed_data section 216 and is not altered during the whole copying process 302. Since the state/runtime information is stored in the fixed_data section, which is where the compiler expects it, there is no runtime time penalty. This runtime penalty is present on other applications that store and retrieve data the code loading process. With the present invention, there is no need to store and retrieve state information during the code loading process.


[0044] After the system is restarted in step 304, the new code effectively begins to operates, turn on interrupts and begins to process data as if there were no changes to the code. The processor 106 is momentarily occupied for approximately five milliseconds while the copying process 302 and the restart process 304 is taking place.


[0045] The new version of code is rarely of a size that in will fit within the space constraints of the shadow area 108. Therefore, it necessary in these instances to compress the new version 102, after it is compiled, prior to its download to the shadow area 108 after it has been compiled.


[0046] When the code 102 is compressed for a download situation, the code placed in the shadow area 108 is essentially the output of a compiled program. For the preferred embodiment, the output of the compiled file is essentially comprised of three sections: (i) the compressed exerciser; (ii) compressed runtime executable; and (iii) loader/decompresser. The first two pieces are compressed images of runtime executables. In an uncompressed state, the runtime executable can be run or executed by the processor. The runtime executable controls all the switching properties of the CD/9000 product. The other runtime executable, the exerciser, is a diagnostic program.


[0047] The loader/compressor is needed to decompress the runtime executable. The decompressor piece is the only executable capable of being run by the processor directly. The decompressor does not compress the exerciser image. This is done by a different processor that references the exerciser image at a later time.


[0048] Upon using a compressed file, during the copying stage control is passed to the loader/compressor section the output file. The decompressor decompresses the runtime executable to the runtime area. For slave QPAs, the partitioned designated quad-port adapter (QPA) then receives a command to retrieve the new code. This QPA then forwards the message to all the QPAs in the partition via a fabric broadcast mechanism. All the QPAs in the partition receive the message to retrieve and decompress the new runtime executable. The QPAs decompress the new executable to the shadow area while servicing switching functions.


[0049] Finally, the runtime executable copies the new versions 104 over itself. The new version 104 begins running or executing approximately where the old code left off, using the already initialized variable in the fixed_data section 216.


[0050] The many features and advantages of the invention are apparent from the detailed specification, and thus, it is intended by the appended claims to cover all such features and advantages of the invention, which fall within the true spirits, and scope of the invention. Further, since numerous modifications and variations will readily occur to those skilled in the art, it is not desired to limit the invention to the exact construction and operation illustrated and described, and accordingly, all suitable modifications and equivalents may be resorted to, falling within the scope of the invention.


Claims
  • 1. A non-disruptive code load apparatus, comprising: a shadow area that receives a new version of executable code; a runtime area linked to the shadow area, wherein the runtime area receives the new version of executable code; a copier in the runtime area, wherein the copier transfers the new version of executable code from the shadow area to the runtime area; and a fixed area present in the runtime area, wherein state information of a system receiving the new version of executable code is stored in the fixed area.
  • 2. The apparatus as in claim 1, further comprising a downloader in communication with the shadow area, wherein the downloader receives the new version of executable code and places it in the shadow area.
  • 3. The apparatus as in claim 1, wherein the copier device is not upgraded with the new version of executable code.
  • 4. The apparatus as in claim 1, wherein the system is restarted in the system state at approximately the system state prior to the restart of the system.
  • 5. The apparatus as in claim 4, wherein the state is stored in the storage device.
  • 6. The apparatus as in claim 1, wherein the fixed area is not reset with the new version of executable code.
  • 7. The apparatus as in claim 1, wherein the runtime area is a processor.
  • 8. The apparatus as in claim 1, wherein the staging device is a memory device.
  • 9. The apparatus as in claim 8, wherein the memory device is random access memory.
  • 10. A method for non-disruptive code loading, comprising the steps of: staging a new version of executable code; transferring the executable code to a runtime area; and restarting a system with the new version of the executable code.
  • 11. The method as in claim 10, further comprising storing state information about the system in a fixed area.
  • 12. The method as in claim 11, wherein the fixed area is not altered with new version of the executable code.
  • 13. The method as in claim 11, wherein the system state information is not altered with the new version of executable code.
  • 14. The method as in claim 10, wherein the transferring the executable code is accomplished by a copying command from a previous version executable code.
  • 15. The method as in claim 14, wherein the copying command is not updated with the new version of executable code.
  • 16. A non-disruptive code load apparatus, comprising: means for staging a new version of executable code; means for transferring the executable code to a runtime area; and means for restarting a system with the new version of the executable code.
  • 17. The apparatus as in claim 16, further comprising means for storing state information about the system in a fixed area.
  • 18. The apparatus as in claim 17, wherein the fixed area is not altered with new version of the executable code.
  • 19. The apparatus as in claim 17, wherein the state information is not altered with the new version of executable code.
  • 20. The apparatus as in claim 16, wherein the transferring the executable code is accomplished by means for copying present in the a previous version of executable code.
  • 21. The apparatus as in claim 14, wherein the means for copying is not updated with the new version of executable code.
  • 22. A method for non-disruptive code loading, comprising the steps of: storing state information about a system in a fixed area that is not altered upon a new version of executable code; staging the new version of executable code in memory; copying the executable code to a runtime area; and restarting the system with the new version of the executable code wherein the executable code uses the state information.