USB

From AwkwardTV

Jump to: navigation, search

<Google>WIKI</Google>

Contents

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:

    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

Loading the KEXTs

Update 7/25/07: Turbo has released a kext enabler that allows these to function with kextload. http://0xfeedbeef.com/appletv/ It is now possible to use USB for external storage -> Enable USB Storage.

IOUSBMassStorageClass.kext is required to support USB disks. This KEXT depends upon two other missing bundles IOSCSIArchitectureModelFamily.kext and IOStorageFamily.kext. However, IOSCSIArchitectureModelFamily.kext pulled from the 10.4.9 Combo Update fails to load with the following errors:


appletv:/System/Library/Extensions frontrow$ sudo kextload -v 6 IOSCSIArchitectureModelFamily.kext
 ...

kextload: link/loading file /System/Library/Extensions/IOSCSIArchitectureModelFamily.kext/Contents/MacOS/IOSCSIArchitectureModelFamily
kextload: allocated 90112 bytes in kernel space at 0x2bdc6000
kextload: using load address of 0x2bdc6000
kextload: kmod name: com.apple.iokit.IOSCSIArchitectureModelFamily
kextload: kmod start @ 0x2bdd702a (offset 0x1034a)
kextload: kmod stop @ 0x2bdd7067 (offset 0x10387)
kextload: unable to register module with kernel
kextload: a link/load error occured for kernel extension IOSCSIArchitectureModelFamily.kext
kextload: clearing all version/dependency relationships among kernel extensions
kextload: sending 1 personality to the kernel

IOSCSIArchitectureModelFamily.kext from the 10.4.7 and 10.4.8 updates fail with a similar error.

10.4.7:

kextload: link/loading file /temp/10.4.7/IOSCSIArchitectureModelFamily.kext/Contents/MacOS/IOSCSIArchitectureModelFamily
kextload: allocated 86016 bytes in kernel space at 0x2b66c000
kextload: using load address of 0x2b66c000
kextload: kmod name: com.apple.iokit.IOSCSIArchitectureModelFamily
kextload: kmod start @ 0x2b67cbe0 (offset 0xff00)
kextload: kmod stop @ 0x2b67cc20 (offset 0xff40)
kextload: unable to register module with kernel
kextload: a link/load error occured for kernel extension 10.4.7/IOSCSIArchitectureModelFamily.kext/
kextload: clearing all version/dependency relationships among kernel extensions
kextload: sending 1 personality to the kernel


10.4.8:

kextload: link/loading file /temp/10.4.8/IOSCSIArchitectureModelFamily.kext/Contents/MacOS/IOSCSIArchitectureModelFamily
kextload: allocated 86016 bytes in kernel space at 0x2b5f9000
kextload: using load address of 0x2b5f9000
kextload: kmod name: com.apple.iokit.IOSCSIArchitectureModelFamily
kextload: kmod start @ 0x2b609c8c (offset 0xffac)
kextload: kmod stop @ 0x2b609cc9 (offset 0xffe9)
kextload: unable to register module with kernel
kextload: a link/load error occured for kernel extension 10.4.8/IOSCSIArchitectureModelFamily.kext/
kextload: clearing all version/dependency relationships among kernel extensions
kextload: sending 1 personality to the kernel

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...

Personal tools