Previous work by Trammel: http://magiclantern.wikia.com/wiki/Autoboot
The bootrom (at 0xffff0000) allows the loading and execution of code if:
- the bootdisk flag is enabled in camera (required on 400D, 500D, 550D, 600D, 1100D, 50D, 60D, 7D, at least)
- the boot sector contains the strings "EOS_DEVELOP" and "BOOTDISK" at the right places, depending on 3 FAT versions.
Based on bootloader 0.13, these offsets (hexa/decimal) are:
FAT version | Volume Label = "EOS_DEVELOP" | Bootcode+2 = "BOOTDISK" | comments |
---|---|---|---|
FAT12/16 | 0x2b/43 | 0x40/64 | works |
FAT32 | 0x47/71 | 0x5c/92 | works |
ExFAT | 0x82/130 | 0x7a/122 | works |
- for ExFAT:
- BOOTDISK and EOS_DEVELOP have to written in sector 0 and sector 12 (Resp. main and backup VBR)
- A checksum has to be computed for the first 11 sectors of each VBR (sectors 0-10 and sectors 12-22), with fields 'volume flags' and 'percent in use' skipped. Sector 11 and 23 must be filed with this checksum value stored in little endian byte order.
- See working "make_bootable.sh" version 2 and "exfat_sum.c" : http://groups.google.com/group/ml-devel/browse_thread/thread/1161d4e6e93232de
- If the "make_bootable.sh" script is not working with bash on *nix, and/or you are running a 64-bit OS ("exfat_sum.c" compiles to a binary only functioning on 32-bit OSes), please see: http://www.magiclantern.fm/forum/index.php?topic=4189.msg23416#msg23416
- to check if a disk is bootable for autoexec.bin, you can use HxD editor: http://mh-nexus.de/en/hxd/
References:
- Free EXFAT file system implementation
- ExFAT: US Patent US2009164440 . Table 4, page 9
- FAT12/16/32 : http://en.wikipedia.org/wiki/File_Allocation_Table#Boot_Sector
- http://www.sans.org/reading_room/whitepapers/forensics/reverse-engineering-microsoft-exfat-file-system_33274
- Linux: http://www.lauris.nl/mk.64GB.exfat.fs.zip restores a valid 64GB image using dd and gzip