reyalp
Nimrod, looks like you've found pretty much everything you need. Porting a new sub version of an existing firmware is a lot easier than a new port. You will need to dump your specific firmware version.
Awesome. I just downloaded the 1.02b dump on the wiki page for the
sx10. Hopefully that one is correct.
The majority of function addresses are automatically found, as described in
http://chdk.wikia.com/wiki/Signature_finder (that page is aimed at people adding new function signatures, which you don't need to do, but should help you understand the process) So what you are left with is fixing up the asm in boot.c, capt_seq.c, movie_rec.c, and filling in the addresses in stubs_entry_2.s (including any that aren't found correctly in the automatic stubs_entry.s) and stubs_min.s
Ok, got it. That was the page that I looked at way too briefly earlier, but I get the basic idea. Right now I'm just using it as part of the normal build process having put the PRIMARY.BIN into my new sub directory.
You can start by copying an existing platform, but for some of the inline asm it's probably easier to start from ida disassembly instead, since you would have to go through line by line to fix all the offsets anyway. For the .s files, you should start from scratch.
Ok, that's what I did, for now, just to make 'make' happy so it would generate the stubs_entry.S, and that seems to be working.
The 1.01b files will probably not help you with 1.02b, unless they happen to be compatible. Since there aren't ports for either one yet, we don't know if they are.
Well, comparing what evwar uploaded in his zip file for 1.01b .S files, it looks like his stubs_entry.S looks suspiciously like what the build process just generated from the 1.02b image:
1.01b from evwar:
// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!
#include "stubs_asm.h"
NSTUB(AllocateMemory, 0xffa67c20)
// Best match: 56%
NSTUB(AllocateUncacheableMemory, 0xff827fdð
NSTUB(Close, 0xff823a64)
NSTUB(CreateTask, 0xff81aef4)
NSTUB(DeleteFile_Fut, 0xff823310)
// ERROR: EnterToCompensationEVF is not found!
... etc
1.02b generated by me running build with 1.02b image from wiki
sx10 page:
// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!
#include "stubs_asm.h"
NSTUB(AllocateMemory, 0xffa67c20)
// Best match: 56%
NSTUB(AllocateUncacheableMemory, 0xff827fdð
NSTUB(Close, 0xff823a64)
NSTUB(CreateTask, 0xff81aef4)
NSTUB(DeleteFile_Fut, 0xff823310)
// ERROR: EnterToCompensationEVF is not found!
... etc
Doing an actual diff between these (evwar's 101b and the 102b I just generated) gives me:
C:\CHDK\trunk\trunk772\platform\sx10\sub>diff 101b\stubs_entry.S 102b\stubs_entry.S
99,102c99,102
< NSTUB(_log, 0xffb01a10)
< NSTUB(_log10, 0xffb0069c)
< NSTUB(_pow, 0xffb0080c)
< NSTUB(_sqrt, 0xffb0366c)
---
> NSTUB(_log, 0xffb01a40)
> NSTUB(_log10, 0xffb006cc)
> NSTUB(_pow, 0xffb0083c)
> NSTUB(_sqrt, 0xffb0369c)
How often does this turn out to be the case? Funny that it's all the same except for these 4 math functions. Of course I have to keep in mind that some of the ones that weren't found automatically may also be similarly different, but it sounds like evwar's work might apply and thus save time.
If you need real time advice, there's frequently a few of us idling in #chdk on freenode.
Cool, thanks.
(I'm surprised that I've gotten this far so fast, but I suppose that most of it is thanks to whim's CHDK shell and all the people who contributed to the wiki docs! That's saved a lot of time. Thanks guys!)