CHDK Wiki
Register
(→‎Introduction: - removed unneeded content)
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
{| align="right" style="border-collapse:collapse; font-size: x-small;"
  +
| __TOC__
  +
|}
 
==Introduction==
 
==Introduction==
This wiki page describes every files used in CHDK development that might need to be customized for a port to a new camera. Each entry briefly describes what information the file contains, has a little bit about where to find that information and some pointers to what might go wrong if those values are wrong.
+
This wiki page describes every file used in CHDK development that might need to be customized for a port to a new camera. Each entry briefly describes what information the file contains, has a little bit about where to find that information and some pointers to what might go wrong if those values are wrong.
 
''At some point this will probably need to be broken across several pages.''
 
''At some point this will probably need to be broken across several pages.''
  +
 
==Files Customized for each Firmware Version of a Camera==
 
==Files Customized for each Firmware Version of a Camera==
''(in trunknnnn/platform/cameraname/sub/firmwareversion)''
+
''(in trunk/platform/cameraname/sub/fwversion)''
===Address files===
+
===stubs_entry_2.S===
  +
This file is used to for all the addresses that are not discovered automatically during the CHDK build process. In the build process, a "find signature" routine is used to examine a dumped file for the camera firmware called "primary.bin". It looks for matches to know code sequences for routines in the camera ROM that CHDK wants to use. If it does not find such a match, or finds a poor match, then the correct address needs to be entered in stubs_entry_2.S. You need to examine stubs_entry.S and find replacements for any routine not identied 100% or satisfy yourself that the found routine is correct.
   
  +
There may also be addresses not included in stubs_entry.S that need to be added to stubs_entry_2.S - typrically because they are for routines not needed when the original "find signature" code was written.
====stubs_entry_2.S====
 
   
====lib.c====
+
===lib.c===
  +
This file contains constant values and addresses related to the camera's LCD size, the image sensor size and the buffers used by the camera to hold image data. These values are used to scale the CHDK GUI and to enable RAW&DNG capture and motion detection.
   
====stubs_min.S====
+
===stubs_min.S===
  +
This file contains addresses or offsets in camera RAM when the camera maintains values related to its operation. There are also two values pointing to locations in ROM>
 
===boot.c===
  +
This file contains the code for three CHDK task - boot, PhySw and file_modules. The boot task is the first code executed by CHDK after it is loaded into RAM by the boot loader. In addition to setting up CHDK, it initiates the task hooks for the other CHDK tasks. The PhySw task intercepts camera key presses, allowing CHDK to respond to them before the Canon firmware sees them. The file_modules task adds FAT32 capability to CHDK.
   
  +
Code for these task is dissassembled from the camera firmware and CHDK specific hooks are inserted.
===Executable code task files===
 
   
====boot.c====
+
===capt_seq.c===
   
====capt_seq.c====
+
===movie_rec.c===
   
====movie_rec.c====
 
   
 
===Makefile===
===Files related to compiling (modification not needed)===
 
   
====Makefile====
 
   
====makefile.inc====
+
===makefile.inc===
   
====stubs_asm.h====
+
===stubs_asm.h===
   
====stubs_entry.S====
+
===stubs_entry.S===
   
====stubs_auto.S====
+
===stubs_auto.S===
   
===other files===
+
===primary.bin===
====primary.bin====
 
   
 
==Files Customized for all Firmware Versions of a Camera==
 
==Files Customized for all Firmware Versions of a Camera==
===(in trunknnnn/platform/cameraname)===
+
'''''(in trunk/platform/cameraname)'''''
====kdb.c====
+
===kdb.c===
   
====lib.c====
+
===lib.c===
   
====main.c====
+
===main.c===
   
====Makefile====
+
===Makefile===
   
====notes.txt====
+
===notes.txt===
   
====platform_camera.h====
+
===platform_camera.h===
   
====shooting.c====
+
===shooting.c===
   
====wrappers.c====
+
===wrappers.c===
   
===''(in trunknnnn/loader/cameraname/)''===
 
   
====blobs.S====
 
   
 
'''''(in trunk/loader/cameraname/)'''''
====entry.S====
 
   
====main.c====
+
===blobs.S===
   
 
===entry.S===
Makefile
 
   
  +
===main.c===
===''(in trunknnnn/loader/cameraname/resetcode)''===
 
 
===Makefile===
   
====entry.S====
 
   
====main.C====
 
   
 
'''''(in trunk/loader/cameraname/resetcode)'''''
====Makefile====
 
  +
 
===entry.S===
  +
 
===main.c===
  +
 
===Makefile===
   
 
==Files Customized in Main Code Files for Specific Cameras ==
 
==Files Customized in Main Code Files for Specific Cameras ==
 
====trunk/core/gui.c====
 
====trunk/core/gui.c====
  +
*short cut key buttons - adjustable ALT button - raw exceptions
 
<p style="margin-left: 40px; ">- short cut key buttons
 
- adjustable ALT button
 
- raw exceptions</p>
 
   
 
====trunk/core/gui_menu.c====
 
====trunk/core/gui_menu.c====
 
*customized menu space
   
- customized menu space
 
 
====trunk/core/kbd.c====
 
====trunk/core/kbd.c====
 
*ZSTEP_TABLE_SIZE, nTxtbl if camera supports syncable remote
 
