Linux on the PS2
Intro
Ever seen a product and thought 'Oh yes, that'd be cool to play with'? Ever
recalled tinkering away trying to code something on your old speccy, Amiga A500
or even some advanced Arkanoid clone on a Windows box? Were you tempted to get the NetYaroze development system for the PSone? Well, the Official Linux 1.0 kit
from Sony not only gives you a Linux environment on your PS2 - yes, ALL your
usual stuff is here.. pico, vi, emacs, firefox, Mozilla, ssh, tcpdump, nmap, angband - but you also get developer environments to hit the PS2 hardware where it hurts.. or at a higher level if you cant handle that. Imagine thousands of polygons screaming across the screen. imagine gouraud shaded, texture and bump mapped bats in your next Pong attempt. Imagine no more. its here!
What you get
For your 149 EURO, or 99 EURO education price (cprices on 15/Nov/2004) you get a very nice package of bits that your PS2 has been longing for:
- 40 Gb Maxtor HD
- 100mbit Ethernet adapter
- Black USB PS2 keyboard
- Black USB PS2 mouse
- Video->VGA cable adapter. (you wouldn't want to work on a PAL tv!)
- Linux 1.0 double DVD kit on dual-fold DVD case
- PS2 network gaming activation DVD. well, you've now got the official
network adapter..it works with SOCOM, SOCOM2, FIFA2004 etc straight away!
- Reasonable amounts of paper..covers install, cautions etc
Hardware Installation
Connect the Ethernet module to the HD (data and power pass-through connect
the systems) then slide this whole ensemble into the bay at the rear
of the PS2. Now connect the keyboard and plug the mouse into the
USB port on the keyboard (how Mac-esque!), Insert a fresh 8Mb memory
cart into memory slot0 then finally use the VGA adapter to connect
a sync-on-green monitor to the PS2. Sony provide a monitor compatability
chart on their PS2 Linux page, suffice to say, if yours doesn't do
sync-on-green then you can buy a small sync box that will move/inject
the sync onto whatever channel you need.
Software Installation
Put Disc 1 into the drive and boot. After a short while you get a boot screen, from here, select the 'Install' option. You will be presented with usual Linux install questions..a choice of using disk druid or fdisk for disk
partitioning etc. I chose to break my HD into several large partitions
(/, /home and /spare) and a 128Mb swap . The / being 20Gb, /home being 10Gb and the remainder 8Gb (/spare). In my mind I had a new OS install..but perhaps a partition for future PS2 titles that used the HD would be nice...
The Linux 1.0 OS then installs, this doesn't take too long..just follow the on-screen prompts. Finally you are asked to format and prepare the memory card. A couple more clicks and 2 DVD changes later and you are ready to reboot. A word of caution - don't skip the last disc change. doing so means the HD doesn't sync and you'll lose install data..which results in weird things like X not working.
The OS
Linux 1.0 is a redhat-based distribution, evidenced by the RPM usage - and existence of /etc/redhat-release file ("PS2 Linux release 1.0") the packages are quite dated - versions behind what I'm used to on a Fedora Core box and even old compared to usual debian distros! :-) but, for non-Linux users, you get a working PS2 development system. However, I'm a Linux user and so....
Software Installation Pt2
...you have to install Linux 1.0 to be able to do the following anyway...I downloaded BlackRhino 1.0 - this was done by downloading the MiniInstall base image from their site, then formatting my spare partition, extracting the tar-ball into this partition, then mounting the memory card (/mnt/mc00 - uses the ps2mcfs filesystem(!)) and editing the p2lboot.cnf file therein (a bit like GRUB but
a lot simpler!). then reboot the PS2, choose the BlackRhino boot option
et voila! a new distro being booted into. A quick edit of the /etc/apt/sources.list file and an apt-get update ; apt-get upgrade ; apt-get dist-upgrade
and you have an up-to-date distro...on your PS2! Of course, as this isn't the official one you have to do a bit more tweaking...the /etc/XGSConfig file
for X has to be modified, you have to get and install the PS2 development stuff from the PlayStation2-Linux site..small price to pay for a much more useful system
Under the hood
The PS2 is a MIPS-based system, two main components of this architecture are the MIPS CPU R5900 v3.1 CPU - aka 'Emotion Engine' - architecture type is actually _ee_ and the Graphics Synthesiser (GS unit). a very capable system when twinned together. There is 32Mb of memory, but an 'issue' with the 2.2.x kernel is that the initial compressed kernel memory space isn't freed...so you can lose between 2 and 5Mb of that memory space. All parts of the system can use DMA so bottlenecks are minimalised. IO is mainly USB-based devices. Joystick (joypad), sound , memory card etc are all accessed via Linux modules. nice.
PS2 development
Split-personality ahoy! We've got a MIPS-based Linux system. there are plenty
of those around..but we've also got PlayStation2 CPU/GPU under the hood. How do you get to these? Easy. in a multitude of ways. The three most common ways
are with SPS2, libps2dev and PS2GL. There are dozens of examples and hundreds of demos and helpful docs all over the PlayStation2-Linux site. Using SPS2 is easy, download, make then install the module. libps2dev is just as simple. With SP2GL you need to do a little more, but all are straight-forward and get you to the power. You use GCC too! If you have a larger project, setting up a cross-compiler on another platform is 'trivial' - its well documented, though experience with GCC and Linux(!) is v. desirable. If you want to get 'closer to the metal' then you can work directly with the VU and write assembler, its all supported. Plenty of downloadable code to get you started, to give you hints and tips and a reasonably thriving community.
Summary
Easy to setup. You get quite a good bit of kit for the money/investment. There is certainly no way you can write code for a major games console any cheaper than this (sure, you can develop for other consoles with Linux...but you have to have the console, various attachments, home-brew bits AND a PC! This is all here, native!) the Linux 1.0 you get feels a bit dated, but xRhino have helped there! The main CPU is a little slow, the low memory count doesn't help much, but the rest of the hardware kicks it into action. Development software, tools, docs and support are very good and you get that 1980's computer excitement back into your coding life
Future bits
Screenshots/pictures and console output. Docs on how to get some interesting uses out of your PS2, guides on
doing a few misc bits (as I discover them) and maybe , just maybe, my first game in the 21st century! :-)
PlayStation, PlayStation2, PS2 and the PS2 logo are registered trademarks of Sony Computer Entertainment
"Linux" is a trademark or registered trademark of Linus Torvalds in the United States and other countries.