A1100 IS Porting thread

  • 640 Replies
  • 86758 Views
*

Offline reyalp

  • ******
  • 10067
Re: A1100 IS Porting thread
« Reply #60 on: 21 / April / 2010, 03:34:08 »
Advertisements
Your build environment appears to be broken in some way. Can you build an already completed port, with the generated files like stubs_auto.S and and stubs_entry.S made from stratch.
Quote
stubs_auto.S:246:1: error: unterminated argument list invoking macro "STUB"
stubs_auto.S is a generated file. It was not generated correctly, either due to some error in your code or your build environment. stubs_auto.S is made with sed scripts, so can have errors if you have something in your code like the patterns it is looking for. Look at the makefiles and the contents of stubs_auto.S

sub_sub*** is not normal. Something is wrong.
Quote
-->how to find dmSetup.I double click the dmSetup,then IDA go   to       it's         definition.I want to know how to get the function like "sub_FFC097EC" to replace the dmSetup.
When you double click on it, IDA takes you to the starting address of that function. Replace dmSetup with sub_<address>
Don't forget what the H stands for.

Re: A1100 IS Porting thread
« Reply #61 on: 21 / April / 2010, 03:40:55 »
Thanks reyalp.You are bovining.I like you.I will continue.

Re: A1100 IS Porting thread
« Reply #62 on: 21 / April / 2010, 11:24:22 »
1.How can I get the address of function that in the stubs_entry_2.S.Now I  temply set the 0x12345678 for every function.

2.
After fixed the boot.c I get these compile errors.
Looks like if there is "BL sub_xxxxx" in the asm(),then it will tell me"undefined reference to 'sub_xxxxx'.
I have not fixed the SUBROUTINE in the firmware yet.
Is it that cause these compile errors?


Code: [Select]
\-> main.elf
../platform/a1100/sub/100c/libplatformsub.a(boot.o): In function `sub_FFC00FC8_m
y':
boot.c:(.text+0x258): undefined reference to `sub_FFE6C5B0'
boot.c:(.text+0x2f0): undefined reference to `sub_FFC02D68'
../platform/a1100/sub/100c/libplatformsub.a(boot.o): In function `sub_FFC04D3C_m
y':
boot.c:(.text+0x350): undefined reference to `sub_FFC00954'
boot.c:(.text+0x354): undefined reference to `sub_FFC090B4'
boot.c:(.text+0x360): undefined reference to `sub_FFC04E2C'
boot.c:(.text+0x364): undefined reference to `sub_FFC04974'
boot.c:(.text+0x370): undefined reference to `sub_FFC04E2'
boot.c:(.text+0x378): undefined reference to `sub_FFC04A5C'
boot.c:(.text+0x384): undefined reference to `sub_FFC04E2C'
boot.c:(.text+0x38c): undefined reference to `sub_FFC03578'
boot.c:(.text+0x398): undefined reference to `sub_FFC04E2C'
boot.c:(.text+0x39c): undefined reference to `sub_FFC08BCC'
boot.c:(.text+0x3a8): undefined reference to `sub_FFC04E2C'
boot.c:(.text+0x3ac): undefined reference to `sub_FFC014A8'
boot.c:(.text+0x3b8): undefined reference to `sub_FFC04E2C'
.....many....

*

Offline reyalp

  • ******
  • 10067
Re: A1100 IS Porting thread
« Reply #63 on: 22 / April / 2010, 01:19:52 »
1.How can I get the address of function that in the stubs_entry_2.S.Now I  temply set the 0x12345678 for every function.
Load the dump of an already ported camera.
Look at the stubs_entry_2.s for that camera.
Go to the address listed for the function you want to find.

Now look in your dump for the same function. Usually, you look for clues, like a string, or some other known function that calls or is called by the function you are looking for. Some ports have comments in the stubs_entry_2.S that give some clues.

Quote
After fixed the boot.c I get these compile errors.
Looks like if there is "BL sub_xxxxx" in the asm(),then it will tell me"undefined reference to 'sub_xxxxx'.
It looks like stubs_auto.S is not being generated correctly. Look at the contents of this and the makefiles that produce it.
Don't forget what the H stands for.


Re: A1100 IS Porting thread
« Reply #64 on: 22 / April / 2010, 12:56:28 »
Now I am confused.Because the stubs_auto.S do not update.I am not know why.
capt_seq.c movie_rec.c am the same as a480.Because I copy all the files from a480 only modify some files.
Code: [Select]
boot.c capt_seq.c movie_rec.c \-> stubs_auto.S
stubs_auto.S \-> stubs_auto.o
stubs_auto.S:256:1: error: unterminated argument list invoking macro "STUB"
make[4]: *** [stubs_auto.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

I delete the file stubs_auto.S.Update from the svn.Then compile again.Error changed.

Code: [Select]
../platform/a1100/sub/100c/libplatformsub.a(boot.o): In function `sub_FFC00FC8_m
y':
boot.c:(.text+0x250): undefined reference to `sub_FFE6C5B0'
boot.c:(.text+0x2e8): undefined reference to `sub_FFC02D68'
...

