G12 release? - page 3 - CHDK Releases - CHDK Forum supplierdeeply

G12 release?

  • 28 Replies
  • 12861 Views
Re: G12 release?
« Reply #20 on: 03 / December / 2010, 11:00:06 »
Advertisements
Thanks whim. I followed your suggestions. Automatic stub generation fails to find a bunch of functions (listed below). I ran signatures and scripts in IDA as suggested in the wiki with no result. I mapped them in stubs_entry_2.S and managed to compile. I'm afraid I'm stuck. One good news. The camera hangs if i make the card bootable and copy the compiled fw. At least the thing is theoretically feasible.

List of functions not found:
GetDrive_FreeClusters
GetParameterData
ReadFastDir
SetParameterData
free
kbd_read_keys
qsort
rand
srand
strtol

*

Offline c10ud

  • ***
  • 245
Re: G12 release?
« Reply #21 on: 17 / December / 2010, 13:53:14 »
i tried to do a basic port but i'm stuck with kbd task..it doesn't seem to be responding "as usual" (i.e. no luck in getting to recognize keypresses, even if keymasks should be correct..) anyone else trying to hack this camera?

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 release?
« Reply #22 on: 21 / December / 2010, 16:31:03 »
i tried to do a basic port but i'm stuck with kbd task..it doesn't seem to be responding "as usual" (i.e. no luck in getting to recognize keypresses, even if keymasks should be correct..) anyone else trying to hack this camera?

The keyboard logic looks to be different in the G12 (at least compared to the SX30 and S95 that I've compared to).

The logic I've previously used in my_kbd_read_keys is:
Code: [Select]
     ...
     _GetKbdState(kbd_new_state);         // get camera keyboard switch values (in camera keyboard part 1)
     ...
     // CHDK keyboard logic (call kbd_process, and set physw_status)
     ...
     _kbd_read_keys_r2(physw_status);  // finish in camera keyboard processing
     ...


On the G12 the value stored in new_kbd_state[0] by GetKbdState appears to be random.
Also the value that is calculated and stored in physw_status[0]  is overwritten at the start of kbd_read_keys_r2).

This has two effects:
1. kbd_process is looking at garbage and so is setting kbd_mod_state to incorrect values.
2. Even if kbd_process were working the value calculated for physw_status[0] is overwritten (and hence ignored) by kbd_read_keys_r2.

The following mod to my_kbd_read_keys will get the camera keyboard working and allow you to at least get into the ALT mode and menu:
Code: [Select]
     ...
     _GetKbdState(kbd_new_state);         // get camera keyboard switch values (in camera keyboard part 1)
     _kbd_read_keys_r2(kbd_new_state);  // finish in camera keyboard processing into CHDK variables
     ...
     // CHDK keyboard logic (call kbd_process, and set physw_status)
     ...


The problem is that this may well break other CHDK functionality. I haven't had time to analyse what is going on in kbd_read_keys_r2 or kbd_process to understand the implications (kbd_process is an ugly mess and really needs an overhaul).

Perhaps someone with more knowledge of how these work can help.

Regards,
Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline c10ud

  • ***
  • 245
Re: G12 release?
« Reply #23 on: 22 / December / 2010, 08:26:08 »
thanks for the tip phil, that seemed to fix this issue.

unfortunately, yes, it's still difficult (to me!) to really get what's going on in kbd* stuff.. anyway now i'll try to port a little more stuff and then release an archive people can play with for a fast start


*

Offline kezug

  • *
  • 38
Re: G12 release?
« Reply #24 on: 27 / December / 2010, 00:19:45 »
So does this mean this port is going to be difficult and take awhile?

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 release?
« Reply #25 on: 27 / December / 2010, 01:00:33 »
So does this mean this port is going to be difficult and take awhile?

I have most functionality working for firmware 1.00c.
I plan to publish a beta later this week if I can finish the last of the code and basic testing.

Regards,
Phil. 
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline c10ud

  • ***
  • 245
Re: G12 release?
« Reply #26 on: 27 / December / 2010, 06:53:48 »
i have something running but seeing "most functionality working" i guess you did arrive first, i was waiting for the end of vacations for doing some other work on it (currently i have the alt mode running correctly, kbd working thanks to your tips and ported but untested the captseq task based on sx30)..i guess i'll wait for your beta :)

out of curiosity: did you manage to paint both canon-osd and chdk-osd at the sametime? to make it work, i must boot the camera, then switch to play mode and then rec mode again. otherwise canon-osd just freezes..

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 release?
« Reply #27 on: 27 / December / 2010, 16:50:18 »
i have something running but seeing "most functionality working" i guess you did arrive first, i was waiting for the end of vacations for doing some other work on it (currently i have the alt mode running correctly, kbd working thanks to your tips and ported but untested the captseq task based on sx30)..i guess i'll wait for your beta :)

out of curiosity: did you manage to paint both canon-osd and chdk-osd at the sametime? to make it work, i must boot the camera, then switch to play mode and then rec mode again. otherwise canon-osd just freezes..

Both OSD's work - you need to get most of the values in stubs_min.s and stubs_entry_2.s correct before things will start to work properly. Otherwise you get weird behaviour and camera crashes and lockups. Unfortunately this is one of the hardest parts of doing a port (at least for me) and involves a lot of searching in the firmware, comparing to other versions and trial and error.

I'd just recently done the SX30 for my camera firmware version and two other versions with help from a number of testers, so it was all pretty fresh in my mind. The G12 turned out to be fairly close to the SX30 in a lot of places which made it easier.

When I post the beta I'll post the code as well.

Regards,
Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 release?
« Reply #28 on: 28 / December / 2010, 19:46:21 »
Beta has been posted.
Details here:
http://chdk.setepontos.com/index.php?topic=5967.0
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal