Autoboot with 8GB and HDHacker Possibillity

  • 143 Replies
  • 102698 Views
Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #20 on: 29 / March / 2008, 20:44:59 »
Advertisements
Hi
I search solutions for A650 IS & 8GB SDHS & VISTA 64bit

Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #21 on: 02 / April / 2008, 07:01:56 »
I have been using this feature in AllBest build 49 on an A650 IS and 8GB cards.  However, when trying to use a 16GB card I ran into a problem.  It appears that the code only recognizes a partition with ID 0xB as a FAT32 partition.  For larger partitions the ID is 0xC (FAT32 LBA).  LBA is needed if the cylinder number goes over 1023.

When the FAT32 partition ID is 0xC the FAT32 partition is not recognized by CHDK and passed to the camera.  In such cases, the camera uses the 32MB partition to store pictures.  If the partition is reduced in size by one cylinder, and thus ID 0xB, the partition is recognized by CHDK and passed to the camera.  The camera then uses the almost 8GB partition to store pictures.

I have not checked the source code to verify that this is actually what is happening.  Thus, this is merely a report of an observed problem with a considerable amount of unverified supposition as to the cause of the problem.

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #22 on: 02 / April / 2008, 07:45:38 »
When the FAT32 partition ID is 0xC the FAT32 partition is not recognized by CHDK and passed to the camera.

Well, camera itself (without CHDK) can recognize this partition? Which type of partition uses camera at formatting 16Gb cards?

I perform some tests on 2GB card - if FAT32 partition type is 0xB, 0xC and even 0x1 - camera (without CHDK) and WinXP recornizes this partition normally.

@ keyman:

Test version which supports 0xC partition type - http://ewavr.nm.ru/chdk/for_test/allbest-a650-100d-49.zip.
« Last Edit: 02 / April / 2008, 08:53:16 by ewavr »

Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #23 on: 02 / April / 2008, 11:08:05 »
I have been using this feature in AllBest on A650 IS and 8GB cards.
All works fine, but I can't read RAW files from camera :/ (this only one way on VISTA). JPEG files works and read fine.


*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #24 on: 02 / April / 2008, 11:29:31 »
When the FAT32 partition ID is 0xC the FAT32 partition is not recognized by CHDK and passed to the camera.

I perform some tests on 2GB card - if FAT32 partition type is 0xB, 0xC and even 0x1 - camera (without CHDK) and WinXP recornizes this partition normally.
Windows also accepts 0x83 (Linux) and just about anything. It doesn't look at the partition type, it just takes the first partition it can find. CHDK doesn't really care, either, if I recall correctly.. so you can just edit the partition type without breaking functionality.

@keyman: stupid that I forgot to check them in my initial version (I guess the current feature in trunk is based on it?). I only had an 8GB card at the time and I still haven't ordered a 16GB card, else I'd have run into it as well. Anyway, thanks for telling, now I can still put it in the S5 build :p
Edit: fixed by adding one line:
  CMP    R3, #0xB    // Is this a FAT32 partition?
+ CMPNE  R3, #0xC    // Not 0xB, is it 0xC (FAT32 LBA) then?
  BNE    dg_sd_fat32 // No, it isn't. Loop again.
« Last Edit: 02 / April / 2008, 11:39:56 by DataGhost »

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #25 on: 02 / April / 2008, 12:41:26 »
Now this support added to trunk (changeset 362).

Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #26 on: 03 / April / 2008, 16:13:24 »
@ keyman:

Test version which supports 0xC partition type - http://ewavr.nm.ru/chdk/for_test/allbest-a650-100d-49.zip.
As expected, the test version does recognize 0xC partitions and pass them to the camera.  I almost didn't get to posting a confirmation given the amount of changes needed, the code that DataGhost posted (which should clearly work), and the fact that you almost certainly tested it yourself by forcing a 0xC ID.  But, it is always better to close the loop on something like this.

I will post some benchmarks on the wiki later.  I have been running a bunch to directly compare formats (i.e. using the same card with different format types).

Handing off partitions to the camera leads to a general question as to what partition types we should hand to the camera.  Currently, properly ID'ed FAT32 and FAT32 LBA partitions are handed to the camera.  At the moment, without thinking about it much, I like it this way.  I routinely use Linux for partitioning, because after seeing the structures Windows has used on some extended partitions, I don't trust Windows to KISS.  Thus, I can have full control over what the ID will be (should I choose).  However, most users will be using Windows.  When not using extended partitions, Windows generally Keeps It Simple and partitions using primary partitions.  The various format methods in Windows appear to set the ID to type that was actually formatted. 