All of the  code like "BL  sub_xxxx" in the asm code compile error like this.
I think it is the compile environment problem.Because like the code  sub_xxxx.It shoud be in the stubs_auto.S.But now it have not update.So the problem come.
So I want to know how to resolve?

Re: A1100 IS Porting thread
« Reply #65 on: 22 / April / 2010, 12:58:57 »
I try to use the chdk shell.But on the main page of the shell.It have not the a1100.So I use the cmd window of chdk shell.But get the same error like cmd window of windows xp.

*

Offline reyalp

  • ******
  • 10067
Re: A1100 IS Porting thread
« Reply #66 on: 22 / April / 2010, 22:09:55 »
Quote
boot.c capt_seq.c movie_rec.c \-> stubs_auto.S
You need to look at this step in the makefile. Maybe it's getting the wrong program from the path. Also look inside stubs_auto.S after this step, maybe there is some clue there.
Don't forget what the H stands for.

Re: A1100 IS Porting thread
« Reply #67 on: 23 / April / 2010, 01:57:55 »
Quote
You need to look at this step in the makefile. Maybe it's getting the wrong program from the path. Also look inside stubs_auto.S after this step, maybe there is some clue there.
Ok.I do not know why.I manually add them to the stubs_auto.S.It compile fine now.
Now the code like this.
Code: [Select]
volatile long *p = (void*)DP;       // turned off later, so assumed to be power
        int counter;
       //  DEBUG: blink led
        counter = DELAY; *p = 0x46;  while (counter--) { asm("nop\n nop\n"); };
          counter = DELAY; *p = 0x44;  while (counter--) { asm("nop\n nop\n"); };
        _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
The led works.Then camera shutdown.Because I can push the power button to restart the camera.
So after runing in CreateTask,What have camera done?
1.Some of the function in the stubs_entry_2.S have not been found yet.
2. the init_file_modules_task have not been fixed.
What I will done next to let the camera restart succ.


*

Offline ERR99

  • ****
  • 339
Re: A1100 IS Porting thread
« Reply #68 on: 23 / April / 2010, 02:55:02 »
Now the code like this.
Code: [Select]
...
        _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
The led works.Then camera shutdown.Because I can push the power button to restart the camera.
So after runing in CreateTask,What have camera done?
1.Some of the function in the stubs_entry_2.S have not been found yet.

The camera starts&run the CHDK Spy Task. So CHDK starts using function & variables defined in stubs_entry.s, stubs_entry_2.s. If you dont found the correct adresses for all of them (or at least NULLSUB them), they point into the middle of nowhere and crashes wenn the CHDK SpyTask calls them. So you have to find the correct addresses or (for now) NULLSUB all unknown functions (dont set them to 0x12345678 or somethink like that, thats an invalid pointer at will lead to a crash!)

Re: A1100 IS Porting thread
« Reply #69 on: 23 / April / 2010, 02:59:43 »
Thanks ERR99.I will do it now.

 

Related Topics