A2200 IS porting thread - page 3 - DryOS Development - CHDK Forum supplierdeeply

A2200 IS porting thread

  • 515 Replies
  • 179903 Views
*

Offline dejco

  • *
  • 20
Re: A2200 IS porting thread
« Reply #20 on: 14 / August / 2011, 20:47:02 »
Advertisements
^^if you need tester let me know

Re: A2200 IS porting thread
« Reply #21 on: 20 / August / 2011, 13:18:28 »
Quick status update:

No luck yet getting the CHDK shell to boot. Don't know where exactly goes wrong, might be a mistake in the code so far or I haven't done something yet (the number of patched functions from r47 reference port differs from r45, need to start trying some variations between the two).

I need to look at something different for a while, so I decided to resolve the stubs.S and stubs_mini.S files in the mean time (I noticed that the CHDK improved auto detection, so there is not as much left to find by hand).

And for that I wrote a bash script that parses trough gcc disassembly and find the assembly functions, described by the input parameters:

Code: [Select]
#!/bin/bash

clear

echo "File   : $1"
echo "Start  : $2"
echo "End    : $3"
echo "Lines  : $4"
echo "Pattern: $5"

# acquire
DATA=`sed -n '/\t'$2'/,/\t'$3'/p' $1`
RESULT=""

# output
echo
echo "--------------------------------- RESULT ----------------------------------"
echo

# process
while read -r line; do
# start pattern found
if echo "$line" | grep -q -w -i "$2"; then
lineCounter=0
block=""
fi

# adding lines
block="$block\n$line"
((lineCounter++))

# end pattern found
if echo "$line" | grep -q -w -i "$3"; then
# line limiting
if [[ "$4" -eq 0 ]]; then
block="$block\n"
else
if [[ "$lineCounter" -le "$4" ]]; then
block="$block\n"
else
block=""
fi
fi
# sub pattern matching
for i in $(echo $5 | tr "," "\n"); do
  if echo -e "$block" | grep -q -w -i "$i"; then
continue
else
block=""
fi
done
#RESULT="$RESULT$block"
# output
if [[ "$block" != "" ]]; then
echo -e "$block"
fi
fi
done <<< "$DATA"

# output
echo
echo "---------------------------------- DONE -----------------------------------"
echo

Usage:
Code: [Select]
sh patternFinder.sh <filename> <start_element> <end_element> <max_lines> <elements_array>Example:
Code: [Select]
sh patternFinder.sh A2200_1.00B.dis push b 0 "add,ldr"
So if anyone finds it useful for porting (or any kind of multi line pattern matching), or knows if scripts like this are collected somewhere here for any to find, let me know!

Re: A2200 IS porting thread
« Reply #22 on: 24 / August / 2011, 04:24:42 »
I think I managed to get to the CHDK boot screen, but it's all garbled so I'm not sure. It looks like this.

Does the boot screen show up when the CreateTask_spytask() is called? Because I can't get an LED to blink in the init_file_modules_task(), so I'm nut sure what is running and what not.

I'll hit the forums if something like this has come up before, but I have an exam in a week, so porting time will be scarce in the mean time.

So, any one with an idea that will save me time will be greatly appreciated!

*

Offline srsa_4c

  • ******
  • 4451
Re: A2200 IS porting thread
« Reply #23 on: 24 / August / 2011, 08:15:04 »
I think I managed to get to the CHDK boot screen, but it's all garbled so I'm not sure.

You may want to check /platform/a2200/sub/(fw version)/lib.c for the width of the bitmap buffer or screen (?). Your model has maybe only half of width.
Or there's a problem with the aspect ratio (not sure, haven't touched any of these).
« Last Edit: 24 / August / 2011, 08:17:38 by srsa_4c »


Re: A2200 IS porting thread
« Reply #24 on: 24 / August / 2011, 13:23:43 »
You may want to check /platform/a2200/sub/(fw version)/lib.c for the width of the bitmap buffer or screen (?). Your model has maybe only half of width.
Or there's a problem with the aspect ratio (not sure, haven't touched any of these).

Thanks!

I figured it will be something along those lines, but finding stuff on your own in yet unknown code can be tedious.

I tried some combinations really quick, it's still garbled, but different with every change. I'll keep trying!

*

Offline srsa_4c

  • ******
  • 4451
Re: A2200 IS porting thread
« Reply #25 on: 24 / August / 2011, 18:52:45 »
The comments in the ixus105 port (sdm 1.85), lib.c helped me to find this (a2200 1.00b, gpl disasm):

Code: [Select]
ff912c28: e3a00e2d mov r0, #720 ; 0x2d0
ff912c2c: e3a010f0 mov r1, #240 ; 0xf0

It should be the value for vid_get_bitmap_buffer_width() and vid_get_bitmap_buffer_height()


also, look into /core/gui_draw.c, look for the function
void draw_init()

and see the comments there.

(SDM's latest source is here: http://stereo.jpn.org/eng/sdm/download.htm). I only used it because I have its firmware already disassembled and its port has some comments... Beware, that port is unstable.)

Re: A2200 IS porting thread
« Reply #26 on: 25 / August / 2011, 06:39:18 »
The comments in the ixus105 port (sdm 1.85), lib.c helped me to find this (a2200 1.00b, gpl disasm):

Code: [Select]
ff912c28: e3a00e2d mov r0, #720 ; 0x2d0
ff912c2c: e3a010f0 mov r1, #240 ; 0xf0

It should be the value for vid_get_bitmap_buffer_width() and vid_get_bitmap_buffer_height()

This is brilliant.

With that I get readable CHDK splash screen. Next stop for me, figure out why init_file_modules_task() doesn't executes.

I was meaning to check out StereoData Maker for my project, once I figure out CHDK and port my camera on it, but I didn't notice there were models in there not yet in the CHDK. So far I've been basing my port on ixus 120 & 130 (similar spec. camera and readable code) and sx220hs (r47 of DryOS). The comments in ixus 105 are most helpful.

In just a couple of posts I learned a lot from you, thank you again!
« Last Edit: 25 / August / 2011, 06:43:57 by Nilinhim »

*

Offline srsa_4c

  • ******
  • 4451
Re: A2200 IS porting thread
« Reply #27 on: 25 / August / 2011, 11:29:23 »
If you based your port on a model with an earlier dryos revision, don't forget that you don't need partition swapping stuff any more. Looking at the sx220 code (boot.c) it looks like all you need to do is copying relevant parts of your camera's firmware and modify some lines (according to your reference port). init_file_modules_task() is now only needed for "core_spytask_can_start".
Now that you have display, you could hack a bit on /core, to display some info that's needed.
About the logo: spytask is core_spytask() in /core/main.c, it calls gui_redraw() in its loop. gui_redraw() is in /core/gui.c, it handles the drawing of the splash logo. So if you have splash at start, you have spytask running, which means the sole modification of init_file_modules_task() has succeeded.


Re: A2200 IS porting thread
« Reply #28 on: 25 / August / 2011, 12:03:53 »
init_file_modules_task() is now only needed for "core_spytask_can_start".
Sort of - "core_spytask_can start" is just a flag that causes spy_task to delay until init_file_modules_task has finished its work setting up the card.  If you don't need to setup the card then you don't need the "core_spytask_can start" interlock either.

Quote
So if you have splash at start, you have spytask running, which means the sole modification of init_file_modules_task() has succeeded.
Not necessarily.  Spy_task only delays for a few seconds waiting for init_file_modules_task() to set the "core_spytask_can start"  flag.  If the flag never gets set,  it continues anyways after the delay.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: A2200 IS porting thread
« Reply #29 on: 25 / August / 2011, 13:54:19 »
Not necessarily.  Spy_task only delays for a few seconds waiting for init_file_modules_task() to set the "core_spytask_can start"  flag.  If the flag never gets set,  it continues anyways after the delay.

Oops. I missed
Code: [Select]
while((i++<400) && !spytask_can_start) msleep(10);  :)

 

Related Topics