programming a program that allows for updates

Questions about programming languages and debugging
Post Reply
User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
17
Location: 127.0.0.1
Contact:

programming a program that allows for updates

Post by floodhound2 »

I program a lot of embedded firmware / operating systems for electronics devices. My question is how would I design my firmware to allow for updates? Do I need to create arrays that themselves are arrays? Any ideas will be appreciated. I am speaking about “code structure” in general.

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hmm....do you mean to update the firmware partially? like "only function X is added but the rest of the firmware stays untouched"?
well, I am not much of a coder as you know, but I think taking a look at the source of the Linux "patch" command might be useful:
http://www.gnu.org/software/patch/patch.html

:wink:

User avatar
floodhound2
∑lectronic counselor
∑lectronic counselor
Posts: 2117
Joined: 03 Sep 2006, 16:00
17
Location: 127.0.0.1
Contact:

Post by floodhound2 »

Yea thanks BB I guess I figured it out.

My main problem is that I have learned a specific coding style and I am trying to open my eyes to different techniques and styles. One may use a LOOP where another may use an array of IF statements, etc. I really need a good book that does not teach a specified language, but instead the different ways to use logic and conditions within the program.

:wink:

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

so it is possible to flash an EEPROM partially to add new features for example? I always thought you can only flash the whole content at once....or are you using another medium for your firmware like Flash memory? :-k

User avatar
DNR
Digital Mercenary
Digital Mercenary
Posts: 6114
Joined: 24 Feb 2006, 17:00
18
Location: Michigan USA
Contact:

Post by DNR »

there is a Manufacture standard for allowing updates to firmware, in hacker terms its called phlashing. You need to work with protocol TFTP- Trivial File Transfer Protocol.
http://en.wikipedia.org/wiki/Trivial_Fi ... r_Protocol

Any system that has network connection, or even a diskdrive port can have its firmware 'reflashed'." Wireless routers, network cameras, and printers require remote access to be upgraded. This could be over the network or just a USB cable. Unfortunately most devices go unpatched because of this lack of easy access. The upgrade procedure can be very insecure too. The last time we flashed a custom firmware on our La Fonera we had to set up a TFTP server for it to download the firmware from. The TFTP protocol has no authentication, so anyone could pose as the server and offer a bad firmware for download. Many embedded system upgrade tools use TFTP because of its ease of implementation and low hardware overhead."


Permanent Denial of Attack on firmware upgrade
http://www.darkreading.com/security/man ... =211201088

http://hackaday.com/2008/05/20/phlashin ... -new-hype/

So you want to consider what communication method to use (USB port, SD port, network connection, etc) and use the TFTP protocol, but lock it down!

DNR
-
He gives wisdom to the wise and knowledge to the discerning. He reveals deep and hidden things; he knows what lies in Darkness, and Light dwells with him.

Post Reply