SD980 port - page 2 - DryOS Development - CHDK Forum
supplierdeeply

SD980 port

  • 162 Replies
  • 30828 Views
*

Offline reyalp

  • ******
  • 11898
Re: SD980 port
« Reply #10 on: 21 / September / 2009, 04:56:41 »
Advertisements
From looking at the makefile, you have to explicitly enable the FI2, and you need some keys that I didn't understand how to get (yes, I did read the thread, but maybe I am too tired).
Then how are you building your FI2 ???

If you are using some other program after the fact, built it from main.bin (in loader/<camera>) rather than diskboot.

I would BTW suggest keeping your SVN up to date. It will make merging much easier. Also, it would be nice to know if the new encoding is correct for diskboot.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 890
Re: SD980 port
« Reply #11 on: 21 / September / 2009, 05:23:16 »
I am using ewavr's program from here: http://chdk.setepontos.com/index.php/topic,2995.msg28164.html#msg28164
It converts unencoded diskboot.bins to ps.fi2
I will go to bed now, and will update the code from the latest svn tarball. I don't think keeping the code up to date is an issue so far, so long as there are not many hacks such as defining camera specific stuff in kbd.c :D
Will also test the new encryption and will let you know how it works.

*

Offline fe50

  • ******
  • 3099
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: SD980 port
« Reply #12 on: 21 / September / 2009, 06:34:12 »
And I am not making the FI2 with the makefile, I am making it with a bat that I also used with the blinker. But it is made from the diskboot.bin
So i guess you also use an old version of encoder, without support for the new NEED_ENCODED_DISKBOOT=3 option...e.g. based upon my old SX10 blinker archive which is from december 2008, with the old encoder ...

*

Offline RaduP

  • *****
  • 890
Re: SD980 port
« Reply #13 on: 21 / September / 2009, 13:20:31 »
So i guess you also use an old version of encoder, without support for the new NEED_ENCODED_DISKBOOT=3 option...e.g. based upon my old SX10 blinker archive which is from december 2008, with the old encoder ...

Ok, now I am totally confused :/
If my SVN is 3 weeks old, then why isn't something that was made in December last year in there?


*

Offline RaduP

  • *****
  • 890
Re: SD980 port
« Reply #14 on: 21 / September / 2009, 20:38:58 »
The bootdisk.bin encoded with the new tool, NEED_ENCODED_DISKBOOT=3 works, firmware starts. Thanks!

*

Offline RaduP

  • *****
  • 890
Re: SD980 port
« Reply #15 on: 21 / September / 2009, 23:04:43 »
Ok, I managed to get the code to execute just until the boot(); function.
Now, I am kind of stuck with boot.c
I made sure that the code is identical with the one in the firmware, but I have some questions.
For example, from the porting camera wiki: "MEMISOSTART is replaced; the CHDK core is now load at that address so we must adjust the memory pool accordingly."
Where exactly do we do that, and how do we adjust it accordingly?

At the end of the startup function (based on the SX10 port), we have:
Code: [Select]
"B       sub_FF8101A0_my\n"I replaced that with
Code: [Select]
"B       0xFF810354\n"That's where the original firmware of my camera goes after the first init code. And the camera doesn't boot or anything. I was expecting something to happen, I don't care for now about task creations and stuff. Any idea?


*

Offline reyalp

  • ******
  • 11898
Re: SD980 port
« Reply #16 on: 21 / September / 2009, 23:51:56 »
Code: [Select]
"B       0xFF810354\n"
As I explained to you in detail earlier, that doesn't do what you think it does.

If you use
Code: [Select]
B sub_FF810354The CHDK build process will correctly generate a thunk for you (see stubs_auto.S and associated makefile stuff)
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 890
Re: SD980 port
« Reply #17 on: 22 / September / 2009, 00:04:14 »
Right, I r n00b, forgot about that :/
Anyway, I did replace it with B sub_FF810354 and no go.
Now, the question is, should the camera restart, or is it normal to hang like that unless if I follow with the rest of the modified boot process?


*

Offline RaduP

  • *****
  • 890
Re: SD980 port
« Reply #18 on: 22 / September / 2009, 00:15:44 »
Ok, I am newb again. Remember when you told me to find the magic value that was supposed to turn off the SD? Well, I forgot about that part, so I was stuck in an infinite reboot loop.
How do I find that number?

*

Offline reyalp

  • ******
  • 11898
Re: SD980 port
« Reply #19 on: 22 / September / 2009, 00:16:12 »
Right, I r n00b, forgot about that :/
Anyway, I did replace it with B sub_FF810354 and no go.
Now, the question is, should the camera restart, or is it normal to hang like that unless if I follow with the rest of the modified boot process?
I would expect it work. Keep in mind that if you are loading from a diskboot.bin, you'd end up in a boot loop because you haven't yet got to the place you can override diskboot loading.

The inline assembly in loader/<camera>/resetcode/main.c is important for correct booting AFAIK.

oops:
You can avoid the boot loop by having the card unlocked and loading with an FI2. Not turning off the SD card may cause other problems.

edit again:
re finding the SD power MMIO, here's what I noted in the SD990 port
   LDR     R3, =0xC0220018 // sd990: from sub_FFFF1390, also ref SdPower.c

I don't recall exactly how I decided that was the right value, note that sub is in the rescue loader, which would not be in your dump. "SdPower.c" would be a string in the main code. As always, the thing to do is to find the code in an existing port, and then find the corresponding code in your dump.
« Last Edit: 22 / September / 2009, 00:20:23 by reyalp »
Don't forget what the H stands for.

 

Related Topics