Archive for February, 2008

CHDK, the Canon A650, and my Mac

Tuesday, February 19th, 2008

CHDK is a custom software package written for many Canon camera models that allows a significantly greater level of functionality than just running the factory software alone. I’m going to chronicle the past 72 hours of experiences with getting CHDK working as it is intended.

CHDK is a fantastic piece of software that lets cheapos like myself shoot raw photos on their point and shoot cameras.  I currently own a Canon A650, and the fiancee has a Canon A620. CHDK will run on both cameras, but this discussion will be relating to the A650 exclusively.

Since the A650 has just been added to the list of cameras supported by CHDK in the past month, there are obviously things that are different when compared with previous generations. Because the A650 runs Canon’s in-house DryOS and not the previous operating system used by their cameras, there are some limitations and idiosyncracies that have been encountered by the developers. The most up-front limitation is that the software (”firmware” as stated by many sites) must be booted into on the SD card rather than just enabled after boot as on previous generation cameras.

Booting to the SD card on the A650 (and other Canon cameras) requires that the card be formatted FAT16. “Standard” FAT16 allows a maximum 2GB volume size. My 2GB SD cards work like champions. They are fantastic. But what about those spacious, roomy 4GB SDGC cards? On cameras that do not require booting to the SD card, the software can just be copied to the card and run from the menu that appears on screen. 4GB cards work just fine that way. DryOS and the Canon firmware won’t let that happen on the A650, however. Luckily for me and those who have 4GB SD cards, Microsoft “extended” FAT16 around the time of Windows 2000 to allow for 4GB volumes when using 64k clusters. It is not “widely” supported, but supported enough to work with this hack.

I find diskutil in OS X to be a very useful tool in my attempts to format my 4GB card, except when it comes to FAT16. Nothing I could find would work, and in my Google searching, nothing else came up either. I decided to try installing Linux through Parallels to see what would come of it. Ubuntu didn’t like Parallels, and refused to install. I didn’t troubleshoot it since I didn’t really care, so I moved onto Fedora Core 8. Fedora took a while to install, and booted up quite nicely. Didn’t want to recognize any of my card readers through Parallels at all, so that was out of the picture for a fast fix, anyways.

I broke down and installed WinXP Pro. And it worked first time out. I formatted the 4GB card as FAT16 with 64k clusters, and was able to get the card to work with the A650. OS X even reads the card with the “non-standard” volume format. I was happy that it worked, but depressed that I had to use Windows to do it. Why, I asked, would OS X read this non-standard disk but not be able to create one? I posted my experience , briefly, in the CHDK forums, and asked for some guidance.

One knowledgeable poster mentioned that many UNIX-like systems have (or have available) a program called newfs_msdos. I thought I might have to use DarwinPorts or something like that to install it. I thought wrong AGAIN. newfs_msdos is part of OS X 10.4 and 10.5, and probably part of earlier versions as well. It was only a matter of time before I hammered out the fine points of getting newfs_msdos working the way I wanted. After a few minutes, I got it down. Here’s the complete compendium of getting CHDK working on a 4GB SD card in the A650 using OS X:

  1. Install DarwinPorts from http://darwinports.com
  2. Install HexEdit using DarwinPorts.  In the Terminal, type “sudo port install hexedit” and then let it do it’s thing.  You’ll see when it finishes.  Make sure to enter your password when it asks.
  3. Format the 4GB card in-camera.  The card will be using MBR partition mapping and have a FAT32 volume called “CANON_DC”.
  4. Connect the card to the computer with a USB or ExpressCard reader.
  5. Open the Disk Utility program, and unmount (do not eject) the CANON_DC volume.
  6. Click on the CANON_DC volume and “Get Info” on it in Disk Utility.  The disk identifier should be something like “disk1s1″. Remember this.
  7. Go into the Terminal again and type “newfs_msdos -F 16 -b 65536 disk1s1″. Make sure you replace “disk1s1″ with whatever your disk identifier was.  You should see it spit out a bunch of crap that I don’t understand and then end the program.
  8. Go back into Disk Utility and click on the volume for the 4GB flash card and press “Mount”.  You should see a new disk that says “NO NAME”. This is good.  The info at the bottom of the Disk Utility window should say “FAT16″.  If it does, unmount it again and move on.
  9. Go to the Terminal and type “sudo hexedit /dev/disk1s1″ ensuring that disk1s1 is whatever your disk identifier is.  Make sure that you type in the “/dev/” part, too.
  10. Once you see all of the crap onscreen, hit “Return”.  When it asks for the position, type “40″ and hit “Return” again.  Hit the “Tab” key once.
  11. One the right part of the screen, type (in all caps) “BOOTDISK” without the quotes.  Don’t type ANYTHING else, or your computer will catch fire and burn your house down.
  12. Now hit “Ctrl-X” on the keyboard. When it asks to save changes, just hit “Y”.  When HexEdit quits out, just close the Terminal.
  13. Go back into Disk Utility again and mount the “NO NAME” volume.
  14. If you are using OS X 10.4, you can just download the CHDK zip file, decompress the .zip and then copy the “DISKBOOT.BIN” file to your SD card in the Finder.
  15. If you are using OS X 10.5, then chances are you’ll need to use Stuffit Expander to open the .zip file.  The details of this issue are discussed here .  Once you have the “DISKBOOT.BIN” file, copy it to the SD card in the Finder.
  16. Eject the SD card (don’t just unmount it.)  Flip the switch to “locked” on the card.  Yes, lock the card.
  17. Insert into camera.
  18. Turn on camera.
  19. See the blue CHDK screen?  You’re good.  Don’t see CHDK screen?  You did something wrong.  For the use of CHDK, read through the materials on their website.

If everything goes to plan, you should be shooting raw images and playing with your newly liberated camera. This will probably work for any 4GB SDHC card that you want to boot to with CHDK. I just can’t guarantee anything, since all I have is an A650 to test with.  Since this is such an amazing program, and I enjoy it so much, I’ll talk about the decoding of these raw images in a future article on the site.  Stay tuned!

Welcome, and good morning!

Tuesday, February 19th, 2008

Thanks for checking out DrunkenTech.com, where I post ramblings and other nonsense about technology, food, and alcohol.  While you may think that those three are not the best mix of topics for a site, this is my site and I’ll do what I want. (Plus, I think I can intertwine them in a way that is both appealing and relevant.)

I’d say my biggest inspiration in terms of wanting to create this site specifically was from watching Good Eats and seeing Alton Brown be geeky, but incorporating technology and thinking that is, in my opinion, shared with geeks who specialize in other fields.

I am, first and foremost, a techie.  I’m not a programmer, an electrical enginner, or even capable of soldering (years of overconsumption of caffeine have made me shake a bit).  I enjoy computers and other technology, and I enjoy writing about the subject from both technical and philosophical viewpoints.

I enjoy food.  I’m kind of pudgy, and that’s mainly from eating the wrong foods, and too much of them.  I have some peculiar tastes, but I’m also interested in food and drink that appeal to computer geeks (such as myself).  Kind of an insider’s analysis and maybe even some explanations on why we like what we like.  Maybe I can get some geeks to be a little daring and change the way they think about food.

I enjoy alcohol.  I do not drink every day.  I do not usually drink in excess.  I am allergic to hops.  I mostly drink whiskey, red wine, and various other liqueurs.  I’m not especially fond of vodka or tequila, though taste comparisons of any groups of spirits are fun.  I do not have the ability to speak authoritatively about flavors of berries or currant in wines, or the amount of malt in a given Scotch.  I talk about what I experience, and most of the time it makes sense to me.

This site is a work in progress, and a very big learning experience for me.  Please don’t hesitate to give any feedback or suggestions.  Anything you want me to talk about?  I’ll see what I can do.  Something I do bother you?  If I agree with your complaint, I might do something about it.  Most of all, have fun and talk about it.  Keep it civil, and keep it as clean as possible.