A software routine that writes downloaded updated operating system
software over existing application code to flash memory of a cable modem
in an inverted arrangement. If the download process is interrupted before
the update can be verified, a pointer still points to the existing code
to facilitate update-interruption recovery. After verifying a successful
update, a new pointer is generated that points to the updated operating
system. Then, updated application code can be downloaded and stored in
the flash memory over the old operating system code.Thus, each time an
update is performed, the location of the operating system within the
flash memory with respect to the location of the application code is
inverted. This allows the size of flash memory to be reduced, as only one
copy of the operating system and application code must be stored, while
retaining capability to recovery from an incomplete download.