G11 porting - page 22 - DryOS Development - CHDK Forum

G11 porting

  • 530 Replies
  • 245802 Views
*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #210 on: 07 / January / 2010, 19:22:27 »
Advertisements
Okay, thanks.  :)
BTW: I am currently trying to get the exposure task running.

But there are also other tasks to do, and maybe someone can help me out to speed up the G11 porting process.
As descript here: http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera , the shooting.c needs to be updated for the G11:
Quote
platform/<camera>/shooting.c

To fill aperture_sizes_table[] you can use the same method as for filling fl_tbl[] in main.c. In case your camera doesn't have an actual diaphragm, you just take pictures at the available zoom steps. Twice if your camera has an ND filter (once with filter and once without; either use the ND-filter option from the CHDK menu, if you have the right values in platform/<camera>/sub/<version>/stubs_entry(_2).S, or find specific modes that make sure the filter is used or not). The entries are of the form { idx, av, string } with idx starting from 9, av the values of PROPCASE_AV and string a string representation of the aperture (the value of which you can get from the EXIF data).

To fill iso_table[] you check PROPCASE_ISO_MODE for the different ISO values the camera allows you to select. Note that Auto gets index 0 and HI gets index -1.

For shutter_speeds_table[] you essentially have to try various exposure times and see if there is a difference with others. If not, you know that the used exposure time wasn't really supported.

To fill in modemap[], use the same procedure as key_map[] in kbd.c. Use the debug OSD with "Props" to show item PROPCASE_SHOOTING_MODE (see include/propcase1.h or include/propcase2.h, depending on your camera, for the right number) and change modes to see what value is shown. You might need to extend the enumeration in include/platform.h if your camera has new kinds of modes.

Finally, you'll have to find the right values for PARAM_FILE_COUNTER and PARAM_EXPOSURE_COUNTER by using the debug OSD. You can easily detect them by taking a picture and noting which value changes. Note that PARAM_FILE_COUNTER is a big number as it actually contains multiple counters (see its usage in platform/generic/shooting.c; taking a picture will add 16 to the number as a whole.

So i need the correct values for:
aperture_sizes_table[]
shutter_speeds_table[]
iso_table[]
modemap[]

It would be very helpfull if someone out there with a G11 can evalute this values, so i can keep focused getting the code running.

Re: G11 porting
« Reply #211 on: 07 / January / 2010, 19:55:29 »
Obviously, you will need to upload a build.


Re: G11 porting
« Reply #212 on: 08 / January / 2010, 09:59:28 »
SetFileTimeStamp() is also failing with 0xFF835C3C. It crashes also if i nullsub the call

I was going to compare with IXUS200.
Originally it was found with 95% match but Radup later nullsub'd it :-

http://chdk.setepontos.com/index.php/topic,4228.msg41742.html#msg41742

No more has been heard from him.

Re: G11 porting
« Reply #213 on: 08 / January / 2010, 16:34:00 »
According to my experience it's not big deal to find SetFileTimeStamp() function.
Please give me link to firmware dump you are trying to port for and addresses of some functions like rename(), lseek(), stat(), mkdir() and so on.
The more known functions you have - the easier it would be to find one more.
I think at least one function address from the list above should be enough.


Re: G11 porting
« Reply #214 on: 08 / January / 2010, 17:19:59 »
Well, like the IXUS200 the code seems somewhat different.

Here is the drop http://drop.io/chdkdumps2/

I did not find Lseek.

In that approximate area I found  :-

Fseek_Fut 0xff835658
j_read 0xff835a3c

and I would have expected SetFileTimeStamp to be between the two.

I suggested 0xFF835C3C

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: G11 porting
« Reply #215 on: 08 / January / 2010, 19:05:34 »
I suggested 0xFF835C3C

Probably yes. But it seems that SetFileTimeStamp in G11 does not require open() and close() calls (look at utime() wrapper).

« Last Edit: 08 / January / 2010, 19:08:18 by ewavr »

Re: G11 porting
« Reply #216 on: 09 / January / 2010, 06:48:48 »
A little bit strange firmware.
I have found ioctl() function which was used for many POSIX/ANSI functions, but it is not called at all in this firmware.
SetFileTimeStamp is 0xFF835C3C
But first parameter is not fd (file descriptor), it is pointer to file name.
So prototype is as follows:
int SetFileTimeStamp(char *file_path, int access_time, int modification_time);
It looks like function returns 1 if Ok, or 0 if error.
I have no camera to test, so you need to check this out yourself.

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #217 on: 09 / January / 2010, 09:35:10 »
Okay, i will test this.

I have got another strange problem: Very often my diskboot.bin builds was crashing at startup (before chdk splash screen was shown), at that even if i have not changed any code which is exceuted during startup.

To track the root-cause of this problem, i included the romlog.patch to my build, so i got a exception register dump.
The dump shows me, that the Spytask was crashing with a faulty pointer in the free() function.
And with help of the stack dump, i found the problem here in script.c:
Code: [Select]
void script_load(const char *fn, int saved_params) {
    int i, update_vars;
    FILE *fd = NULL;
    struct stat st;
    
//    save_params_values(0);

    if(state_ubasic_script && state_ubasic_script != ubasic_script_default)
        free((void *)state_ubasic_script);
...

This function is called during config load, and sometimes this free() call crashes. And the cause i think is this not initalized pointer variable:
Code: [Select]
const char *state_ubasic_script;Most of the time, the variable is 0 at startup, and the free is not executed. But not allways...
So i replaced this with this initialisation:
Code: [Select]
const char *state_ubasic_script = NULL;And finally the camera is now booting stable.

But there is one more problem: I cant see the debug output on the display (i mean e.g. the output for "PropCase/ParamsData"). The normal menus, games, etc. are shown, but the complete "Debug data display" is not working.
No debug output is visible on the display, on the normal cameras menus or livepicture is shown. Is the debug output using other draw_functions for output? And where can i find the debug-output functions in the CHDK code?

And there is also another problem: If i switch from a "long" menu (like e.g. "Miscellaneous") via "<- BACK" to a "short" menu (e.g."Main Menu"). In this case, the "Miscellaneous" Menu is only simply overwritten, but not cleared before "Main Menu" is painted. So i can see the both menus overlayed. How the menu update process is working, and on which point the gui-framework clears the screen? Obviously this is currently now working in my port...  :haha


Re: G11 porting
« Reply #218 on: 09 / January / 2010, 09:43:51 »
Quote
there are also other tasks to do, and maybe someone can help me out to speed up the G11 porting process.

You need to post a build  if people are to assist.



*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #219 on: 09 / January / 2010, 10:02:55 »
Okay, i dont know if a build without working debug menu output will be very helpfull, but here is my current build:
« Last Edit: 09 / January / 2010, 11:52:08 by ERR99 »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal