Linux on a games console! There's something that a lot of people find appealing in seeing Linux running on somewhat unlikely platforms. These projects also represent the very best of the old tradition of hacking — inspired tinkering and a never-say-die attitude.
Here we look at the Sony PlayStation(TM) 2 and add-ons that make it into a Linux computer. The hacking is already done; this is a full commercial product with both software and hardware. This is Linux though, and so to get it how you like it you'll need to do a little hacking of your own.
First of all, you need a Sony PlayStation 2, a memory card, and a game controller. Then you need the Linux kit. You can order this online from various places depending on where you live.
The kit consists of a 40-Gbyte hard disk that fits in the expansion bay of the PS2, a network adapter, a USB keyboard and mouse, a computer monitor cable, and two DVDs with a Linux distro and a PlayStation Linux runtime environment on one and development utilities and manuals on the other.
The distribution is based on a Japanese variant of Red Hat (Kondara Linux), so the packaging system is RPM and the look is Red Hat 6.2. It runs on a 2.2.1 kernel. The community web site provides a 2.2.21 port with support for more USB devices and useful things like the ext3 file system.
|Linux/Unix System Administration Certification -- Would you like to polish your system administration skills online and receive credit from the University of Illinois? Learn how to administer Linux/Unix systems and gain real experience with a root access account. The four-course series covers the Unix file system, networking, Unix services, and scripting. It's all at the O'Reilly Learning Lab.|
Before talking about that, let's put the kit together. The most difficult part of that operation is opening the sealed plastic containers that some of the bits come in. The drive just slides into the expansion bay. The network adapter joins onto the drive and fastens onto the case with two screws. The USB keyboard connects to the PS2 and the mouse connects to the keyboard.
The remaining thing is the monitor. You can play games and run Linux on a TV but you will be restricted to a fuzzy-fonted console (
your friend!). Still, you can if you have to.
As an aside, there are a few games that you can play on some monitors using the progressive scan option. At the moment these include Tekken IV, Primal, SOCOM and SOCOM 2, Jak and Daxter 2, The Getaway, and (rumored) the upcoming Gran Turismo 4.
If you choose to run Linux on a monitor it must first of all be a "sync on green" monitor. Seeing as how writers of spec sheets seem not to think this is a feature worth mentioning (assuming there is a spec sheet), you'll need to check the monitor database to see if yours is OK. See the PS2 Linux community supported monitor database and a list of pass and fail models.
You could also test monitors yourself once you're running Linux. See below for setting things up.
While the PS2 is running Linux you will not be able to play PAL or NSTC PS2 games, watch DVDs, or play CDs. In the music line, you can play MP3s and other audio files.
Now, let's get the monitor working. Connect the PS2 monitor cable and add
the adapter, and then turn both on. Is all well? No! The monitor I'm using
reported that the cable was disconnected so I wasted a little time checking the
cable, which turned out to be fine. Reading the manual revealed that if the PS2
is being turned on for the first time, you need to set up the language, time,
and other options on a TV first. You could then do the install on your TV or
transfer to the monitor — hold down
Select + R1 for NTSC or
Select + R2 for PAL while booting the PS2 if using the TV. You
also need to be a little patient as the boot and install screen can take up to
40 seconds to appear.
When the menu appears, you'll see the choices of Install, Boot, or Rescue.
Installation is a breeze if you've installed Linux before and know the
packages. It's only slightly harder if you're new to Linux. The only real
complication is that you need to know a little about setting up
partitions. Reading the instructions and using Disk druid instead of
fdisk makes that step relatively simple. After that you can choose
a WindowMaker Workstation install and away you go. If you really are a
beginner, you will then need to read up a bit about running Linux.
As there is abundant disk space available, you can usually get away with going down to the bottom of the packages list and ticking the item that says to install everything.
The PS2 Linux community has a list of the packages on disk 2. An experienced Linux user will probably want to update at least some of these. Fortunately, the Compiled For Your Convenience project shares some precompiled packages. For anything else, you have
gcc to compile your source. If you want to keep the system elegant in the RPM way, you can make your own RPMs and
Another option is to switch to a Debian-based system. BlackRhino GNU/Linux is a complete distribution for PS2 with a concise HOWTO. There are several APT repositories for this project, as well as RPM version 4.0.2 for the original distro, which supports an apt-style interface for updates. See the PS2 Linux Community APT project.
That leads to networking. The PS2 network adapter is a 10/100 BaseT Ethernet connector in a plastic box. To put the PS2 onto the Internet, use a USB modem, plug into an Ethernet network with Internet access, or do a similar thing with a WLAN 802.11b base station.
I chose to make an Ethernet crossover connection to my Mac but I had quite a few problems. First, I had a batch of network adapters that needed a new driver. I solved that with another adapter. The next problems mostly came from a lack of network experience with Linux. To cut a long story short, I settled for an SSH connection to the Mac as, for some reason, the Mac steadfastly refused to act as a DHCP server.
The distribution includes all the normal sorts of apps and tools, but some people will want to update or change versions. In the PS2 context, be aware that there isn't much RAM to play with (32MB) so that some compiling jobs might take a very long time. To help you in this, there are cross-compilers available.
One glaring omission in the apps line is a recent graphical browser. For
console browsers there is
lynx, and also
links-graphics for X. One of the problems with mainstream
graphical web browsers is that they're big ugly brutes that require a lot of
RAM to run. Mozilla Firebird (now Firefox) is popular in the PS2 Linux
community. For very speedy browsing, Dillo has also proved popular, just as it
has on the iPaq and other similar systems, despite the reduced feature set.
You can choose which graphical desktop environment you want by using
sdr. Your choices include FVWM2, Gnome, KDE1x, Sawmill, TWM, and
the default, WindowMaker. Other popular managers such as Blackbox compile and
run easily, too.
Once you get going, there are two things you might like to reset straightaway. You could find that the GUI is set way too big and clunky, for example. To fix this, head into
/etc/X11/XGSConfig, search for
Screen, and then change from 24-bit color to 16-bit color by commenting and uncommenting the appropriate lines. If you're in console mode, look at
setcrtmode for switching VGA display modes, and switching
between PAL and NTSC on-the-fly.
The PS2 runs Linux surprisingly well. You do have to take into account that it's running only 32Meg of RAM and so will be easily bogged down by apps requiring large amounts of memory. For example, this wouldn't be the best platform to consider manipulating large graphic files in the Gimp or playing around with big audio or video files.
I didn't run any benchmarks but the bundled version of XEmacs without pixmaps in the toolbar came up in a flash, but Speedbar took quite awhile to come up. Ordinary operations such as starting X were quick enough — a lot quicker than starting most anything on my G3 Mac with 256 Meg RAM running Mac OS X 10.3.
Whether the PS2 running Linux could be a one-box solution to playing games, computing, and playing CDs and DVDs really depends on what you'd like to do. Sony's conception is that PS2 Linux is for hobbyists and for people who might like to learn games and graphics programming and Linux itself.
It is certainly adequate for that, plus doing the everyday sorts of things like getting and sending email and browsing the Web.
One problem, for those who wish to run X11, in terms of space and having to do fiddly things, is needing both a TV and a monitor. One possible solution would be to use one of the new-breed LCD TV/monitor combinations. The Kiss CoolView widescreen LCD is one such device. It offers a small remote and picture-in-picture.
If you're interested in games/graphics programming, you could first go and get the PS2 Linux VU Coding Contest winners from 2003, then:
$ tar zxvf vu_coding_contest_2003_ps2linux.tgz $ cd vu_coding_contest_2003 $ cd previous_demos # for a monitor $ ./harness -s # for a TV $ ./harness
These are Vector Unit demos, written to run solely on Vector Unit 1, with 16K data memory and 16K instruction memory. In the past couple of years Sony has run a demo contest with some nice equipment prizes. Make sure you don't miss Mike Day's "Universe," the 2003 winning entry in the U.S. professional competition.
Coding doesn't have to be this low level. If you would rather, see an
OpenGL-clone project called
/usr/doc/ps2gl-0.2.2. The web site has updates.
After that, on Disk 1 of the Linux kit you'll find a collection of PDFs that describe the Emotion Engine hardware and lots of graphics operations. These PDFs are the equivalent of a stack of manuals at least a foot high, so slow and steady is the way. Whatever you do, you won't master graphics programming on this platform in two days, so pace yourself wisely. The online forums offer backup information and help.
Bear in mind that developers aren't using PS2 Linux to make games for the PS2. They use a special development tool and libraries as well as a special development machine, the T10K. It looks like an oversized PS2 but has an x86 board in it as well as a PS2 board. This x86 board manages the hardware, giving graphics code exclusive access to the resources of the PS2, unlike in the Linux kit, where Linux is a drain on some of the PS2's resources.
PS2 Linux is a very useful learning place, though, and things such as the SPS2 module extend that usefulness. As they say on the project page, "A possible long-term goal for the project is to create an environment such that the same code can be compiled and run either within the Linux kernel or directly on the RTE, hopefully maximizing the similarity between Linux-based development and low-level development."
Running Linux on a PS2, someone told me, was like running Linux on a big, fast video card. Not only that, but PS2 Linux only uses a part of the capabilities of the machine. Imagine what it might be like if it used the whole thing ... PS3 Linux perhaps?
Special thanks go to Sarah Ewen at SCEE. Most of this article was written on a PS2.
John Littler is chief gopher for Mstation.org.
Return to LinuxDevCenter.com.
Copyright © 2009 O'Reilly Media, Inc.