CHDK/Modifying the CHDK Sources

Requirements
If you want to modify the existing CHDK sources to build your own version, you need the following things:


 * Knowledge of the programming language C. (online tutorials and resources)
 * A C development environment or an advanced texteditor with syntax highlighting (for example Notepad++) or at least a simple text editor to modify the source code.
 * The source code (How to get it).
 * Instructions how to compile the CHDK, which can be found here: Linux, Windows.
 * A SVN-client may be useful if you want to participate in the CHDK development or if you want to keep your own version always up-to-date (see here).

Procedure
The procedure itself is pretty straightforward: Try to figure out what the source code does, apply modifications as you see fit, compile it and test it on your camera.

Don't be afraid to change anything! From a safety point of view you can modify any files. There is no code in the sources which allows to update (rewrite) the original firmware. So, the worst thing which can happen is just that the new code wont work. If that happens, turn off the cam or remove the batteries, and everything should be fine again.

Source Guide
The Sourcecode
 * trunk - Vitaly's version. It does not contain as many features as GrAnd's version, which is why this is a good version for porting the CHDK to new cameras.
 * branches
 * grand - GrAnd's version. This is probably the one you are using on your camera and which you want to modify.
 * bin - Binaries. Normally empty. You will find your binaries here after compiling the source.
 * core - The core of the CHDK. If you like to add something or modify the existing functionality, this is probably the only folder you need to look into. (Maybe also 'lib' and 'include'.)
 * doc - Documentations. Not needed for compiling your own version.
 * fonts - Fonts. Not needed for compiling your own version.
 * include - Include files. Also see 'core'.
 * lib - Libraries: new C functions, mathematical functions, uBASIC, fonts. Also see 'core'.
 * loader - ???. No need to modify anything here (except perhaps if you want to port the CHDK onto a new camera model).
 * platform - ???. Only needed if you want to add new references to functions of the original firmware.
 * script - Example scripts. Not needed for compiling your own version.
 * tools - ???. Only needed if you want to add new references to functions of the original firmware.