help on definition taskCreateHook in boot.c - General Discussion and Assistance - CHDK Forum

help on definition taskCreateHook in boot.c

  • 4 Replies
  • 3094 Views
*

Offline OldGit

  • ****
  • 303
help on definition taskCreateHook in boot.c
« on: 11 / September / 2009, 09:41:04 »
Advertisements
Can anyone tell me what I am missing,
why are we using the values 1930 / 1934 in the hook creation within boot.c.
Where did these values come from ?.
(I know they are linked to the IRQ but how)

Why are things like init_file_modules_task and exp_drv_task hooked by both ?.

Is this due to the start-up mode or some other reason ?

And most important to me, are all Dryos cams the same in this respect.

I would be very grateful for any help / advice in this area, as I just can't "see" the logic in this, and need to understand it so that I can move forward on the sx200 port.

Thanks in advance for the help, OldGit
SX200 IS-100C

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: help on definition taskCreateHook in boot.c
« Reply #1 on: 11 / September / 2009, 10:33:13 »
Why are things like init_file_modules_task and exp_drv_task hooked by both ?.
Is this due to the start-up mode or some other reason ?

http://chdk.setepontos.com/index.php/topic,2972.msg30712.html#msg30712

edit: Because we don't have any information about dryos internals, 0x1930, 0x1934 (and -17)  are empiric values, they can change with dryos and compiler version.
Of course, you can throw away this not too reliable code and use full path for tasks hooking (see for example a720 code with thousands lines of assember).
« Last Edit: 11 / September / 2009, 10:44:27 by ewavr »

*

Offline OldGit

  • ****
  • 303
Re: help on definition taskCreateHook in boot.c
« Reply #2 on: 11 / September / 2009, 10:45:10 »
Thanks ewavr, I saw that but wondered if anyone had found anything else.
I ask because on the sx200 the SD unlock etc (init_file_modules_task, exp_drv_task) only work correctly  when hooked with 1934 / 1938.
But the hook for movie_record_task only works with 1930, so I end up with

Code: [Select]
void taskCreateHook(int *p) {
 p-=17;
 if (p[0]==0xFF86327C)  p[0]=(int)capt_seq_task;
 if (p[0]==0xFF821A90)  p[0]=(int)mykbd_task;
 if (p[0]==0xFF87F81C)  p[0]=(int)init_file_modules_task;
 if (p[0]==0xFF84856C)  p[0]=(int)JogDial_task_my;
 if (p[0]==0xFF8A2214)  p[0]=(int)exp_drv_task;
}

void taskCreateHook2(int *p) {
 p-=17;
 if (p[0]==0xFF87F81C)  p[0]=(int)init_file_modules_task;
 if (p[0]==0xFF8A2214)  p[0]=(int)exp_drv_task;
}

void taskCreateHook3(int *p) {
 p-=17;
 if (p[0]==0xFF9382B8)  p[0]=(int)movie_record_task;
}
........
........
   *(int*)0x1934=(int)taskCreateHook;
   *(int*)0x1938=(int)taskCreateHook2;
   *(int*)0x1930=(int)taskCreateHook3; //  don't know why but movie will only work with 1930 and card lock only with 1934 - 1938
It just looks strange to me.
thanks, OldGit
SX200 IS-100C

Re: help on definition taskCreateHook in boot.c
« Reply #3 on: 11 / September / 2009, 11:22:59 »
The ixus100_sd780 is also 1934/38.  Seems it's the new location for such items in the newer cameras.

Harpo
Canon Models - SD300, SD780, & SX210


*

Offline OldGit

  • ****
  • 303
Re: help on definition taskCreateHook in boot.c
« Reply #4 on: 11 / September / 2009, 23:08:09 »
Thanks guys,
just wanted some confirmation I wasn't going mad.
I don't like the thought of adding thousands of lines of assemble code so I will stay with what I have.
OldGit
SX200 IS-100C

 

Related Topics