However, the camera, and Windows, recognize partitions with other ID types.  They should recognize them as it gives an opportunity for them to, at least, format the partition to a type that they can use.  For Windows, drivers can be loaded that allow it to use types it does not understand natively (e.g. Linux ext2/3 for Windows: Ext2 Installable File System For Windows (Read/Write), Explore2fs (Read, multiple formats), DiskInternals Linux Reader (Read)).  I expect the camera to just be able to format a partition of a type it does not read/write.

The question for CHDK is: What partition types should CHDK pass to the camera?  This can be rephrased into: Do we want to A) Do it Righttm; B) emulate how the Camera would do it; C) emulate how Windows would do it; D) pass all partitions properly ID'ed that the camera can natively read/write; E) any one of many possibilities; D) many I have not thought of or enumerated.

For instance, should we pass "Hidden" partition types?  I have never seen Windows pay attention to the "Hidden" bit (0x10).  Should we?  Personally, at some point, I might want to hide a partition from the camera. I expect this currently works, as only types 0xB and 0xC are passed.

The cameras, probably, can re-format any partition type resulting in a new ID type being written to the partition table.
The cameras, probably (untested), can read/write:
0x01 FAT12
0x04 FAT16 <32M
0x06 FAT16               (known to read/write and format to this type)
0x0b W95 FAT32        (known to read/write and format to this type)
0x0c W95 FAT32 LBA  (known to read/write and format to this type)
0x0e W95 FAT16 LBA  (this might not work)
0x11 Hidden FAT12
0x14 Hidden FAT16 <32M
0x16 Hidden FAT16
0x1b Hidden W95 FAT32
0x1c Hidden W95 FAT32 LBA
0x1e Hidden W95 FAT16 LBA

Personally, off the top of my head: I would definitely add 0x06 to the list.  I would not add the "hidden" types.  I would, probably, also add 0x0e to the list.

On the other hand, a good argument can be made for passing the camera the fist partition (actually the 2nd valid partition) with a non-zero ID type.  This would, probably, be the closest to the current camera operation.  It can reasonably be argued that the goal is merely to hide the first, small FAT16 partition and that beyond that is the responsibility of the person setting up the partitioning.  This argument assumes that the multi-partitioning support is, and will remain, very basic (i.e. nothing beyond hiding the first, small FAT16 boot partition, no swapping multiple partitions).
« Last Edit: 03 / April / 2008, 16:18:59 by keyman »

Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #27 on: 03 / April / 2008, 17:19:31 »
I thought, but failed to write, the important part:
Thank you for work and the quick changes!



*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #28 on: 03 / April / 2008, 17:33:48 »
The camera currently ignores the partition type, it even boots from FAT16 with 0x83. I personally don't really see why that should be changed, it will complain when it can't read the partition. Windows also ignores the partition type, which is annoying since this makes it not-simple to get it going on Windows :p

Anyway, I don't know what you're planning to do with hidden partitions on your camera but I do have the feeling that you're at least missing the point of my original intentions. The multipartitioning support (in my opinion) only makes sense on memory cards larger than 4GB, since FAT16 partitions cannot be larger. The camera won't boot off FAT32, it only boots off FAT12 or FAT16. This basically rules out >4GB cards on DryOS cameras, since they have no other way of loading CHDK than through diskboot. Anyway, to be able to use the space, the card has to be FAT32. To be able to run CHDK, the card has to be FAT16. Now I thought... if I can tell the camera to look elsewhere, I can both make it boot and use the full capacity of the card. The way I implemented this was by searching for FAT32 partitions (by type) and ONLY overriding them when such a partition is found. It makes no sense to have a large FAT16 partition (I don't see why you would want to use it) besides a FAT32 partition and it makes no sense to have a FAT32 partition when your card can be fully partitioned with FAT16, so (again, in my opinion) this assumption is safe. This means that there is no reason to add 0x06 or 0x0e to the list, and still, they would always 'pass' (effectively disabling multipartition, and only when the boot partition is not FAT12).

Also, I don't pass partitions with unknown IDs, since people might actually use their SD cards for different purposes (different filesystems) or some other, invalid junk could accidentally still be present in the MBR. Simple mistakes like that would render the camera useless while there shouldn't be a problem. I hope this makes sense :)

Re: Autoboot with 8GB and HDHacker Possibillity
« Reply #29 on: 13 / April / 2008, 10:04:29 »
Hi everyone and thank you to all the people (especially DataGhost) who work on the CHDK for the S5is. :)

Is it possible to clearly explain the procedure to use a 8GB SD card with CHDK in a S5IS (using winXP sp2)?

Everything work fine on a lower card capacity.

Since a bought a 8GB SD card, I would really like to use it.

Best regards,
Stef

 

Related Topics