G11 porting - page 23 - DryOS Development - CHDK Forum supplierdeeply

G11 porting

  • 530 Replies
  • 245695 Views
Re: G11 porting
« Reply #220 on: 09 / January / 2010, 10:07:02 »
Advertisements
I am not familiar with the exact naming of the CHDK features.

Is display of Miscellaneous values and PropCases working ?


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #221 on: 09 / January / 2010, 10:33:05 »
No, it is not working. Currently i got sometimes a yellow filled rectangle on the screen. So maybe this "is" the (faulty) output of propcases. But it is not very usefull. Thats why i want to know, in which part of the CHDK source i can find the code who draws the ProcCase output, so i can find out whats going wrong.

Re: G11 porting
« Reply #222 on: 09 / January / 2010, 10:42:36 »
The CHDK code is more 'complicated' than the SDM code.
I will look shortly to find where that information is.

If it is any use, this is at the bottom of gui.c in SDM :-

Code: [Select]
//--------------------------------- Debug values ----------------------

    if (debug_vals_show)     
     {
sprintf(osd_buf, "0:%8x ",physw_status[0]);
draw_txt_string(28, 10, osd_buf, conf.osd_color);

      sprintf(osd_buf, "1:%8x ",physw_status[1]);
draw_txt_string(28, 11, osd_buf, conf.osd_color);

      sprintf(osd_buf, "2:%8x ",physw_status[2]);
draw_txt_string(28, 12, osd_buf, conf.osd_color);
     }

//---------------------------------- Debug propcase -------------------
    if (debug_propcase_show)
     {
static char sbuf[100];
int r,i, p;

  for (i=0;i<10;i++)
         {
    r = 0;
    p = debug_propcase_page*10+i;
    get_property_case(p, &r, 4);
    sprintf(sbuf, "%3d: %d              ", p, r);sbuf[20]=0;
    draw_string(64,16+16*i,sbuf, conf.osd_color,1);
   }
      }
   } //_conf.show_osd

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #223 on: 09 / January / 2010, 11:00:13 »
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.

I changed the code to this:

wrappers.c:
Code: [Select]
int utime(char *file, void *newTimes) {
#if !CAM_DRYOS
  return _utime(file, newTimes);
#else
 int res=0;
 #ifdef CAM_DRYOS_2_3_R39
   res=_SetFileTimeStamp(file, ((int*)newTimes)[0] , ((int*)newTimes)[1]);
 #else
     int fd;
     int res=0;
     fd = _open(file, 0, 0);
     if (fd>=0) {
      res=_SetFileTimeStamp(fd, ((int*)newTimes)[0] , ((int*)newTimes)[1]);
      _close(fd);
     }
     // return value compatibe with utime: ok=0 fail=-1
  #endif
  return (res)?0:-1;
#endif
}

stubs_entry_2.s:
NSTUB(SetFileTimeStamp, 0xFF835C3C)

lolevel.h:
Code: [Select]
#ifdef CAM_DRYOS_2_3_R39
int _SetFileTimeStamp(char *file_path, int time1, int time2);
#else
extern int _SetFileTimeStamp(int fd, int time1, int time2);
#endif

but it still does not work. This assert hits:
ASSERT!! Mounter.c Line 2563


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #224 on: 09 / January / 2010, 11:43:11 »
The CHDK code is more 'complicated' than the SDM code.
I will look shortly to find where that information is.

If it is any use, this is at the bottom of gui.c in SDM :-

Thanks, now i found the code ( gui_draw_debug_vals_osd() ) . ;)
I moved this functioncall from the bottom of gui_draw_osd to the head of the function gui_redraw().
And now i can see the debug/property values. So something seems to be different with
the display updates on G11. I assume that the debug values are written anyway, but the cleaned/overwritten by the original canon display output or so...
Anyway, here is my build with permanent debug output:
« Last Edit: 09 / January / 2010, 12:14:08 by ERR99 »

Re: G11 porting
« Reply #225 on: 09 / January / 2010, 12:08:56 »
mattkime and kingcang have both expressed interest in this build, maybe they can help find the information that you need ?

At least now there are others who can boot the G11.

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #226 on: 09 / January / 2010, 12:17:03 »
If found in the sourcecode this comment:
Code: [Select]
// uncomment if you want debug values always on top
//gui_draw_debug_vals_osd();

So i changed again the callpoint for gui_draw_debug_vals_osd(); and now the debug output and the CHDK menu are
more usable. So maybe this build is usable for getting the PropValues. I added this build to my previous post on page 15.

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #227 on: 09 / January / 2010, 12:58:45 »
I tryed to find the correct address for "RefreshPhysicalScreen",because this was nullsubed actual. Which can maybe the cause for the strange display update behaviour.

So i checked the SX200IS port, which also sets a variable "enabled_refresh_physical_screen", before RefreshPhysicalScreen() is called. I think the G11 needs this also, and i think i found the funktion in the G11 firmware:

NHSTUB(RefreshPhysicalScreen, 0xFFA11130)
DEF(enabled_refresh_physical_screen, 0x98B4+0x28)

So i added this function and checked also that it is called.
void vid_bitmap_refresh()
{
 extern int enabled_refresh_physical_screen;
 enabled_refresh_physical_screen=1;
 _RefreshPhysicalScreen(1);
}

But nothing changed, display update/clean is still not correct working...
If this maybe not the correct function address for _RefreshPhysicalScreen()?


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #228 on: 10 / January / 2010, 06:40:07 »
Some progress. The reason why OSD Debug values was not correctly shown (without patching gui_osd.c), are some not updated variables in stubs_min.s ( like "canon_menu_active" and so). Now the debug output is working "normal", without any patches.

But there are still some variable addresses left to find:

DEF(recreview_hold, xxx)       
DEF(movie_status, xxx)       
DEF(some_flag_for_af_scan, xxx)      

So it would ne a great help if someone could find the correct addresses for the G11-FW.

*

bassist

Re: G11 porting
« Reply #229 on: 10 / January / 2010, 07:01:52 »
Hi there,

I have a G11 and I can run your DISKBOOT.BIN here. I know C/C++ and Assembler, but I have no idea how CHDK works under its hood... But I've got some little spare time, so I could help if you tell me how. I saw that there are some arrays to be filled:
So i need the correct values for:
aperture_sizes_table[]
shutter_speeds_table[]
iso_table[]
modemap[]
But frankly, I do not have any idea how to find out those values and http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera doesn't help me either... If anyone has a "How to find those arrays for Dummies", I could probably help ;-)

cheers,
Ben


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal