When Sony first announced that the PlayStation 3 would be able to run Linux natively, a great deal of excitement ensued. Early on, it was a bit of a challenge to get Linux natively installed. The supported installer ran a custom script that hand-mangled a Fedora Core 5 or 6 install DVD into a runnable system with a special PS3 kernel. People put in hours and hours of effort to get other systems, such as Ubuntu, working. Terrasoft's Yellow Dog Linux, with an actual graphical installer that ran on the PS3, was the king of the hill.
Time has passed, and a great deal has changed. Fedora 7 installs on the PS3 out of the box, with the most challenging parts being selecting the PS3 storage driver so it can find the install DVD, and remembering to specify a video mode on the initial install command line so you'll be able to see the installer.
So, you can run Linux on the PS3. It's easy. The problem is, it doesn't necessarily run well. If you picked the PS3 up as a cheap Cell development system, it's a little frustrating to discover that, having followed the default install procedure, you have a system that comes up with a hundred megs or more of swap in use by the time you get to a shell prompt.
Grab Fedora 7. (Fedora 8 probably works too, but I had Fedora 7 handy when I started typing.) Obviously, you might get better results in some ways from one of the more natively tuned distributions, or one of the distributions built around being small and efficient, but Fedora 7 has a huge advantage: it's supported by the Cell/B.E. SDK. (So is RHEL 5.1, but Fedora 7's nicer.)
I'm a big fan of using Bittorrent for downloads, because it helps spread the load out. This means that you should leave your client running until you've uploaded at least as much as you've downloaded; open source software is about cooperation, and cooperating on bandwidth costs is a great starting point. It'll take a while to download the whole DVD image (see Resources), so while you're waiting, here's some background on PS3 Linux.
The PlayStation 2 ran Linux as well, but it was a bit of a pain. Sony released a special kit for it, which ran only on the older, thick PS2s and required an optional hard drive. There was no support for the later (more common) "slim" PS2 units, and the kit quickly disappeared. But, fundamentally, it disappeared because it was mostly a proof of concept; the system didn't have all that much memory, and without special compiler tools, the CPU was just a fairly standard MIPS core. The vector units were not widely supported or documented outside of proprietary tools.
By contrast, the PS3 has had support for running Linux since before it was released, and Sony has made support code and packages widely available. The "Cell addons" CD released around the system's launch included direct support for Fedora 5 and 6, but it also provided all the files needed for other distributions to develop PS3 ports. As a result, Fedora 7 simply works on the PS3 without the need for a separate CD, although you still need to use the Sony downloads to install the bootloader. The add-on software CD (see Resources) continues to get updates with new kernel versions.
The PS3's base specs are 256MB of main memory, a Cell/B.E. processor, wired ethernet (and 802.11b/g wireless, on some models), a graphics unit called RSX (with 256MB of its own memory), and a SATA disk drive. There are also some peripheral attachments available, including USB ports, a card reader on some models, and Bluetooth. However, this is not the machine PS3 Linux runs on.
On the PS3, Linux runs under a hypervisor—in essence, PS3 Linux is running on a virtualized machine, similar to a Xen virtualized machine. The hypervisor provides controlled and filtered access to the PS3's hardware. For instance, Linux code has no direct access to the RSX graphics processor. Rather, a special device is provided that allows limited access to it, providing for a reasonably efficient 2D framebuffer.
The hypervisor provides a number of translations. For instance, as mentioned, the hypervisor provides Linux with a virtual framebuffer device, which the hypervisor then implements using the RSX graphics core. Similarly, Linux has no access to the SATA hard drive. Instead, it has access to a SCSI drive, which maps only onto the region of the internal drive that was allocated for the "Other OS" partition. It is simply physically impossible to access the part of the disk being used by PS3 game software.
The network hardware is perhaps the most interesting. PS3 Linux can access either the gigabit wired ethernet or the 802.11g wireless, but not both at once. When you configure the network interface, if you specify it as a wireless interface with an SSID. The hypervisor uses the wireless; otherwise, it uses the wired interface.
So, let's discuss the amended specifications. PS3 Linux runs on a virtual machine that has a Cell/B.E. processor with 6 SPEs, about 212MB of main memory, a single network interface, a SCSI disk (plus several more SCSI disks if you have a card reader), a SCSI device that may be a DVD-ROM, CD-ROM, or possibly a Blu-ray reader, and functional USB and Bluetooth ports. Graphics are provided by a special framebuffer device, which supports a broad array of video modes (see Understanding consumer electronics video modes).
To make good use of a PS3 for development, first decide what you need out of the development environment. If you are comfortable abandoning X entirely, it'll save you a huge amount of memory (the Fedora default of running Gnome is, perhaps, not one of the most memory-conserving strategies). A lot of the system setup utilities are most accessible through X, but they can take a long time to run. I ran the graphical package updater under Gnome, and it took several hours. This is probably because the process had a total memory footprint of 375MB, substantially more than the physical memory available. It spent most of its time waiting for the swap disk, thrashing like Emacs on a VAX.
The lesson here is that available memory is going to be your biggest weakness on the PS3. Turn off services you don't need as quickly as possible. Run xterm instead of gnome-terminal. If you need multiple windows, consider running screen instead of multiple xterms.
If you're going to run headless, don't worry too much about these. But if you want to run with a display that you're going to look at, you need to consider display options. The best quality comes from using the PS3's HDMI output. If you have a computer monitor, HDMI to DVI cables can be had quite cheaply, but be sure your monitor supports High-bandwidth Digital Content Protection (HDCP). If it doesn't, you'll get a black screen, or possibly brightly-colored static. If you're using a KVM switch, note that the switch too, not just the display, has to support HDCP! Unfortunately, there appears to be no way to turn this "feature" off; you simply can't get an unencrypted signal. While this makes some economic sense for a device that plays high-definition movies, it can be a bit frustrating to need special permission to view your X desktop. HDMI/DVI supports pretty much every video mode the PS3 has to offer, both the consumer electronics modes, such as 720p, and the PC modes, such as WXGA.
If you can't do HDCP, or don't have a DVI-capable monitor, your next best bet is component video. Component video, mostly accepted by TVs, but also by some computer monitors, is very similar to plain old VGA, only it comes out as three RCA connectors, one red, one green, and one blue. The component video cable is an additional-price addon—but it's the same as the component video cable for the PS2, if you had one of those. Component video can reliably support 720p and 1080i displays, but may not work for 1080p (see Understanding consumer electronics video modes if you're not sure what this is). Component video offers both higher resolution and better clarity than the next two options.
If you can't do component, you might have a device that supports S-video. S-video supports 480i, but divides the signal into two separate channels, luminance and chroma (that's "brightness" and "color"), giving better sharpness than your final option, composite video. Composite video is the plain old RCA jack, usually colored yellow, that is compatible with nearly everything. If you can possibly avoid composite, do.
Note that the Fedora 7 installer is essentially unusable with anything under 720p, unless you force it into text mode. Really, if you plan to use the PS3 as a development system, you ought to favor higher resolution modes. Linux systems have developed an affinity for larger displays, and the Fedora windowing environment is just plain awful on a low-resolution display. Furthermore, the lower-resolution displays, especially over composite cables, are very hard to read, with horrible blurring.
My system was set up for WXGA (1280x768) over DVI, and this is quite usable. It's enough desktop real estate for a couple of windows without overlap.
By now your Fedora DVD should have downloaded, so the next step is to install
it. Follow the usual PS3 instructions for getting your disk partitioned (you do
lose all your data if you do this, so make backups!) and the Other OS boot loader
loaded. When the time comes to put in the Fedora DVD, and boot from it, enter
linux64 text or
linux64 video=720p at the
kboot prompt. 720p is the minimum usable installation
video size; if you don't have component or DVI output working, use text. Booting
with the default options resulted in the installer apparently freezing with a
Fedora logo on screen; in fact, the installer's window was larger than the default
display area, leaving me with no option but to power the machine down and try
After this, go ahead and get all the current updates from Fedora's update servers, and install them. This will take quite a while, as will the initial install. In both cases, once it gets started, go do something else for a couple of hours.
Part 2 of this series discusses getting the latest PS3 addons installed and updated on your system, and some of the configuration changes you can make to reduce the basic memory footprint until you've got a bit of breathing room.
parts in the Linux development on the PlayStation 3 series.
"Programming high-performance applications on the Cell
BE processor, Part 1: An introduction to Linux on the PLAYSTATION 3"
(developerWorks, January 2007) and "PS3 fab-to-lab, Part 1: Build Linux lab equipment from
a Sony PLAYSTATION 3" (developerWorks, May 2007) are the first articles in other developerWorks series about running Linux
on the PS3.
Sony's guide to
the OtherOS feature,
including the download of the installer.
Soft's page listing video modes
is very helpful.
PlayStation 3 is a good starting place for learning more.
developerWorks Linux zone,
find more resources for Linux developers, and scan our
most popular articles and
Linux tips and
Linux tutorials on developerWorks.
Stay current with
developerWorks technical events and Webcasts.
Get products and technologies
The Fedora project makes it
very easy to
Get the PS3 linux
distro kit (also known as the "addons CD") from this wonderful
collection of interesting Cell-related things.
Cell Broadband Engine
Resource Center on developerWorks, you can get the
FC7 on PS3 (SDK 3.0) (Updated 01/15/08)
Order the SEK for Linux,
a two-DVD set containing the latest IBM trial software for Linux from DB2®,
Lotus®, Rational®, Tivoli®, and WebSphere®.
IBM trial software,
available for download directly from developerWorks, build your next development
project on Linux.
Get involved in the
developerWorks community through blogs, forums, podcasts, and community topics in our
new developerWorks spaces.