Utilities to make FAT16, FAT32 and exFAT CF cards bootable - DSLR Hack development - CHDK Forum  

Utilities to make FAT16, FAT32 and exFAT CF cards bootable

  • 70 Replies
  • 136256 Views
*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Utilities to make FAT16, FAT32 and exFAT CF cards bootable
« on: 16 / September / 2009, 08:04:05 »
Advertisements
Hi,

I've just updated CardTricks to also allow making FAT32 partitions bootable,
when option "CF boot sector" is checked, the following strings are written to MBR:

FAT16:    at 0x2B "EOS_DEVELOP"    at 0x40 "BOOTDISK"
FAT32:    at 0x47 "EOS_DEVELOP"    at 0x5C "BOOTDISK"

(the quotes are not written, of course)

[edit] Note: Useless for CHDK / P&S in general,  only DSLRs can boot off FAT32 partitions

I have successfully tested on 8 GB SD cards and 8 GB memory sticks, but (as non-DSLR owner)
don't have CF cards to test on. Note that, because the program was originally developed just for
CHDK on SD cards, it will not allow you to format cards <= 4GB as FAT32.
For Canon P&S owners there is no new functionality
So...if any of you DSLR guys want to test this on real CF, it's here:

DL location:
CardTricks145  (535 kB, CT+cmdline+sources)       Windows 2000 or newer / no exFAT support

Please note: the cmdline utils DO NOT CHECK the file system - after running
bootableCF32.exe on a FAT16 card, or
bootable(CF).exe  on a FAT32 card     you will need to FORMAT and LOSE ALL DATA !

========================================================================
Recently, Pelican (reply #24) and zeno (reply #27) have released alternatives , thanks !
I'm linking them here for better overview:

Pelican's EOScard       Windows  edit 5-1-11:  exFAT support added

zeno's    MacBoot       Mac OS   edit 12-1-11:  exFAT support added

                                 Linux: see reply #4 (for FAT16 & FAT32) and arm.indiana's solution (for exFAT)

=========================================================================

cheers,

wim

[edit 30-12-09: re-uploaded, download limit (1000) was reached. Happy New Year you all ! ]
[edit 28-02-10: re-uploaded, download limit (1000) was reached again ]
[edit 28-03-10: re-uploaded, download limit (1000) was reached again ? ]
[edit 09-06-10: added alternative DL location ]
[edit 26-06-10: re-uploaded, download limit (1000) was reached again ]
[edit 21-11-10: removed drop.io links ]
« Last Edit: 12 / January / 2011, 11:13:27 by whim »

*

Offline thaibv

  • **
  • 57
  • Canon 400d: Spot, ISO 3200 and more
Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #1 on: 27 / September / 2009, 22:11:03 »
great, thanks Whim!

It is much easier for Fat 32 user now. HxD is not for newbie.
999 Members and 9999 Guests are viewing this board.

Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #2 on: 11 / November / 2009, 03:45:57 »
It is working fine with my CF 8Gb (Kingston, 133x) and Canon EOS 400D.
Many thanks!!!

Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #3 on: 06 / December / 2009, 04:28:39 »
How can I do it under linux OS?


*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #4 on: 06 / December / 2009, 07:38:48 »
How can I do it under linux OS?

The CHDK wiki for making cards bootable is here: http://chdk.wikia.com/wiki/Bootable_SD_card#Linux:

Disclaimer: I neither run Linux, nor do i have a DSLR, so below is just my best guess based on above link

probably the easiest is using a hex editor, note that you need to write two strings into the boot sector for DSLR,
for strings and offsets see the 1st post in this thread.

otherwise, using dd on the command line, it should be something like this (where 'sdx1' is your card's device name)

for FAT16:

echo -n EOS_DEVELOP | dd bs=1 count=11 seek=43 of=/dev/sdx1
echo -n BOOTDISK | dd bs=1 count=8 seek=64 of=/dev/sdx1

for FAT32:

echo -n EOS_DEVELOP | dd bs=1 count=11 seek=71 of=/dev/sdx1
echo -n BOOTDISK | dd bs=1 count=8 seek=92 of=/dev/sdx1

hope that helps,

wim

Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #5 on: 06 / December / 2009, 08:30:03 »
Thanks, it work very good :)

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #6 on: 06 / December / 2009, 09:30:52 »
@Vascom

Happy to hear that, did you use dd or hexedit method ?

wim

Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #7 on: 06 / December / 2009, 09:32:56 »
@Vascom

Happy to hear that, did you use dd or hexedit method ?

wim
I'm used dd.


Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #8 on: 06 / December / 2009, 17:25:23 »
I've added support in Magic Lantern to write the partition table to the CF card in the camera without having to use dd or Card Tricks to modify the card.  changeset to bootflags.c.

This uses the CF device structure that I found to be able to read the raw block, modify it in place, and then write it back to the card.

Code: [Select]
struct cf_device
{
// If block has the top bit set the physical blocks will be read
// instead of from the first partition.  Cool.
int (*read_block)(
struct cf_device * dev,
uintptr_t block,
size_t num_blocks,
void * buf
);

int (*write_block)(
struct cf_device * dev,
uintptr_t block,
size_t num_blocks,
const void * buf
);

void * io_control;
void * soft_reset;
};

Re: Utilities to make FAT16 and FAT32 CF cards bootable
« Reply #9 on: 30 / December / 2009, 15:12:38 »
please reupload cardtricks145-sfx-exe

 

Related Topics