G11 porting - page 2 - DryOS Development - CHDK Forum  

G11 porting

  • 530 Replies
  • 231641 Views
Re: G11 porting
« Reply #10 on: 25 / December / 2009, 21:17:35 »
Advertisements

The FI2 you need to build first is one that searches for LEDs. This is done by poking a bunch of MMIO addresses. I'm not aware of anyone bricking a camera doing this, but the risk is likely to be greater than 0. There's probably some code for this floating around on the forum.

Good. This sounds like a specific task to me. So first step in order to build a working FI2 would be to find the LED adresses.
And that is done by poking address by address until the correct ones are found...

Would someone please actually link the code of the program for finding the LEDs here? Thanks ahaed!


-kingcang
« Last Edit: 25 / December / 2009, 21:26:38 by kingcang »

*

Offline reyalp

  • ******
  • 14080
Re: G11 porting
« Reply #11 on: 25 / December / 2009, 21:42:34 »

Would someone please actually link the code of the program for finding the LEDs here? Thanks ahaed!

You should find useful hints in the sx20 and ixus200/sd980 porting threads.
http://chdk.setepontos.com/index.php/topic,4188.msg39620.html#msg39620 starting here, perhaps.

edit:
Note there isn't a "program" to find LEDs. You have to modify it repeatedly to narrow down the range, because you have no other output available to tell you *where* it was found, and the program doesn't know when it has found one. Binary search is your friend.
« Last Edit: 25 / December / 2009, 21:48:27 by reyalp »
Don't forget what the H stands for.

Re: G11 porting
« Reply #12 on: 25 / December / 2009, 21:54:46 »

So to quote RaduP here, this would be the code to be compiled [each time] for finding the correct LED addresses:

Quote from: RaduP
void find_led()
{
   volatile long *p;
   int i;

   p=(void*)0xc0220000;

   for(i=0;i<0xffff;i++)
      {
         *p=0x46;
         p++;
      }
}

As far as I read from the thread you mentioned, reyalp, the red marked addresses is considered to be the range searched within.
Which range should be used for the Canon G11? After compiling the code, how and where should it be executed?

If my conclusions so far are lacking something, feel free to correct me.

-kingcang
« Last Edit: 25 / December / 2009, 22:22:14 by kingcang »

*

Offline reyalp

  • ******
  • 14080
Re: G11 porting
« Reply #13 on: 25 / December / 2009, 22:44:12 »
Quote
Which would be the range for the Canon G11
AFAIK, all known cameras have their all their MMIO in a 16 MB range from 0xC0000000 to 0xC1000000.

The code quoted above searches from 0xC0220000 through 0xC025FFFC, since it does 0xFFFF iterations which each cover 4 bytes.

To avoid this kind of confusion I would write this as:
Code: [Select]
#define START ((long *)0xc0220000)
#define END ((long *)0xc0224000) // or whatever
void find_led()
{
   volatile long *p;

   for(p=START;p<END;p++)
      {
         *p=0x46;
      }
}
As to where the G11 LEDs are, that's for you to find. It's probably similar to either the G10, or one of the recent cameras. The LED addresses for a camera are frequently listed on it's wiki page.

Starting near 0xC0220000 seems to be common, and 0xC0223030 has been the AF led on several recent models.
Don't forget what the H stands for.


Re: G11 porting
« Reply #14 on: 25 / December / 2009, 23:03:22 »
« Last Edit: 25 / December / 2009, 23:07:43 by kingcang »

*

Offline reyalp

  • ******
  • 14080
Re: G11 porting
« Reply #15 on: 26 / December / 2009, 01:02:01 »
« Last Edit: 26 / December / 2009, 01:11:45 by reyalp »
Don't forget what the H stands for.

Re: G11 porting
« Reply #16 on: 26 / December / 2009, 11:03:55 »
« Last Edit: 26 / December / 2009, 11:32:40 by kingcang »

Re: G11 porting
« Reply #17 on: 26 / December / 2009, 11:48:09 »
Please give me a nudge.

Fair comment.
I have never ported a camera completely from scratch so cannot help there.
Getting started will be the most difficult bit.

I hope people who know how to do this can give you enough detailed information in order to start.

It should get easier as you progress.

The main thing is that you have the camera, will be able to port it with some guidance and are keen to try.


Porting is regarded as a 'black art', more detailed information is needed.

Good luck !


*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: G11 porting
« Reply #18 on: 26 / December / 2009, 12:50:25 »

Re: G11 porting
« Reply #19 on: 26 / December / 2009, 13:09:06 »
« Last Edit: 26 / December / 2009, 13:17:59 by kingcang »

 

Related Topics