AppleTV
From Mactel-Linux
Contents |
Linux on the AppleTV
At the moment the infos are somewhat incomplete. Things are not ready for prime time yet. I just wanna put some info up to get people informed that the wait for Linux is nearly over. There are some preliminary instructions, together with a boot loader (based on this work) which supports ext3 filesystems and dhcp.
Note that these instructions require a copy of the boot.efi file from the Apple TV. This is available from Apple's website [1], located at /usr/standalone/i386/boot.efi within the disk image.
Also, the binary on the Mythic Beasts site didn't work for me, but the one I cross-compiled myself worked fine [2].
How was it done ?
It was no simple task. It is known that the 'EFI' Executables on the AppleTV are protected. The AppleTV refuses to boot any free EFI Executables. So we had to find a way to get code running on the box. The simple idea was to build a mach-o binary and let boot.efi do its magic.
The loader sits in the mach-o binary, also the linux kernel itself.
So the Boot Procedure is :
- AppleTV loads boot.efi
- boot.efi gets our loader into memory
- The loader gets the linux kernel up
Status
Loader
- Works ;)
Kernel
- EFI is not working fully
- USB works with the "irqpoll" kernel commadnline option
- NV Xorg driver works
- Nvidia's propritiary driver works
- Speedstep works
- Wlan works with ndiswrapper
- Sound works fine (in order to enable the optical digital output you may need appletv-audio.patch to force the correct device detection.)
System outputs
lspci > dmesg > /proc/cpuinfo
Sourcecode and Kernel Patch
In case you've been following my "saga" trying to get my system up, the problem was that ntpd crashes the kernel. You all don't seem to be using ntpd, but CentOS/TrixBox launches that by default, so I was chasing all the wrong ends trying to figure out why the kernel crashes. The "easy" short-term fix is to simply disable ntpd, but of course, that doesn't fix the underlying kernel issue, which seems to be that the kernel tries to access time information through EFI. There exists a patch for the MacMini for the same problem, but at least with the standard aTV linux patch, it can't be applied. So I'll try to create a new kernel that contains all the MacMini and aTV patches, and then I'll see if that solves the problem.... The MacMini patch I refer to is located here [3] Maybe it's time to create a consolidated MacIntel/MacMini/aTV patch set, because otherwise we seem to be reinventing the wheel all over... (rcfa)
linux kernel 2.6.21 plus CentOS 4.4/Trixbox runs on the aTV! And neither under that nor under the 2.6.20.n versions did I need the irqpoll kernel option... So now, where to send the diffs? rcfa
Compile loader on Linux
- On Ubuntu feisty :
- alien must be installed
- Change to mach_linux_boot and execute the script get_cross.sh
- Move darwin-cross to /opt/
- Execute make.sh.
- Crosscompiler is from this Page Darwin/Mac OS X Cross-Compiler for Linux
- Real Debian packages would be nice ;)
In case you have an CentOS based distribution, you can add the proper repository to your yum configuration, and just use yum install to get this done. A bit easier, and comes with automatic updates, if/when needed... (rcfa)
External Links
AppleTV [[4]] Apple TV Wiki [[5]] Installing Linux on the Apple TV [[6]] mb_boot_tv bootloader [[7]] (based on this work, and supports ext2/3 and dhcp/tftp)

