A.5. RosettaWe briefly discussed Rosetta in Section 2.11.9. Rosetta is a binary translation process that allows unmodified PowerPC executables to run on x86-based Macintosh computers. Rosetta's implementation consists of a program (/usr/libexec/oah/translate), a daemon (/usr/libexec/oah/translated), a collection of library/framework shims (/usr/libexec/oah/Shims/*), and support in the kernel, which has explicit knowledge of the translate program. $ sysctl kern.exec.archhandler.powerpc # read-only variable kern.exec.archhandler.powerpc: /usr/libexec/oah/translate $ strings /mach_kernel ... /usr/libexec/oah/translate ... The translate program can also be used from the command line to run programs under Rosetta. Figure A4 shows the source for a program that can be run both natively and under Rosetta to highlight the byte-ordering difference (see Section A.6) between the PowerPC and x86 platforms. Figure A4. Running a program both natively and under Rosetta
Rather than directly using translate, Universal binaries can be forced to run under Rosetta through several more appropriate means, such as the following.
Whereas Rosetta has support for AltiVec, it does not support executables that require a G5 processor (which means it also does not support 64-bit PowerPC executables). Note that Rosetta reports a PowerPC G4 processor to programs. Running the host_info program from Figure 61 under Rosetta will show the following: ... cpu ppc7400 (PowerPC 7400, type=0x12 subtype=0xa threadtype=0x0 ... |