Code documentation - General Discussion and Assistance - CHDK Forum  

Code documentation

  • 9 Replies
  • 4285 Views
Code documentation
« on: 04 / May / 2009, 07:10:56 »
Advertisements
Hello,

I am a software developer and new to CHDK and very interested in the CHDK.
My questions is, is there any source code documentation available?
If I read e.g. kbd.c there is only poor documentation inside, very difficult to understand the 'big picture'.
If one wants to extend or improve code/functionality, it is important to understand the code first.
This would be much easier if a good documentation exists, is there any?

Thanks for any help, best regards.

2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Code documentation
« Reply #1 on: 04 / May / 2009, 07:21:43 »
there is http://chdk.setepontos.com/index.php?topic=2214.0
and then there is a wiki, in which the basic code is explained ( http://chdk.wikia.com/wiki/For_Developers ). But the code itself is commented very poorly, that is true.

Re: Code documentation
« Reply #2 on: 04 / May / 2009, 09:33:56 »
Hello Ailurus fulgens,

thanks for your reply, but this I already know.
Since this is an open source project, there should be a much better documentation available like it is now.
The so called 'CHDK sourcecode Documentation' (http://chdk.setepontos.com/index.php/topic,2214.0.html) does not really help. It just shows the code but without additional explanation.
I want to know which code function is related to which camera function. What is the code inside the functions doing.
Only the developer who originally programmed the functions, knows what the variables, subroutines, etc. are for.
But if the community (me included) can/should improve, it is mandatory that the code is explained in more detail to the community.
E.g. I want to know more details about the USB port of the camera (my one is IXUS 860 IS). But I cannot find annything.
What can I do?

2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Code documentation
« Reply #3 on: 04 / May / 2009, 10:20:11 »
you cannot find anything related to usb port because there is no code related to usb. besides the voltage detection, USB has not been tampered with and will probably never be. but there are tons of threads about that.
oh, and not only a programmer can "read the code". everybody can do that, even without comments. of course it is more difficult. but for example there is no obfuscated code in chdk.
« Last Edit: 04 / May / 2009, 10:22:03 by Ailurus fulgens »


Re: Code documentation
« Reply #4 on: 04 / May / 2009, 12:26:55 »
yes, everyone can read the code, but reading and understanding is different ;-)
I don't understand what you said regarding the USB port. There must be a way to use the USB port also to send out data not only detect the power.
The USB port in the cam is used to send data to the PC so there must be a way to put some data to the USB port. This is what I want to investigate, is there any chance?
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Code documentation
« Reply #5 on: 04 / May / 2009, 12:37:16 »
there must be a way to put some data to the USB port. This is what I want to investigate, is there any chance?

No.
If every single line of the existing CHDK code was commented in the greatest detail, it would not help you solve that problem.

You have to download the firmware dump of your chosen camera, disassemble it and then spend months trying to see if your requirement is even possible.

If you succeed, it will be the greatest CHDK achievement to date.

I am not being sarcastic, that is how difficult it is.


David
« Last Edit: 04 / May / 2009, 12:38:59 by Microfunguy »

*

Offline pev69

  • **
  • 55
Re: Code documentation
« Reply #6 on: 04 / May / 2009, 12:45:23 »
Yes, there is chance for USB, the PtP functionality exists (evidenced e.g. by the SX1 2.00h firmware update that includes a program to directly transfer the update to the camera), BUT it requires YOU to reverse-engineer it from the firmware, as that has not been done yet (or nobody has put it in public writing/code). Please do that, it would be great  :D

As for understanding CHDK code, it is not that hard really (if you have some skill ;)). I myself had to first put it through a pretty printer (Artistic Style is very handy and free), but then understanding it is quite easy. The only thing I have missed a little more are explanations of some of the used firmware functions.

EDIT: Sorry, it is not guaranteed the USB PtP exists for all cameras, as Microfunguy hinted :). I was thinking too much about my camera only (SX1).
« Last Edit: 04 / May / 2009, 12:50:33 by pev69 »

*

Offline fe50

  • ******
  • 3147
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Code documentation
« Reply #7 on: 04 / May / 2009, 14:28:44 »
The FW uploader (see here) is known to work with many cameras, e.g. the A6xx series, SD400, SD870...
Since it can transfer all kind of files to the camera, this could be a good starting point for reverse engineering...


Re: Code documentation
« Reply #8 on: 04 / May / 2009, 15:46:32 »
Hi all,

at first I want to say I have some skills, I develop software since I am 10 years old in different languages, such as C, C++, Assembler. So with a little training and study period I should understand the basics.
What I need is to setup an dissassembling environment first and get familiar with it. Then I need a hook where I can find anything what is related to USB.
Since I have a IXUS 860 IS there is no VxWorks but DryOS (am I right?)
Right now I am not familar with DryOS, but I believe there are some USB functions included already. May we can access from the CHDK?

Any hints are welcome!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

Re: Code documentation
« Reply #9 on: 04 / May / 2009, 16:36:40 »
What I need is to setup an dissassembling environment first and get familiar with it.

See this.

Quote
Then I need a hook where I can find anything what is related to USB.
 I believe there are some USB functions included already. May we can access from the CHDK?


Using IDA you will find the addresses of many functions that appear to be related to USB or file transfer.


What then ?




David

 

Related Topics