From AwkwardTV
Revision as of 00:12, 5 April 2007 by Phoem (talk | contribs) (Restore from USB drive)
Jump to: navigation, search


USB port not functional by default

According to Apple, the USB connector on the Apple TV is reserved for Apple support only. However, given that Command-S will boot it into single user mode it seems unlikely that they've disabled the port at the hardware level.

How to enable USB ports

Turbo claims "USB success". His procedure has been verified by lpp.

Confirmed working:

  • Keyboard
  • Mouse
  • USB Hubs
  • Generic HID devices (USB game controllers)

USB port visible in the OS

The system_profiler included with the AppleTV sees the USB, and has a 1.1 and 2.0 driver attached. USB devices attached to the port are also seen by system_profiler:


    USB High-Speed Bus:

      Host Controller Location: Built In USB
      Host Controller Driver: AppleUSBEHCI
      PCI Device ID: 0x27cc
      PCI Revision ID: 0x0002
      PCI Vendor ID: 0x8086
      Bus Number: 0xfd

    USB Bus:

      Host Controller Location: Built In USB
      Host Controller Driver: AppleUSBUHCI
      PCI Device ID: 0x27c8
      PCI Revision ID: 0x0002
      PCI Vendor ID: 0x8086
      Bus Number: 0x1d

        Bluetooth HCI:

          Version: 5.25
          Bus Power (mA): 500
          Speed: Up to 12 Mb/sec
          Product ID: 0x0001
          Vendor ID: 0x0a12

        IR Receiver:

          Version: 2.42
          Bus Power (mA): 500
          Speed: Up to 1.5 Mb/sec
          Manufacturer: Apple Computer, Inc.
          Product ID: 0x8241
          Vendor ID: 0x05ac  (Apple Computer, Inc.)

Mounting filesystems from USB Mass Storage Devices

Obviously this is the number one thing we'd like to get working with USB. I need to trace how diskarbitrationd works and how new USB storage devices get probed and mounted.

One possibility is that the diskarbitrationd distributed with the AppleTV is limited to mounting filesystems off the boot device of the unit, or the IDE interface. If someone with MacOS 10.4.7 could run 'md5 /usr/sbin/diskarbitrationd' and compare it to the appletv's:

MD5 (/usr/sbin/diskarbitrationd) = 493e88e3db210ef0557a2c48e1214a8b

we could begin to narrow things down.

Mac OS X 10.4.7 Comparisons

Mac OS 10.4.7, Intel Mac mini basic install. For more information see the discussion page.

$ md5 /Volumes/Bootcamp\ Master/usr/sbin/diskarbitrationd 
MD5 (/Volumes/Bootcamp Master/usr/sbin/diskarbitrationd) = ac17cc6c4d0e795b44fb1120f508c23a

Mac OS X 10.4.9

Then again, it seems as if the binary has somehow been modified again in the 10.4.9 update, as found on another Mac Mini Core Duo:

$ ls -aliFGo /usr/sbin/diskarbitrationd
532972 -r-xr-xr-x   1 root  wheel  - 235524 Jul 14  2006 /usr/sbin/diskarbitrationd*
$ md5 /usr/sbin/diskarbitrationd 
MD5 (/usr/sbin/diskarbitrationd) = b20d8afa178da25285b311389ae0fe1f

Full /usr/bin/otool -L dump may be provided upon request

MD5 is unreliable with Mac OS X, because files changes when prebindings are update. Use ctool. It ignores the perbinding part of the file and then calculates a consistent MD5 checksum.

ctool doesn't work on diskarbitrationd:

$ ./ctool -d /usr/sbin/diskarbitrationd 
====[ file: (/usr/sbin/diskarbitrationd) ]====
file type: unknown
file: (/usr/sbin/diskarbitrationd) is not an object file.
file size: (235524) bytes.
MD5(/usr/sbin/diskarbitrationd)= b20d8afa178da25285b311389ae0fe1f
$ file /usr/sbin/diskarbitrationd 
/usr/sbin/diskarbitrationd: Mach-O universal binary with 2 architectures
/usr/sbin/diskarbitrationd (for architecture i386):     Mach-O executable i386
/usr/sbin/diskarbitrationd (for architecture ppc):      Mach-O executable ppc

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.