PowerShot SX210 IS - Porting Thread - page 17 - General Discussion and Assistance - CHDK Forum

PowerShot SX210 IS - Porting Thread

  • 589 Replies
  • 322883 Views
*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: PowerShot SX210 IS - Porting Thread
« Reply #160 on: 27 / August / 2010, 05:09:11 »
Advertisements
I seem to remember that open() (or was it Open?) crashes if called with filename that doesn't start with A/. Could that be the case?

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #161 on: 27 / August / 2010, 12:15:51 »
Here is the v2 of the platform folder, many new funcs discoverd, still some to get, and most of the boot.c working

http://es.drop.io/sx210is_platformv01 -> Get the v2 file

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #162 on: 28 / August / 2010, 02:42:58 »
Well I make it past the core_spytask() , but I need to change these two lines in conf.c

1.- changed this one:
 
Code: [Select]
CONF_INFO( 66, conf.menu_rbf_file,          CONF_DEF_PTR,   ptr:"A/README.TXT", conf_change_menu_rbf_file),  //ASM1989 was "" and reboots with the ""

2.- and remove this one
Code: [Select]
// CONF_INFO(183, conf.menu_symbol_rbf_file,   CONF_DEF_PTR,   ptr:"A/CHDK/SYMBOLS/icon_10.rbf", conf_change_menu_symbol_rbf_file),
I traced this one to the file \lib\font\rbf_font.c in the function rbf_load_symbol, to this line
Code: [Select]
read(fd, rbf_symbol_font.cTable[i], rbf_symbol_font.charSize); , If its enabled it fails

Maybe it has to do with the RBF fonts, or due to memory limitiations or issues, I have no clue, If anyone have any hint will be welcome

Anyway here are the working binaries
sx210is-100casm1989beta001.zip  at http://es.drop.io/sx210is_platformv01
 
It loads, and show the version info in the screen remaining there.

One more question, does it matter that the SD card is write protected or not? , for me seems no difference
« Last Edit: 28 / August / 2010, 03:12:34 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #163 on: 28 / August / 2010, 09:44:08 »
I'm now with the keyboard, and I'm not sure if it even reaches it, the fact is that once I have the load screen I lost some functionalities like the MENU button, but some of the remain.

Code: [Select]
void taskCreateHook(int *p) {
   p-=17;
 if (p[0]==0xFF8342C0)  p[0]=(int)mykbd_task;      
}
...... ->
Code: [Select]
*(int*)0x1934=(int)taskCreateHook;  

The address of FF8342C0 seem prety correct, but maybe the 0x1934 have changed in the new cams ?

I have tryed with 0x1938   found at FF81078C and it hangs
 
Anyone knows?
« Last Edit: 28 / August / 2010, 09:52:45 by asm1989 »

*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: PowerShot SX210 IS - Porting Thread
« Reply #164 on: 28 / August / 2010, 10:36:16 »
I have tryed with 0x1938   found at FF81078C and it hangs
What's in your mykbd_task?

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #165 on: 28 / August / 2010, 10:40:35 »
Code: [Select]
void __attribute__((naked,noinline)) mykbd_task()
{
    /* WARNING
     * Stack pointer manipulation performed here!
     * This means (but not limited to):
     * function arguments destroyed;
     * function CAN NOT return properly;
     * MUST NOT call or use stack variables before stack
     * is setup properly;
     *
     */
  mkdir("A/CHDK/key1test");


register int i;
register long *newstack;

#ifndef MALLOCD_STACK
newstack = (void*)kbd_stack;
#else
newstack = malloc(NEW_SS);
#endif

for (i=0;i<NEW_SS/4;i++)
newstack[i]=0xdededede;

asm volatile (
"MOV SP, %0"
:: "r"(((char*)newstack)+NEW_SS)
: "memory"
);

mykbd_task_proceed();

/* function can be modified to restore SP here...
*/

_ExitTask();
}

I only include this for testing
Code: [Select]
mkdir("A/CHDK/key1test");

*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: PowerShot SX210 IS - Porting Thread
« Reply #166 on: 28 / August / 2010, 10:54:43 »
And you probably mean that "A/CHDK/key1test" is not created. Why not light an LED instead? And if it lights, then go further down the road, check function addresses, inline asm, etc. -- the usual buisiness.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #167 on: 28 / August / 2010, 12:33:34 »
still working on this, but advance in other stuff, malloc and free have diferent signtarues in thes new cams, I find and test these two:

Code: [Select]
NHSTUB(free, 0xFF81415C)  // -> ASM1989 08.28.2010 Tested
NHSTUB(malloc,0xFF814100)  // -> ASM1989 08.28.2010 Tested

I have the CHDK logo now!

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: PowerShot SX210 IS - Porting Thread
« Reply #168 on: 28 / August / 2010, 18:05:18 »
Code: [Select]
NHSTUB(free, 0xFF81415C)  // -> ASM1989 08.28.2010 Tested
NHSTUB(malloc,0xFF814100)  // -> ASM1989 08.28.2010 Tested

I have the CHDK logo now!
Nice work!
So your camera does show chdk logo correctly after you fixed free and malloc?

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #169 on: 29 / August / 2010, 01:21:21 »
yes indeed, but since I was not able to find the rigth address to function stat( , I have to override it and put manually the size of the logo image in core\gui.c function gui_handle_splash

Code: [Select]
//if (stat(logo_name,&st) == 0) {
          //logo_size=st.st_size;
         logo_size=2458;
        ......

Function stat look like to be FF836DB4 but it dosnt work, any clue from someone?

Anyway the malloc stuff  also solve my problem with the rbf stuff in conf.c

Code: [Select]
CONF_INFO(183, conf.menu_symbol_rbf_file,   CONF_DEF_PTR,   ptr:"A/CHDK/SYMBOLS/icon_10.rbf", conf_change_menu_symbol_rbf_file),
« Last Edit: 29 / August / 2010, 02:49:10 by asm1989 »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal