Electronic devices are ubiquitous in society, including business devices such as desktops, laptops, portables, servers, etc., as well as consumer devices such as music players, cell phones, cameras, digital video recorders, televisions, set-top boxes, game players, etc., as well as system components such as disk drives, solid state drives, printers, monitors, etc. An electronic device typically comprises a microprocessor executing code segments of a control program for controlling various operations of the electronic device. The control program is typically stored in a non-volatile memory, such as in a non-volatile semiconductor memory (e.g., a flash memory), or on a non-volatile disk (e.g., an optical or magnetic disk drive).
From time to time it may be desirable to update an electronic device with a new version of the control program. The control program may be updated by downloading a new version from a network (e.g., Internet, cellular network, cable network, etc.), or by the electronic device reading the new version from a removable storage medium (e.g., optical disk, flash card, USB drive, etc.). Typically it is desirable to update the control program in a fail safe manner to avoid rendering the electronic device inoperable if the program update is interrupted (e.g., due to a power failure).
Any suitable non-volatile memory 4 may be employed in the embodiments of the present invention, such as a disk of a disk drive or any suitable electrically erasable and programmable semiconductor memory (e.g., a flash). When the CP is updated with a new version, the non-volatile memory 4 may store multiple versions of the CP (the new version and one or more older versions). When the electronic device is re-booted, the control circuitry 14 evaluates the VIDs in the headers to determine which version of the CP is the newest version. Any suitable VID may be employed in the embodiments of the present invention, such as a sequential number where the VID having the highest number represents the newest version of the CP. In an alternative embodiment, the VID may comprise a date where the most recent VID represents the newest version of the CP.
In the embodiments of the present invention, each VID is stored in a header that corresponds to a respective CP as illustrated in
The VID check code in each header (e.g., VID check code 12A of
In one embodiment, the VID check code is generated over the VID as well as over the CP. For example, as the CP is downloaded into the electronic device the VID check code may be generated over the CP data. Once the CP data has been downloaded, the new VID may be generated and the VID check code updated in response to the new VID. A header comprising the VID and VID check code may then be stored in the non-volatile memory. In an alternative embodiment, the VID check code may be pre-generated and included with the CP when downloaded into the electronic device. The VID check code may then be updated by the control circuitry 14 after the control circuitry 14 generates the corresponding VID. In yet another embodiment, the VID may be included with the CP when downloaded, and the VID check code may be pre-generated over both the CP and the VID.
In one embodiment, when the electronic device is booted (e.g., powered on), it finds the header record storing the VID corresponding to the newest version of the CP. The control circuitry then reads the CP and generates a validation check code over the CP and the VID. If the validation check code matches the VID check code, the CP and VID are validated so that the CP may be executed. If the validation check code does not match the VID check code, it means the corresponding CP is invalid. When this happens, the control circuitry selects an older version of the CP to execute so that the update to the new version of the CP can be restarted. This embodiment is understood generally from the flow diagram of
In the embodiment where the VID check code is generated over both the VID and the CP, it requires the control circuitry to read both the VID and the CP from the non-volatile memory in order to generate the validation check code. In an alternative embodiment shown in
In one embodiment, the VID and VID check code are not stored in the non-volatile memory until after the new version of the CP has been received and stored in the non-volatile memory (and optionally validated). In this manner, if an error occurs (e.g., a power failure) while downloading the new version of the CP, the corresponding header will not have been updated and will therefore be ignored by the control circuitry during the next boot. This embodiment is understood with reference to the flow diagram of
In one embodiment, the control circuitry maintains only one copy of the CP in the non-volatile memory wherein the older version of the CP is erased. This embodiment is understood with reference to the flow diagram of
In one embodiment, the header of an older CP version may be invalidated (e.g., cleared) with or without erasing the corresponding CP. In either case, invalidating the header of an older CP version may improve performance during the next boot cycle of the electronic device by reducing the number of headers the control circuitry needs to evaluate. For example, if there is only one valid header, the control circuitry can immediately begin to read and execute the corresponding CP without needing to check the VID of other headers.
In one embodiment, the control circuitry maintains at least two versions of the CP in the non-volatile memory so there is redundancy in the event that one version becomes corrupted. An example of this embodiment is illustrated in
The control circuitry for implementing the embodiments of the present invention within an electronic device may comprise any suitable circuitry, such as any suitable integrated circuit or circuits. In one embodiment, the control circuitry comprises a microprocessor executing instructions, the instructions being operable to cause the microprocessor to implement the embodiments described herein. The instructions may be stored in any suitable computer-readable medium. In one embodiment, the instructions may be stored in a non-volatile semiconductor memory external to the microprocessor, or integrated with the microprocessor in a system on a chip (SOC).
Number | Name | Date | Kind |
---|---|---|---|
6640334 | Rasmussen | Oct 2003 | B1 |
7185191 | Bosley et al. | Feb 2007 | B2 |
7197634 | Kruger et al. | Mar 2007 | B2 |
7299463 | Brannock et al. | Nov 2007 | B2 |
7392518 | Chhabra et al. | Jun 2008 | B1 |
7421688 | Righi et al. | Sep 2008 | B1 |
7426633 | Thompson et al. | Sep 2008 | B2 |
7533290 | Chen | May 2009 | B2 |
7558915 | Cherian et al. | Jul 2009 | B2 |
7911906 | Weirauch et al. | Mar 2011 | B2 |
8255896 | Wontorcik et al. | Aug 2012 | B2 |
8347282 | Yoshimura et al. | Jan 2013 | B2 |
20050108701 | Kwon et al. | May 2005 | A1 |
20060117314 | Sato | Jun 2006 | A1 |
20070174832 | Brehm et al. | Jul 2007 | A1 |
20070288914 | Brannock et al. | Dec 2007 | A1 |
20080250403 | Moon et al. | Oct 2008 | A1 |
20080256527 | Lee et al. | Oct 2008 | A1 |
20090064124 | Chung | Mar 2009 | A1 |
20090064125 | Venkatachalam et al. | Mar 2009 | A1 |
20090125897 | Matlin et al. | May 2009 | A1 |
20090282399 | Kamrowski | Nov 2009 | A1 |
20100169709 | Chiu et al. | Jul 2010 | A1 |
20110138374 | Pal | Jun 2011 | A1 |
20110208975 | Sibert | Aug 2011 | A1 |
20110296399 | Tugnawat et al. | Dec 2011 | A1 |
20120124568 | Fallon et al. | May 2012 | A1 |
Entry |
---|
Sparv Systems, Version Control Best Practices for Enterprise Architect, 2010, pp. 4-17. |
LAS 1.2, LAS Specification Version 1.2, 2008, pp. 2-6. |
Jannik Laval, Supporting Simultaneous Versions for Software Evolution Assessment, 2010, pp. 3-8. |
Curits E. Stevens, “Information technology—AT Attachment 8—ATA/ATAPI Command Set (ATA8-ACS)”, T13/1699-D, Revision 6, Jun. 25, 2008, http://www.t13.org, pp. 107-109. |
Ralph O. Weber, “Information technology—SCSI Primary Commands—4 (SPC-4)”, T10/1731-D, Revision 30, Mar. 31, 2011, http://www.t10.org, pp. 397-403. |