Difference between revisions of "Apple TV OS 10.4.7"

From AwkwardTV
Jump to: navigation, search
(Protected files)
m (References:: formatting)
 
(19 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 +
{{banner}}
 +
 
=== Build version and kernel ===
 
=== Build version and kernel ===
  
 
This is the operating system that is driving the Apple TV out of the box:
 
This is the operating system that is driving the Apple TV out of the box:
  
System Version: Apple TV OS 10.4.7 (8N5107)
+
{| class="wikitable"
Kernel Version: Darwin 8.8.2
+
|-
Boot Volume: OSBoot
+
| '''System Version:'''
Computer Name: AppleTV
+
| Apple TV OS 10.4.7 (8N5107)
 +
|-
 +
| '''Kernel Version:'''
 +
| Darwin 8.8.2
 +
|-
 +
| '''Boot Volume:'''
 +
| OSBoot
 +
|-
 +
| '''Computer Name:'''
 +
| AppleTV
 +
|}
 +
 
 +
This is the <tt>uname -a</tt> output:
 +
<pre>
 +
appletv.home 8.8.2 Darwin Kernel Version 8.8.2: Mon Jan 29 18:57:29 PST 2007; root:xnu-792.94.18~1/RELEASE_I386 i386 i386
 +
</pre>
 +
 
 +
=== mach_kernel.prelink ===
 +
This is a "kernel cache" file created by the <tt>-c</tt> option of <tt>kextcache(8)</tt>.  It contains a <tt>mach_kernel</tt> bundled with a pre-linked set of kernel extensions.  <tt>kextcache</tt> compresses the kernel cache using the [[LZSS]] algorithm and prepends a custom 384-byte (180 hexadecimal) file header to the compressed data, producing the following file format:
 +
 
 +
{| border=1 cellspacing=0
 +
|+ '''Kernel Cache Format'''
 +
! Offset || Field || Type || Description
 +
|-
 +
| 0  || signature || uint32_t || <tt>'comp'</tt> = compressed file
 +
|-
 +
| 4  || compress_type || uint32_t || <tt>'lzss'</tt> = compressed with [[LZSS]] algorithm
 +
|-
 +
| 8  || adler32 || uint32_t || Adler-32] checksum of uncompressed payload
 +
|-
 +
| 12 || uncompressed_size || uint32_t || payload size, uncompressed
 +
|-
 +
| 16 || compressed_size || uint32_t || payload size, compressed
 +
|-
 +
| 20 || reserved || 44 bytes || reserved for future definition
 +
|-
 +
| 64 || platform_name || char[64] || UTF-8 string containing the name of the root entry of the IOService plane
 +
|-
 +
| 128 || root_path || char[256] || value of device tree node <tt>/chosen/rootpath</tt> or a concatenation of <tt>/chosen/boot-device-path</tt> and <tt>/chosen/boot-file</tt>
 +
|-
 +
| 384 || data || compressed data || payload containing a kernel in <tt>Mach-O(5)</tt> format with pre-linked extensions in the <tt>__text</tt>, <tt>__symtab</tt>, and <tt>__info</tt> sections of the <tt>__PRELINK</tt> segment.
 +
|}
 +
Notes:
 +
* Integer fields use big-endian byte order.
 +
* If the first byte of <tt>platform_name</tt> or <tt>root_path</tt> is <tt>0</tt>, then both bytes are set to <tt>0</tt> (this is the case for the Apple TV kernel cache).  In other words, if <tt>platform_name</tt> contains an empty string, then <tt>root_path</tt> is not used.
 +
 
 +
====Creating Your Own Kernel Cache====
 +
Here is an example of how to create a kernel prelink with your own kernel and extensions [http://0xfeedbeef.com/appletv/]:
 +
 
 +
kextcache -v 5 -a i386 -s -K ~/mach_kernel.semthex -c /tmp/mach_kernel.prelink /System/Library/Extensions
  
This is the uname -a output:
+
This assumes that your kernel is in your home directory and named <tt>mach_kernel.semthex</tt>, and that your extensions are in <tt>/System/Library/Extensions</tt>.  The new <tt>mach_kernel.prelink</tt> file will be located in <tt>/tmp</tT>, place it appropriately.
  
appletv.home 8.8.2 Darwin Kernel Version 8.8.2: Mon Jan 29 18:57:29 PST 2007; root:xnu-792.94.18~1/RELEASE_I386 i386 i386
+
====References====
 +
* [http://www.heroofthe.net/atvdoc/kernel_pieces.html List of files in mach_kernel.prelink] (by n8man)
 +
* [http://www.appletvhacks.net/2007/03/26/hidden-files-in-the-apple-tv-kernel-file/ Apple TV Hacks] site.
 +
* <tt>PreLink()</tt> in kext_tools <tt>[http://src.gnu-darwin.org/DarwinSourceArchive/expanded/kext_tools/kext_tools-65.76/prelink.c prelink.c]</tt>
 +
* <tt>DecodeKernel()</tt> in BootX <tt>[http://src.gnu-darwin.org/DarwinSourceArchive/expanded/BootX/BootX-75/bootx.tproj/sl.subproj/main.c main.c]</tt> and  i386 boot <tt>[http://src.gnu-darwin.org/DarwinSourceArchive/expanded/boot/boot-132/i386/boot2/drivers.c.html drivers.c]</tt>
 +
* <tt>compressed_kernel_header</tt> in BootX <tt>[http://src.gnu-darwin.org/DarwinSourceArchive/expanded/BootX/BootX-75/bootx.tproj/include.subproj/boot_args.h boot_args.h]</tt> and i386 boot <tt>[http://src.gnu-darwin.org/DarwinSourceArchive/expanded/boot/boot-132/i386/boot2/boot.h.html boot.h]</tt>
  
 
=== Finder.app ===
 
=== Finder.app ===
/System/Library/CoreServices/Finder.app does not contain the real Finder, but the Apple TV GUI.
+
<tt>/System/Library/CoreServices/Finder.app</tt> does not contain the real Finder, but the Apple TV GUI.
 
This is a custom application not available on Macintoshes.
 
This is a custom application not available on Macintoshes.
  
 
====Enable real Finder====
 
====Enable real Finder====
(please insert here)
+
It is not (easily) possible to enable the real Finder since it is not there and it would require SSE3, which the Apple TV doesn't have.
 +
Also, [[Watchdog]] must be taken care of.
  
 
===Files===
 
===Files===
 
See the full [http://www.awkwardtv.org/virgin-filelist.txt file list of a virgin Apple TV] here.
 
See the full [http://www.awkwardtv.org/virgin-filelist.txt file list of a virgin Apple TV] here.
===Protected files===
+
====Apple binary-protected files====
  
The Apple TV runs [http://osxbook.com/book/bonus/chapter7/binaryprotection/ Apple binary-protected] binaries:
+
The Apple TV runs [http://osxbook.com/book/bonus/chapter7/binaryprotection/ Apple binary-protected] files:
  
 
* loginwindow.app
 
* loginwindow.app
 +
* Finder.app (which is not the real Finder, but the Apple TV frontend)
 +
* AppleTCOWatchdog.kext
  
 
  otool -l /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
 
  otool -l /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
Line 53: Line 112:
 
     nsects 7
 
     nsects 7
 
     '''flags 0x8'''
 
     '''flags 0x8'''
 +
 +
---------
 +
 +
Heres the combo update for 10.4.7, might be useful for files for ATV if you have since updated your computer to 10.4.9
 +
 +
http://www.apple.com/support/downloads/macosxupdate1047combointel.html
 +
 +
[[Category:Software]]
 +
[[Category:System]]
 +
[[Category:1.0]]

Latest revision as of 14:53, 2 November 2008

<Google>WIKI</Google>

Build version and kernel

This is the operating system that is driving the Apple TV out of the box:

System Version: Apple TV OS 10.4.7 (8N5107)
Kernel Version: Darwin 8.8.2
Boot Volume: OSBoot
Computer Name: AppleTV

This is the uname -a output:

appletv.home 8.8.2 Darwin Kernel Version 8.8.2: Mon Jan 29 18:57:29 PST 2007; root:xnu-792.94.18~1/RELEASE_I386 i386 i386

mach_kernel.prelink

This is a "kernel cache" file created by the -c option of kextcache(8). It contains a mach_kernel bundled with a pre-linked set of kernel extensions. kextcache compresses the kernel cache using the LZSS algorithm and prepends a custom 384-byte (180 hexadecimal) file header to the compressed data, producing the following file format:

Kernel Cache Format
Offset Field Type Description
0 signature uint32_t 'comp' = compressed file
4 compress_type uint32_t 'lzss' = compressed with LZSS algorithm
8 adler32 uint32_t Adler-32] checksum of uncompressed payload
12 uncompressed_size uint32_t payload size, uncompressed
16 compressed_size uint32_t payload size, compressed
20 reserved 44 bytes reserved for future definition
64 platform_name char[64] UTF-8 string containing the name of the root entry of the IOService plane
128 root_path char[256] value of device tree node /chosen/rootpath or a concatenation of /chosen/boot-device-path and /chosen/boot-file
384 data compressed data payload containing a kernel in Mach-O(5) format with pre-linked extensions in the __text, __symtab, and __info sections of the __PRELINK segment.

Notes:

  • Integer fields use big-endian byte order.
  • If the first byte of platform_name or root_path is 0, then both bytes are set to 0 (this is the case for the Apple TV kernel cache). In other words, if platform_name contains an empty string, then root_path is not used.

Creating Your Own Kernel Cache

Here is an example of how to create a kernel prelink with your own kernel and extensions [1]:

kextcache -v 5 -a i386 -s -K ~/mach_kernel.semthex -c /tmp/mach_kernel.prelink /System/Library/Extensions

This assumes that your kernel is in your home directory and named mach_kernel.semthex, and that your extensions are in /System/Library/Extensions. The new mach_kernel.prelink file will be located in /tmp, place it appropriately.

References

Finder.app

/System/Library/CoreServices/Finder.app does not contain the real Finder, but the Apple TV GUI. This is a custom application not available on Macintoshes.

Enable real Finder

It is not (easily) possible to enable the real Finder since it is not there and it would require SSE3, which the Apple TV doesn't have. Also, Watchdog must be taken care of.

Files

See the full file list of a virgin Apple TV here.

Apple binary-protected files

The Apple TV runs Apple binary-protected files:

  • loginwindow.app
  • Finder.app (which is not the real Finder, but the Apple TV frontend)
  • AppleTCOWatchdog.kext
otool -l /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow:
Load command 0
      cmd LC_SEGMENT
  cmdsize 56
  segname __PAGEZERO
   vmaddr 0x00000000
   vmsize 0x00001000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x4
Load command 1
      cmd LC_SEGMENT
  cmdsize 532
  segname __TEXT
   vmaddr 0x00001000
   vmsize 0x00050000
  fileoff 0
 filesize 327680
 maxprot 0x00000007
 initprot 0x00000005
   nsects 7
    flags 0x8

Heres the combo update for 10.4.7, might be useful for files for ATV if you have since updated your computer to 10.4.9

http://www.apple.com/support/downloads/macosxupdate1047combointel.html