RFC - Generic task hook for DryOS r51 (and higher?) - page 2 - General Discussion and Assistance - CHDK Forum

RFC - Generic task hook for DryOS r51 (and higher?)

  • 19 Replies
  • 4605 Views
*

Offline philmoz

  • *****
  • 3146
    • Photos
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #10 on: 17 / June / 2013, 06:39:10 »
Advertisements
it seems to work good, and the correct power on trick is from 102b

however I'm not really sure on where we are heading because those new files in sub...I think we could move most of that stuff to generic and avoid unnecessary duplication

note that the patch won't apply to trunk and given your recent modifications (stubs diffs clashing) i think I'll wait until you settle things down and merge everything in one place before cleaning up a bit s110 and hopefully g15 with the new stubs and bring the ports on par with yours :)

The new files in the 'sub' directory aren't compiled directly - they are snippets that are inserted by the code_gen program into the output files it creates.

I created these to simplify the instructions to code_gen, the snippets are common to all the firmware versions of a camera; but tend to vary between cameras. For example the IXUS255 doesn't have a jogdial so that part of the task hook and associated code is not needed.

I have some cleanup to do on code_gen and finsig_dryos (mainly separating common code out to new files), then I will add code_gen to SVN.

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)

*

Offline philmoz

  • *****
  • 3146
    • Photos
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #11 on: 07 / July / 2013, 23:37:54 »
While doing the SX50 version of this I realised that it should not be necessary to hook both CreateTask and CreateTask2.

Since CreateTask2 is just a wrapper that calls CreateTask with the same parameters it should only be necessary to hook the CreateTask function.

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)

*

Offline c10ud

  • ***
  • 245
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #12 on: 08 / July / 2013, 04:29:02 »
While doing the SX50 version of this I realised that it should not be necessary to hook both CreateTask and CreateTask2.

Since CreateTask2 is just a wrapper that calls CreateTask with the same parameters it should only be necessary to hook the CreateTask function.

Phil.
IIRC using a single hook didn't work for InitFileModules, but I may be wrong, did you try it already?

*

Offline philmoz

  • *****
  • 3146
    • Photos
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #13 on: 08 / July / 2013, 04:38:00 »
While doing the SX50 version of this I realised that it should not be necessary to hook both CreateTask and CreateTask2.

Since CreateTask2 is just a wrapper that calls CreateTask with the same parameters it should only be necessary to hook the CreateTask function.

Phil.
IIRC using a single hook didn't work for InitFileModules, but I may be wrong, did you try it already?

waterwingz has a test version for SX50, I don't have any R50/R51 cameras.

So long as the override code is moved into the hook code it should work.

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)


*

Offline c10ud

  • ***
  • 245
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #14 on: 08 / July / 2013, 04:46:00 »
While doing the SX50 version of this I realised that it should not be necessary to hook both CreateTask and CreateTask2.

Since CreateTask2 is just a wrapper that calls CreateTask with the same parameters it should only be necessary to hook the CreateTask function.

Phil.
IIRC using a single hook didn't work for InitFileModules, but I may be wrong, did you try it already?

waterwingz has a test version for SX50, I don't have any R50/R51 cameras.

So long as the override code is moved into the hook code it should work.

Phil.
Ah, you talk of moving all hooks to TaskHookFnc2, IIRC I only tried the other way around... I'll try this ASAP!

*

Offline c10ud

  • ***
  • 245
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #15 on: 08 / July / 2013, 04:55:33 »
While doing the SX50 version of this I realised that it should not be necessary to hook both CreateTask and CreateTask2.

Since CreateTask2 is just a wrapper that calls CreateTask with the same parameters it should only be necessary to hook the CreateTask function.

Phil.
IIRC using a single hook didn't work for InitFileModules, but I may be wrong, did you try it already?

waterwingz has a test version for SX50, I don't have any R50/R51 cameras.

So long as the override code is moved into the hook code it should work.

Phil.
Ah, you talk of moving all hooks to TaskHookFnc2, IIRC I only tried the other way around... I'll try this ASAP!
Confirmed: it works as expected :) Probably in my previous tests I got confused by the fact that CreateTask was actually hacked in hook2..

BTW, I'll try to update S110 port with your code_gen tool and post a diff

*

Offline philmoz

  • *****
  • 3146
    • Photos
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #16 on: 08 / July / 2013, 05:01:43 »
Confirmed: it works as expected :) Probably in my previous tests I got confused by the fact that CreateTask was actually hacked in hook2..

I got confused by it as well :)

I actually got the hooks the wrong way round when I created the test version for waterwingz - when he reported that all the hooks worked except the InitFileModules one the light bulb went off.

Phil.

Edit:
It's probably also worth moving the HookIntoTaskCreateFunction code into the boot() function instead of calling it, it should also not be necessary to save the registers.

« Last Edit: 08 / July / 2013, 05:06:34 by philmoz »
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)

*

Offline c10ud

  • ***
  • 245
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #17 on: 08 / July / 2013, 05:22:53 »
Confirmed: it works as expected :) Probably in my previous tests I got confused by the fact that CreateTask was actually hacked in hook2..

I got confused by it as well :)

I actually got the hooks the wrong way round when I created the test version for waterwingz - when he reported that all the hooks worked except the InitFileModules one the light bulb went off.

Phil.

Edit:
It's probably also worth moving the HookIntoTaskCreateFunction code into the boot() function instead of calling it, it should also not be necessary to save the registers.
I'm trying to setup the code_gen environment but I get:
$ make PLATFORM=s110 PLATFORMSUB=102b run-code-gen
-> run-code-gen
Invalid firmware offset 1050761715.
Source --> FW $

This is OT, but I don't understand what's wrong...PRIMARY.BIN is a 16MB dump...and this is based on the code_gen.txt you provided me some time ago https://github.com/c10ud/CHDK/commit/b319395d2a1c090a9266bb75430d1a68114bc86e


*

Offline philmoz

  • *****
  • 3146
    • Photos
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #18 on: 08 / July / 2013, 08:16:42 »
Confirmed: it works as expected :) Probably in my previous tests I got confused by the fact that CreateTask was actually hacked in hook2..

I got confused by it as well :)

I actually got the hooks the wrong way round when I created the test version for waterwingz - when he reported that all the hooks worked except the InitFileModules one the light bulb went off.

Phil.

Edit:
It's probably also worth moving the HookIntoTaskCreateFunction code into the boot() function instead of calling it, it should also not be necessary to save the registers.
I'm trying to setup the code_gen environment but I get:
$ make PLATFORM=s110 PLATFORMSUB=102b run-code-gen
-> run-code-gen
Invalid firmware offset 1050761715.
Source --> FW $

This is OT, but I don't understand what's wrong...PRIMARY.BIN is a 16MB dump...and this is based on the code_gen.txt you provided me some time ago https://github.com/c10ud/CHDK/commit/b319395d2a1c090a9266bb75430d1a68114bc86e

Attached version should work - replaced filewrite.c with nafraf's version from sx160.

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)

*

Offline c10ud

  • ***
  • 245
Re: RFC - Generic task hook for DryOS r51 (and higher?)
« Reply #19 on: 08 / July / 2013, 08:50:37 »
Confirmed: it works as expected :) Probably in my previous tests I got confused by the fact that CreateTask was actually hacked in hook2..

I got confused by it as well :)

I actually got the hooks the wrong way round when I created the test version for waterwingz - when he reported that all the hooks worked except the InitFileModules one the light bulb went off.

Phil.

Edit:
It's probably also worth moving the HookIntoTaskCreateFunction code into the boot() function instead of calling it, it should also not be necessary to save the registers.
I'm trying to setup the code_gen environment but I get:
$ make PLATFORM=s110 PLATFORMSUB=102b run-code-gen
-> run-code-gen
Invalid firmware offset 1050761715.
Source --> FW $

This is OT, but I don't understand what's wrong...PRIMARY.BIN is a 16MB dump...and this is based on the code_gen.txt you provided me some time ago https://github.com/c10ud/CHDK/commit/b319395d2a1c090a9266bb75430d1a68114bc86e

Attached version should work - replaced filewrite.c with nafraf's version from sx160.

Phil.
alright, it works, thanks (I thought I was getting some firmware loading error :() patch for complete s110 port soon

 

Related Topics