*custom shoot processing
   
 
-ZSTEP_TABLE_SIZE, nTxtbl if camera supports syncable remote
 
- custom shoot processing
 
 
====trunk/core/main.c====
 
====trunk/core/main.c====
 
* customized dump_memory for IXUS65 only
 
- customized dump_memory for IXUS65 only
 
 
====trunk/core/raw.c====
 
====trunk/core/raw.c====
 
* customize gammma value calculations for sx30 & G12
   
- customize gammma value calculations for sx30 & G12
 
 
====trunk/include/kbd.c====
 
====trunk/include/kbd.c====
 
* customize USB_MASK (belongs elsewhere)
   
 
====trunk/platform/generic/shooting.c====
- customize USB_MASK (belongs elsewhere)
 
 
* customized shooting_get_drive_mode() for some cameras
====trunk/generic/shooting.c====
 
 
* custom hacks for iris control of sx30 & g12
 
* strange vague hack for CAMERA_ixus800_sd700
   
 
====trunk/platform/generic/wrappers.c====
- customized shooting_get_drive_mode() for some cameras
 
 
* assorted hacks for functions not found in stubs_entry.S for G12, SX30, S95
 
- custom hacks for iris control of sx30 & g12
 
 
- strange vague hack for CAMERA_ixus800_sd700
 
====trunk/generic/wrappers.c====
 
 
- assorted hacks for functions not found in stubs_entry.S for G12, SX30, S95
 
   
 
==Files Customize to Add a New Camera or Firmware Version to CHDK==
 
==Files Customize to Add a New Camera or Firmware Version to CHDK==
Line 110: Line 111:
 
====Makefile====
 
====Makefile====
 
====makefile.inc====
 
====makefile.inc====
  +
  +
[[Category:Development]][[Category:CHDK internals]]

Latest revision as of 19:53, 25 June 2011

Introduction

This wiki page describes every file used in CHDK development that might need to be customized for a port to a new camera. Each entry briefly describes what information the file contains, has a little bit about where to find that information and some pointers to what might go wrong if those values are wrong. At some point this will probably need to be broken across several pages.

Files Customized for each Firmware Version of a Camera

(in trunk/platform/cameraname/sub/fwversion)

stubs_entry_2.S

This file is used to for all the addresses that are not discovered automatically during the CHDK build process. In the build process, a "find signature" routine is used to examine a dumped file for the camera firmware called "primary.bin". It looks for matches to know code sequences for routines in the camera ROM that CHDK wants to use. If it does not find such a match, or finds a poor match, then the correct address needs to be entered in stubs_entry_2.S. You need to examine stubs_entry.S and find replacements for any routine not identied 100% or satisfy yourself that the found routine is correct.

There may also be addresses not included in stubs_entry.S that need to be added to stubs_entry_2.S - typrically because they are for routines not needed when the original "find signature" code was written.

lib.c

This file contains constant values and addresses related to the camera's LCD size, the image sensor size and the buffers used by the camera to hold image data. These values are used to scale the CHDK GUI and to enable RAW&DNG capture and motion detection.

stubs_min.S

This file contains addresses or offsets in camera RAM when the camera maintains values related to its operation. There are also two values pointing to locations in ROM>

boot.c

This file contains the code for three CHDK task - boot, PhySw and file_modules. The boot task is the first code executed by CHDK after it is loaded into RAM by the boot loader. In addition to setting up CHDK, it initiates the task hooks for the other CHDK tasks. The PhySw task intercepts camera key presses, allowing CHDK to respond to them before the Canon firmware sees them. The file_modules task adds FAT32 capability to CHDK.

Code for these task is dissassembled from the camera firmware and CHDK specific hooks are inserted.

capt_seq.c

movie_rec.c

Makefile

makefile.inc

stubs_asm.h

stubs_entry.S

stubs_auto.S

primary.bin

Files Customized for all Firmware Versions of a Camera

(in trunk/platform/cameraname)

kdb.c

lib.c

main.c

Makefile

notes.txt

platform_camera.h

shooting.c

wrappers.c

(in trunk/loader/cameraname/)

blobs.S

entry.S

main.c

Makefile

(in trunk/loader/cameraname/resetcode)

entry.S

main.c

Makefile

Files Customized in Main Code Files for Specific Cameras

trunk/core/gui.c

  • short cut key buttons - adjustable ALT button - raw exceptions

trunk/core/gui_menu.c

  • customized menu space

trunk/core/kbd.c

  • ZSTEP_TABLE_SIZE, nTxtbl if camera supports syncable remote
  • custom shoot processing

trunk/core/main.c

  • customized dump_memory for IXUS65 only

trunk/core/raw.c

  • customize gammma value calculations for sx30 & G12

trunk/include/kbd.c

  • customize USB_MASK (belongs elsewhere)

trunk/platform/generic/shooting.c

  • customized shooting_get_drive_mode() for some cameras
  • custom hacks for iris control of sx30 & g12
  • strange vague hack for CAMERA_ixus800_sd700

trunk/platform/generic/wrappers.c

  • assorted hacks for functions not found in stubs_entry.S for G12, SX30, S95

Files Customize to Add a New Camera or Firmware Version to CHDK

Makefile

makefile.inc