the sx20 porting thread - page 9 - General Discussion and Assistance - CHDK Forum

the sx20 porting thread

  • 1286 Replies
  • 460660 Views
*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #80 on: 22 / October / 2009, 06:06:04 »
Advertisements
Ok, well, as you can see in my code, at the end of the boot() function we jump into a modified routine, "B         sub_FF810354_my"   //checked //---------->
That jumps into                  "BL      sub_FF81178_my\n"  //------------>
Which                  "LDR     R1, =sub_FF815E34_my\n"  //------------>
Which                  "B       taskcreate_Startup_my\n"
Which              "LDR     R3, =task_Startup_my\n" // ->
Which finally:       //         "BL      sub_FF83A2F8\n"    // start diskboot.bin
So if you do not modify your code all the way to there, the original firmware will try to load the bootdisk.

Yes, yes, yes. But i don't jump to sub_FF810354_my, i jump to sub_FF810354. That is, what i told, i don't add any spy or startup task.

edit:

I'am in this position, where you were:

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

edit again:

But you got it to work after a short time:

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

In this post, do you remember what means "Ok, the firmware update works". Was that mean, that your camera had rebooted correctly? Or did you do something else?
« Last Edit: 22 / October / 2009, 06:26:35 by neszt »

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #81 on: 22 / October / 2009, 13:21:41 »
Well, I know you don't go to sub_FF810354_my which is why I told you. If you don't complete the whole code, you are going to get stuck into the infinite boot loop. You don't really have to add the spy task, you can comment out the code adding it.

In that post, what I meant was that I got it to work via the firmware update, as in, the camera reboots.

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #82 on: 22 / October / 2009, 14:14:17 »
Well, I know you don't go to sub_FF810354_my which is why I told you. If you don't complete the whole code, you are going to get stuck into the infinite boot loop. You don't really have to add the spy task, you can comment out the code adding it.

Well, now I probably close to the solution! Please read my following questions carfully, it will be hard to me to ask correctly..

The porting guide says:
Quote
platform/<camera>/sub/<version>/boot.c

The adopted reimplementations of the first boot functions are located in this file. In essence you can just take the code from the firmware and copy the changes as made in your reference port. Once you have got the boot code ready, the camera should boot normally again.

This means, as i understand, enought to take the first asm function code until the first "B     loc_FF810354", not taking the remaining functions. Am i right? Or need to take the whole code?

A.: What does "B     loc_FF810354" do? (at the end of the first taken boot code from firmware)

IMO it jumps to the camera firmware code, therefore, the camera should boot normally again. Am i right?

B.: What do "B     loc_FF810354_my" do?

IMO it jumps to the additional taken code, which allows us to add our hack tasks. Am i right?

C.: What does your camera do, when use try the code "B     loc_FF810354" intead of "B     loc_FF810354_my"?

Quote
In that post, what I meant was that I got it to work via the firmware update, as in, the camera reboots.

C/2.: I understand, that your camera reboots, but detailed how? Did you see the normal menu, and the buttons worked normally? (as i expected)

I hope i missunderstood the guide, and the answer for question "A", is that i am not right.

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #83 on: 22 / October / 2009, 14:29:16 »
Ok, let me explain again.
The purpose of the hacked boot code is to PREVENT the camera from booting normally.
If the camera boots normally, it will try to load the boot disk again, so you will be in an infinite boot loop.
Therefore, you must modify the boot code all the way to where I told you, to comment the load boot disk function. Only then the camera will NOT try to load the bootdisk again.
I think the documentation is wrong, if you have a bootdisk file and the SD card is marked as bootable, even if you use the firmware update method, it will not boot normally until you modify further in the bootcode, because the camera will try to boot from it. So either modify the bootcode all the way to remove that bootdisk loading function, or delete the bootdisk file and use the firmware update method.


*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #84 on: 22 / October / 2009, 17:18:42 »
Well, it's clear now, thanx. I'am on to finish the remaining part of boot.c.

*

Offline reyalp

  • ******
  • 14096
Re: the sx20 porting thread
« Reply #85 on: 22 / October / 2009, 18:24:42 »
I think the documentation is wrong, if you have a bootdisk file and the SD card is marked as bootable, even if you use the firmware update method, it will not boot normally until you modify further in the bootcode, because the camera will try to boot from it. So either modify the bootcode all the way to remove that bootdisk loading function, or delete the bootdisk file and use the firmware update method.
Or unlock the card. The camera will not try to load the DISKBOOT.BIN if the card is not locked.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #86 on: 22 / October / 2009, 18:29:46 »
Yeah, or that :)

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #87 on: 22 / October / 2009, 18:43:14 »
I finished the whole boot.c. I also got E31, but now, i know what function call couse that.

This is eventproc_export_CreateController at 0xFF8945F0. It's name helps me few.. :)


*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #88 on: 22 / October / 2009, 18:49:38 »
How did you find out, and where is it called from?

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #89 on: 22 / October / 2009, 19:03:56 »
How did you find out, and where is it called from?

I find it by copy the firmware code to boot.c (which is the porting process :-) )

It is called from task_Startup_my().

In my case, especialy the

"BL      sub_FF83B670\n"

Following this function by copy the whole code to boot.c, i find a

"BL   sub_FF8945F0\n"

And calling blink debug before it, i got blinking with NO E31.
Calling blink debug after it, i got blinking WITH E31.

Yes, again, blinking after this call, i got ALSO BLINK and E31. (Multithread?)
After all, the camera turns off.

Commenting this code out, couse the camera turns off.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal