Adding new cameras, applying patches into trunk (with source code prepared) - page 155 - General Discussion and Assistance - CHDK Forum

Adding new cameras, applying patches into trunk (with source code prepared)

  • 1627 Replies
  • 454722 Views
*

Offline philmoz

  • *****
  • 3138
    • Photos
Advertisements
Will this work or am I still missing something?

This will probably work, but will be of little to no use as far as CHIMP is concerned, due to the fact that the latter still has to support existing versions. This also applies to my patch, albeit with one distinction: mine was a relatively small and isolated change.


Can you not check the build number?
If it is greater than when the change is made call the new function - if earlier then you can still call the old function; but will get incorrect values, which is the case regardless.


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Can you not check the build number?

If get_partitionInfo() returns nil, the card isn't partitioned.
Otherwise, if count == 1, the card isn't partitioned.
Otherwise, if active == 1, the card is partitioned, and the service partition is active.
Otherwise, the card is partitioned, and the photos partition is active.

Aren't these correct regardless of the build number?
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline philmoz

  • *****
  • 3138
    • Photos
Can you not check the build number?

If get_partitionInfo() returns nil, the card isn't partitioned.
Otherwise, if count == 1, the card isn't partitioned.
Otherwise, if active == 1, the card is partitioned, and the service partition is active.
Otherwise, the card is partitioned, and the photos partition is active.

Aren't these correct regardless of the build number?


Yes, but prior to the build with any changes (either yours or mine), the type and size values may be wrong - I thought you needed these values?


Technically, if get_partitionInfo returns nil, then the port does not support partitioned cards in CHDK. The card could still be partitioned outside CHDK; but there is no way to tell in the CHDK code. This applies to post 2011 cameras that can boot from FAT32 partitions - these don't need to implement partitioning support.


It is also possible to have up to four partitions on the card - the swap_partitions function allows the user to rotate though them.


Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Yes, but prior to the build with any changes (either yours or mine), the type and size values may be wrong - I thought you needed these values?

They could be handy, but since they are unreliable, I can do just fine without them. Better yet, if type != 1, I may safely assume that there is no service partition.

Quote
Technically, if get_partitionInfo returns nil, then the port does not support partitioned cards in CHDK. The card could still be partitioned outside CHDK; but there is no way to tell in the CHDK code. This applies to post 2011 cameras that can boot from FAT32 partitions - these don't need to implement partitioning support.

I thought they did regardless. I'll have to add a check to the install logic.

Quote
It is also possible to have up to four partitions on the card - the swap_partitions function allows the user to rotate though them.

Presumably the CHDK directory is either on the first or on the second one, depending on the "active" value?
Author of CHIMP, Canon Hack Installation and Management Platform


*

Offline philmoz

  • *****
  • 3138
    • Photos
Yes, but prior to the build with any changes (either yours or mine), the type and size values may be wrong - I thought you needed these values?

They could be handy, but since they are unreliable, I can do just fine without them.
So none of these changes are really needed then?
Quote
Better yet, if type != 1, I may safely assume that there is no service partition.
Umm no - most cameras can autoboot from FAT12 and FAT16 partitions. So at least types 1 and 6 and probably 4, possibly others.
Quote
Quote
Technically, if get_partitionInfo returns nil, then the port does not support partitioned cards in CHDK. The card could still be partitioned outside CHDK; but there is no way to tell in the CHDK code. This applies to post 2011 cameras that can boot from FAT32 partitions - these don't need to implement partitioning support.

I thought they did regardless. I'll have to add a check to the install logic.

Quote
It is also possible to have up to four partitions on the card - the swap_partitions function allows the user to rotate though them.

Presumably the CHDK directory is either on the first or on the second one, depending on the "active" value?
Or could be all partitions - to use partition swapping on a dual partition card you need to copy at least the firmware update file to all partitions that you want to swap to. That way when the camera is restarted you can use the firmware update boot method to get back into CHDK.

The 'active' value could be anything from 1 - 4 depending on how many partitions and how may swaps have been done.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

So none of these changes are really needed then?

Strictly speaking, no, but I still believe there's a bug that should be fixed.

Quote
Quote
Better yet, if type != 1, I may safely assume that there is no service partition.
Umm no - most cameras can autoboot from FAT12 and FAT16 partitions. So at least types 1 and 6 and probably 4, possibly others.

By "service partition" I was referring to a partition that should get the files from / and _HDKMETA/PS/, but not from CHDK/.

Quote
Quote
Presumably the CHDK directory is either on the first or on the second one, depending on the "active" value?
Or could be all partitions - to use partition swapping on a dual partition card you need to copy at least the firmware update file to all partitions that you want to swap to. That way when the camera is restarted you can use the firmware update boot method to get back into CHDK.

The 'active' value could be anything from 1 - 4 depending on how many partitions and how may swaps have been done.

I think it's safe to assume that if there are more than two, the user should be able to update those manually.
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline philmoz

  • *****
  • 3138
    • Photos
By "service partition" I was referring to a partition that should get the files from / and _HDKMETA/PS/, but not from CHDK/.


Sorry, you've lost me there.


There is only ever one partition visible to the firmware/CHDK at any given time - all the files are loaded from this partition after the camera has finished booting.


The purpose of the small 'autoboot' partition is just that - a way to autoboot a card >4GB on cameras that can't boot off FAT32. CHDK is loaded from this partition by the firmware; but the CHDK boot code then swaps to the other partition - this happens before the file system is re-initialised. After this is done every file is then loaded from the larger partition.

Once CHDK is started, the small 'autoboot' partition is no longer accessible in any way.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Patch to add m3_120f to camera_list.csv.
Author of CHIMP, Canon Hack Installation and Management Platform


*

Offline reyalp

  • ******
  • 12217
Patch to add m3_120f to camera_list.csv.
Thanks for catching that. Added.
Don't forget what the H stands for.

Updates for ixus300_sd4000 based on recent issues identified by Robert1975.

link > Start in recording mode - SD4000/IXUS 300 HS
link > CHDK on SD4000/IXUS 300 HS
link > Automatic Playback button press - SD4000

Changes:
  • confirmed reyalp's recent changes to the keymap work correctly and the camera keys / jog dial / feather touch work correctly in <ALT> mode
  • fixed the SD override code (manual focus) including the necessary platform_camera.h settings
  • fixed the dual partition support
  • added custom palette colors for a much nicer CHDK UI experience
  • tested that the script is_key function and the uBASIC interpreter work properly

Note that most chdkptp functionality seems to work with the exception of LiveView.  Attempting to use LiveView does not crash but the image is unusable.  Fixing this looks like much more work than I have time for right now - the ixus300_sd400 has what appears to be a somewhat unique extra wide LCD.  Might be an issue - might not.

The following newer entries from stubs_entry.S were accepted over the original port's stubs_entry_2.S values. In testing, the AFL calls seem to work the same but the ND filter calls were an improvement (no Canon exposure changes from the ND filter being inserted) The MoveFocusLensToDistance corrected SD override crashes. I went on faith for the other ones lacking any specific tests or time to research frankly.

stubs_entry.S same as stubs_entry_2.S
Code: [Select]
NHSTUB(GetDrive_FreeClusters,       0xFF871E90 -> 0xff871e90
Accept new stub_entry.S values

Code: [Select]
NHSTUB(DoAFLock,                    0xFF87A910 -> 0xff8382e4
NHSTUB(UnlockAF,                    0xFF87A920 -> 0xff83831c
NHSTUB(PutInNdFilter,               0xFFB2056C -> 0xffab69c8
NHSTUB(PutOutNdFilter,              0xFFB205A4 -> 0xffab69ec
NHSTUB(ScreenLock,                  0xFFA1356C -> 0xffa13354
NHSTUB(GetImageFolder,              0xFF94337C -> 0xff94345c
NHSTUB(MoveFocusLensToDistance,     0xFFB2289C -> 0xffb228b0
NHSTUB(SetScriptMode,               0xFF810F6C -> 0xff895904
DEF(zoom_status,                    0x0000315B -> 0x0000cea4
DEF(recreview_hold,                 0x0000780E -> 0x00003a20
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics