https://bitbucket.org/coutts/5dplus
Raw File
Tip revision: 0d7cbec6dea8a278a468d89a5bf23bf5670a3172 authored by Coutts on 21 June 2012, 12:32:49 UTC
Fix font sizes (thanks Alex!) and fixed problem of bmp_buffer moving around, using a pointer to the bmp_vram now instead of the raw address. Also testing ML menu with skeleton shoot menu, not working yet though.
Tip revision: 0d7cbec
make_bootable.sh
#! /bin/bash  
# patch the SD/CF card bootsector to make it bootable on Canon DSLR
# See http://chdk.setepontos.com/index.php/topic,4214.0.html
#     http://en.wikipedia.org/wiki/File_Allocation_Table#Boot_Sector

# change this
dev=/dev/disk2s1

if [[ $OSTYPE == darwin* ]]; then
  diskutil unmount $dev
fi

# read the boot sector to determine the filesystem version
DEV32=`dd if=$dev bs=1 skip=82 count=8`
DEV16=`dd if=$dev bs=1 skip=54 count=8`
if [ "$DEV16" != 'FAT16   ' -a "$DEV32" != 'FAT32   ' ]; then
  echo "Error: "$dev" is not a FAT16 or FAT32 device"
  echo debug $dev $DEV16 $DEV32
  exit
fi
if [ "$DEV16" = 'FAT16   ' ]; then
  offset1=43
  offset2=64
  FS='FAT16'
elif [ "$DEV32" = 'FAT32   ' ]; then
  offset1=71
  offset2=92
  FS='FAT32'
else
  echo "Error: "$dev" is not a FAT16 or FAT32 device"
  exit
fi
echo "Applying "$FS" parameters on "$dev" device:"
echo " writing EOS_DEVELOP at offset" $offset1 "(Volume label)"
echo EOS_DEVELOP | dd of="$dev" bs=1 seek=$offset1 count=11
echo " writing BOOTDISK at offset" $offset2 "(Boot code)"
echo BOOTDISK | dd of="$dev" bs=1 seek=$offset2 count=8
back to top