fi2 encoder/decoder - page 4 - DryOS Development - CHDK Forum supplierdeeply

fi2 encoder/decoder

  • 100 Replies
  • 66668 Views
*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: fi2 encoder/decoder
« Reply #30 on: 25 / January / 2009, 18:28:33 »
Advertisements
BTW - what's the rush in reflashing the i870 ? It isn't even ported yet  ;)

In order to have most modern firmware version (with correctd bugs) - even without CHDK.
Bit I think that man who can create fi2 packer, can port CHDK to any camera in a few hours  ;) (of course, if he needs CHDK).

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: fi2 encoder/decoder
« Reply #31 on: 25 / January / 2009, 18:42:34 »
@ewavr

you read my mind  :haha

wim

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: fi2 encoder/decoder
« Reply #32 on: 25 / January / 2009, 19:37:19 »
It would be a whole lot easier to implement the ps.fi2 stuff on the autobuild server, if the fi2encdec tool could read the stuff which is currently in the *.map file from command line options.. Just as a little feature request.
But we can create (and delete after) .map file on the fly from makefile, something like:
Code: [Select]
printf "FI2_MAP 1\nHDR 0x%08x 0x02230000 0x01010000 0x0 0x1\n0x0 diskboot.bin boot " $(PLATFORMID) > $(topdir)/bin/main.map

Quote
Oh and using platform independet code would be nice too, using a wrapper for the winapi function _strlwr kindof sucks.
But code which you posted in message #10 contain this wrapper, correct?

p.s. Due to unknown (for me) error I can't install gcc to ubuntu 8.10 (I am not Linux expert), so can't test cross-platform makefiles/sources.
« Last Edit: 25 / January / 2009, 19:46:37 by ewavr »

*

Offline Hacki

  • ****
  • 359
  • EOS 80D
Re: fi2 encoder/decoder
« Reply #33 on: 26 / January / 2009, 02:30:18 »
But we can create (and delete after) .map file on the fly from makefile, something like:
Code: [Select]
printf "FI2_MAP 1\nHDR 0x%08x 0x02230000 0x01010000 0x0 0x1\n0x0 diskboot.bin boot " $(PLATFORMID) > $(topdir)/bin/main.map

Well, it would need to be done with sed or something like that, as the *.map files have multiple lines.. but basically you're right. Still, i'd just like it more to have that platform ID as a command line option. I tried to code that yesterday, but kindof miserably failed. Not a c-programmer (yet) ;)


Quote
But code which you posted in message #10 contain this wrapper, correct?

p.s. Due to unknown (for me) error I can't install gcc to ubuntu 8.10 (I am not Linux expert), so can't test cross-platform makefiles/sources.

Yes it does, but i dont think this is a good way to do it, if there is a similar ANSI C compatible function instead of the _strlwr

And for the linux stuff: Try using http://mighty-hoernsche.de/chdk/linux_env_gcc_4.3.1_binutils_2.18.tar.lzma - Decrompress & untar (the former one is done with the tool "lzma"), then do a "export PATH=${PATH}:/path/to/newenv/arm-elf/bin" - and everything should be set and working.

Ubuntu is similar to debian, so i think that env should run as it is. There could be a problem with the ubuntu default shell - its not bash, its dash, which apparently doesnt know the export command. (At least someone on IRC was having problem with the export command, starting a bash by simply typing in "bash" did help)

I'll check the method with echo & modifying the file, the problem is that it makes the whole thing more platform dependend. A platform independend fi2encdec toll with a cli option switch for the ID would work on linux and windows out of the box, when i'm using sed, echo and so on to modify the *.map file, that wont work on windows.. (unless you install those tools in cygwin of course)

Regards


*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: fi2 encoder/decoder
« Reply #34 on: 26 / January / 2009, 07:56:19 »
@hacki

Quote
when i'm using sed, echo and so on to modify the *.map file, that wont work on windows..

don't know what you mean with ..and so on.. , but sed & echo are present in any CHDK compatible devkit,
or it wouldn't run - Makefiles won't run without them (see makefile.inc lines 210+)
BTW in the MingW devkits, sh = in fact zsh

and about _strlwr: that sounds like just converting a string to lower case, or is there a problem there like
that it needs to handle 0 bytes or something weird like that ? attached ctype.h from MingW32  FYI

edit: i now actually read the code  :D (where it contains _strlwr that is) and it seems to be used only to parse the
command line args - which AFAIK another program will supply, so you could do case checking there and just
strip _strlwr or am i missing sth here ?


wim
« Last Edit: 26 / January / 2009, 08:14:17 by whim »

*

Offline Hacki

  • ****
  • 359
  • EOS 80D
Re: fi2 encoder/decoder
« Reply #35 on: 26 / January / 2009, 08:07:47 »
Quote
don't know what you mean with ..and so on.. , but sed & echo are present in any CHDK compatible devkit,

Right. Forgot about that, as i'm not using windows.

Quote
and about _strlwr: that sounds like just converting a string to lower case, or is there a problem there like
that it needs to handle 0 bytes or something weird like that ? attached ctype.h from MingW32  FYI

There's not really a problem. strlwr is just not an ANSI C function (its a winapi function), and therefore not available in linux. (unless you tinker together a function like seba did for that fi2encdec tool).


*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: fi2 encoder/decoder
« Reply #36 on: 26 / January / 2009, 08:19:14 »
@hacki

sorry, was still editing post while you answered

wim

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: fi2 encoder/decoder
« Reply #37 on: 26 / January / 2009, 19:16:12 »
Still, i'd just like it more to have that platform ID as a command line option.

Well, simplified (by me) version is attached to this post (encoder only, source only).
example of usage: fi2enc.exe -sys g9 -p 0x315E diskboot.bin ps.fi2
(PID can be given in decimal or hexadecimal form, "new firmware" version is hardcoded as "1.1.0.0" (hdr.id=0x01010000;)).

Quote
And for the linux stuff: Try using http://mighty-hoernsche.de/chdk/linux_env_gcc_4.3.1_binutils_2.18.tar.lzma - Decrompress & untar (the former one is done with the tool "lzma"), then do a "export PATH=${PATH}:/path/to/newenv/arm-elf/bin" - and everything should be set and working.
Many thanks, all works fine. I also compiled fi2enc.c under Lixus, it works.
Maybe next step is adding this encoder to CHDK (I am not Makefile master, but I'll try... )
« Last Edit: 26 / January / 2009, 19:18:44 by ewavr »


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: fi2 encoder/decoder
« Reply #38 on: 27 / January / 2009, 15:02:29 »
Now all works under Windows/Linux (fi2 is created automatically),  I'm ready to commit changes to trunk.
But how about keys?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: fi2 encoder/decoder
« Reply #39 on: 27 / January / 2009, 18:18:04 »
maybe add the keys to a file that is NOT added to svn but must be existing in filesystem, like for example on the autobuild?
« Last Edit: 29 / January / 2009, 15:32:40 by PhyrePhoX »

 

Related Topics