supplierdeeply

Porting chdk to the G9

  • 245 Replies
  • 60967 Views
  • Publish
    Re: Porting chdk to the G9
    « Reply #110 on: 20 / May / 2008, 15:56:30 »
    Advertisements
    Right lol, I should of posted after I found that because I did :P

    Compiled a build for the A720 (current trunk build) without a hitch and now I can see a lot more clearly what needs to be done, thanks =)

  • Publish
    Re: Porting chdk to the G9
    « Reply #111 on: 21 / May / 2008, 07:09:34 »
    if in my dump I see

    Code: [Select]
    000BB604   000BB604      0   gaonisoyP
    and we know the memory loads at FF81000, this gives me an offset of my own dump of +4285876732 to add to my own dump addresses

    However when I found this in my dump

    Code: [Select]
    0012B654   0012B654      0   TurnOnBackLight
    0012B664   0012B664      0   TurnOffBackLight

    and converted TurnOnBackLight to ff880050 by adding the offset (all as Hex obviously)

    and used this

    Code: [Select]
    long* led=(long*)0xFF880050;

    void on(void){
     *led=0x46;
    }

    void off(void){
     *led=0x44;
    }

    The backlight didn't turn on :S

    Similar addresses didn't work, heres all addresses with backlight functions

    Code: [Select]
    Line 1301 : 001231B0   001231B0      0   DispSwCon_TurnOnBackLight
    Line 1307 : 001236C0   001236C0      0   DispSwCon_TurnOffBackLight
    Line 1407 : 0012B654   0012B654      0   TurnOnBackLight
    Line 1408 : 0012B664   0012B664      0   TurnOffBackLight
    Line 1778 : 001A23E2   001A23E2      0    Set LCD BackLight Brightness: 0x%04x
    Line 3997 : 003D2890   003D2890      0   DispCon_SetMaxBackLightBrightness
    Line 4084 : 003D2DCD   003D2DCD      0   LCDBACKLIGHTPARAMETER
    Line 4085 : 003D2DE3   003D2DE3      0   CVFBACKLIGHTPARAMETER
    Line 4428 : 003D4315   003D4315      0   LcdCon_SaveLcdBackLightParameter
    Line 4429 : 003D4336   003D4336      0   LcdCon_GetLcdBackLightParameter
    Line 4430 : 003D4356   003D4356      0   LcdCon_SetLcdBackLightParameter
    Line 4431 : 003D4376   003D4376      0   LcdCon_ShowLcdBackLightParameter
    Line 4432 : 003D4397   003D4397      0   LcdCon_SetLcdBackLightBrightness

    PS if any coder here without the camera wants to make some builds for me to try out, more than happy to.

    Build some bins and zip or rar them for me into zshare and I'll test each one and give you a detailed observation
    « Last Edit: 21 / May / 2008, 07:53:52 by Supernovah »

  • Publish
    Re: Porting chdk to the G9
    « Reply #112 on: 21 / May / 2008, 12:21:44 »

    ...

    An experienced developer should be able to make a port in 8-12 hours work (if no major problems arise). I'd be happy to jump in, but I'll need a device. If anybody near Stuttgart can provide one, I will make the port.

    ...

    Cheers.

    Hello jeff666,
    I'm quite far from Stuttgart, I live in Sicily. Couldn't we collaborate via irc or skype?

    Supernovah, which version of firmware do you own?

    « Last Edit: 21 / May / 2008, 12:29:02 by bongo_bingo »

  • Publish
    Re: Porting chdk to the G9
    « Reply #113 on: 21 / May / 2008, 16:02:23 »
    1.00g


  • Publish
    Re: Porting chdk to the G9
    « Reply #114 on: 22 / May / 2008, 05:57:59 »
    So if the memory starts at 0xFF810000, then the first bit of bit of useful data in that is at 0xFF820000, then I load it into  IDA with rom address 0xFF810000 with the offset FFFF, then doesn't any time I find an occurrence of 0x44, represent an enabling function on the camera? Then the address we can call is going to be found at the corresponding addresses + FFFF (because of the offset I loaded at)

    there are 8185 occurrences of 0x44 and only 5042 of 0x46

    obviously most of these will be arbitrary operators and very few actual things on the camera like buttons and backlight and leds etc

  • Publish
    Re: Porting chdk to the G9
    « Reply #115 on: 22 / May / 2008, 06:06:55 »
    I've got msn, is't my nickname on these forums at googles mail service.

    And I live in Gothenburg. I could send my camera if I had a signed promise that it would be returned to me after the porting is complete (to the stage that CHDK is booting). I'd pay for shipping of course :P

  • Publish
    Re: Porting chdk to the G9
    « Reply #116 on: 22 / May / 2008, 07:00:21 »
    Could someone let me know if I'm wasting my time trying to discover these other addresses?

    *

    Offline jeff666

    • ****
    • 181
    • A720IS
  • Publish
    Re: Porting chdk to the G9
    « Reply #117 on: 22 / May / 2008, 09:05:01 »
    So if the memory starts at 0xFF810000, then the first bit of bit of useful data in that is at 0xFF820000, then I load it into  IDA with rom address 0xFF810000 with the offset FFFF,

    Your firmware starts at 0xFF810000 and you load it to this address. The string "gaonisoy" should start at 0xFF810004 and the first instruction at 0xFF810000 is a jump right after the string ("B 0xFF81000C").

    Quote
    then doesn't any time I find an occurrence of 0x44, represent an enabling function on the camera? Then the address we can call is going to be found at the corresponding addresses + FFFF (because of the offset I loaded at)

    LED activity is set by writing to MMIO-Addresses. See the wiki for the correct addresses.

    Quote
    obviously most of these will be arbitrary operators and very few actual things on the camera like buttons and backlight and leds etc

    You're mislead. Everything in the firmware is program code or other data and does not represent anything on the device itself.


    And I live in Gothenburg. I could send my camera if I had a signed promise that it would be returned to me after the porting is complete (to the stage that CHDK is booting). I'd pay for shipping of course :P

    If it's ok for you to send the camera to someone you don't know. Of course I will send your cam back after porting is complete. It shouldn't take more than two weeks for the port as well as some time for shipping. Also I'll keep the forum posted about the progress.
    If you still want to send your cam through Europe, PM me for details.

    Cheers.


  • Publish
    Re: Porting chdk to the G9
    « Reply #118 on: 22 / May / 2008, 16:28:01 »
    Then i'm lost as to what needs to be done to get the kit on the G9 if you arn't needing any addresses for enabling camera parts to work...

    We know the code is passing...

    So what needs to be done?

    Wait sorry, I realize now :P
    I'm not able to identify functions in the firmware dump because I've never worked with this arm binary stuff.
    But I guess you guys have already Identified all the functions and then are ahead of whatever I can do to help :P

    PS if you can get the camera jff666, I can't wait to see it ported :)

    Also you could try talking to a store about borrowing a camera and sign something saying if it's harmed in any way, you'll pay for it (because you know you won't)

    I'm out, see ya, GL JEF666
    « Last Edit: 22 / May / 2008, 16:44:39 by Supernovah »

  • Publish
    Re: Porting chdk to the G9
    « Reply #119 on: 22 / May / 2008, 18:14:46 »
    @jeff666,

    Is it dangerous at all? Either way, I'll think about it. Going to England in June though so I can't at the moment unless you could promise me I'd have the camera back in one piece by June 12th.

    Oh and if Supernovah's idea is possible then that would of course work out better. Or if anyone locally is interested in seeing a port made.
    « Last Edit: 22 / May / 2008, 18:24:09 by Rekoil »

     

    Related Topics