USB

From AwkwardTV
Revision as of 14:02, 29 March 2007 by Probono (talk | contribs) (How to enable USB)
Jump to: navigation, search

<Google>WIKI</Google>

USB port not functional by default

According to Apple, the USB connector on the Apple TV is reserved for Apple support only. Indeed, it does not work on the stock Apple TV OS. However, given that Command-S will boot it into single user mode it seems unlikely that they've disabled the port via EFI.

How to enable USB

Initial progress has been made to enable USB. (Initially, some people have tried swapping IOUSB files, but that didn't work, because there is another set of files in mach_kernel.prelink which also need to be changed.)

Kudos to http://0xfeedbeef.com/appletv/ for figuring it out. This procedure gets the keyboard working, but disables the IR remote and causes problems with the recovery procedure. Obviously this brute force technique isn't particularly useful, but is certainly a start for further development.

  • Split mach_kernel.prelink into header and data
dd if=mach_kernel.prelink of=mach_kernel.header bs=384 count=1
dd if=mach_kernel.prelink of=mach_kernel.lzssdata bs=384 skip=1
  • Decompress mach_kernel.lzssdata using decompress_lzss (using Apple's code)
  • Patch the USB vendor/product ID of the IR remote (0xac054182) with the id of my keyboard(0x160c0100)
  • Compress the patched binary with compress_lzss (Apple's code)
  • Patch mach_kernel.header with the updated information (compressed size, adler32) for the patched kernel
  • Rebuild the complete mach_kernel.prelink
cat mach_kernel.header mach_kernel.lzsspatched > mach_kernel.prelink
  • Upload new mach_kernel.prelink and reboot

More information here as it unfolds.

Command-S boots single user mode

However, the USB port is fully functional hardware-wise:

Plug a keyboard in and press Command-S during startup will start up in Single-User mode.

Boot from USB drive

Connect bootable USB drive and press "menu" and "-" on the remote while you restart. Thanks Ozy for finding this out (Video) (YouTube)

Ozy used a cloned internal drive where he changed the boot picture in order to distinguish it from the internal drive. Since the Apple TV OS disables USB during the boot process, it doesn't fully boot. But hey, it's a start, isn't it? Next we'll make a Darwin mini USB drive image...

Restore from USB drive

phoem has instructions for restoring the contents of the internal hard drive and enabling SSH from an external USB drive using an image.