Up one level

Linux on Playstation 2 (PS2)



March/April 2004: After having played video games on my SONY Playstation 2 for over a year, I decided it was time for something more. I remembered reading something about linux for PS2 on a website, which included a hard disk that you could attach to your playstation. After both Game Craze and Best Buy indicated that the first PS2 software to use a hard disk would be Final Fantasy, coming out later this year, I decided I had to prove them wrong and found that you can order the linux for PS2 on the SONY website. It includes a monitor cable, a PS2 keyboard, a PS2 mouse, a PS2 hard disk and all the necessary software, for only $99. As you can see, just for the hardware it was a great buy. Even more amazing: it arrived the day after I ordered it, in a nice box delivered by UPS. I attached the hard disk to the network adapter, removed the expansion bay cover and put the entire thing into the Playstation 2, using a screwdriver to fix it in place. I then attached the keyboard.

Then I decided was that the PS2 had to be connected to our WiFi (802b.11) intranet which connects to the Internet, so I was off to Best Buy to purchase an 802.11b-802.3 bridge. I decided on the Linksys gaming adapter-B, which I configured using my PC (the wizard is quite helpful. I changed the IP address from 192.168.1.225 to 192.168.0.225, because my D-Link router uses the 192.168.0.x space instead of the 192.168.1.x space and I switched to 128-bit WEP encryption and entered the hexadecimal version of my key, and saved everything under profile 1. You can then easily switch to profile 1 using the button on the device). I then installed linux on the PS2 (this went quite smoothly, except that you need to know you should press SELECT and R1 during booting if you want to see anything on an NTSC television, as by default it boots to a sync-on-green monitor, which I don't have) and attached the Linksys gaming adapter-B to it. My configuration was now as follows:

Network setup PS2Finding out the settings for the linksys WGA11B took some time, but a call to their friendly helpdesk confirmed that the PS2 should be configured to obtain all information  automagically (DHCP). After I did this my PS2 indeed got an IP address (192.168.0.103, the next one available from my router) and I was able to ping my router at 192.168.0.1. I then pinged mosha (a computer in the Netherlands) and, although it translated the name correctly to an IP address, it stopped transmitting after one packet, and it wouldn't even find the router anymore. It kept giving the message: eth0: xmit: link down. At this point I decided to look into the kernel code, which is part of the complete installation, and discovered that the Ethernet driver for PS2, smap.c, was in a rather primitive stage. Looking on-line I indeed noticed that there are several updates to this file on the linux for playstation community website. I downloaded the latest one (to get it to the PS2, I had to hook it up directly to another computer using a crosslinked CAT5 cable, and configure fixed IP addresses on both sides. I then changed /etc/inetd.conf to allow ftp, killed and restarted inetd and used ftp on the other computer to send the file to the PS2), overwrote the file in the /usr/src/linux/... hierarchy with it, and did "make modules". Amazingly enough a new file smap.o was created and after unloading the module (rmmod) moving the smap.o into the /lib/modules/2.1.1/... hierarchy and loading the module (insmod smap) the network worked flawlessly (be it a bit slow). Note that the crossover switch on the WGA11B works opposite to what you might expect: you do not set it to the type of cable you use (i.e. X for a crossover cable and || for a straight cable) but to wether the WGA11B should crossover the cable for you. As it is a 1-to-1 connection, there should be one crossover, so if the cable has a crossover, the WGA11B should be set to || and vica versa.

Regarding various software packages: the next step was to enable telnet, so I could access the PS2 remotely. I did this the same way I enabled ftp, by going into /etc/inetd.conf and remove the # in front of the telnet entry. The D-Link router normally stops incoming traffic, so I changed its settings to put the PS2 in the DMZ (demilitarized zone) so that any packets coming into the router would be going to the PS2 first. Telnet is not a very secure protocol, and it is better to use secure shell (ssh). However, the secure shell deamon (sshd) on the PS2 was outdated, and there are some exploits out there that can be used. I therefore decided to upgrade sshd first. This was easy: downloading the OpenSSH software from their website and installing it. To enable X11 over ssh (for those that need it) requires some changing on the configuration files, but this is all explained on the openSSH website. Make sure you rename/remove the old ssh/sshd on your machine if OpenSSH installed it in a different directory. I then added sshd to the /et/rc.d/rc.local, so that it would start up every time I started the PS2. There are various other packages you might consider updating (I updated wget and sed). To run X I edited /usr/lib/X11/XGSConfig, changing the mouse to IMPS/2 (to enable the scroll wheel as a button) and adding the line "ZAxisMapping 4 5" to also allow scrolling. Because the scroll wheel is a third button, I disabled the emulate3Buttons functionality by putting # signs before them. As I wanted to use the PS2 with television only, I removed the VESA VideoMode and added the NTSC interlace videomode by removing and adding the # signs. Interlace normally looks horrible, but for X Windows it adds much needed desktop space and with the appropriate background, you don't notice it that much either. To allow use of the DualShock 2 pads, remove the # signs in front of the PS2Pad section at the end of the file. You will still be able to use the mouse, but also the DualShock 2.

One of the things you might consider doing with the linux for PS2 is making backups of your memory cards. Unfortunately the Run Time Engine (RTE) that lies between the PS2 hardware and linux for PS2 allows you to only modify the files in the BWLINUX directory of the memory card. In order to read other directories, you'll need a patch (note: the website where the patch is located is frequently down). Once you downloaded the patch you'll need to apply it against the kernel in /usr/src/linux and rebuild the modules (make modules) the kernel (make image) install the modules (make modules_install) and move the resulting vmlinux file to the memory card. The patch will disable the check in the RTE by overwriting it with 0 and it will remove the BWLINUX requirement from all memory card code in linux. After rebooting you should be able to access all the directories on the memory card. To access a memory card, type "mount -t ps2mcfs /dev/*mc00 /mnt/mc00" for a memory card in slot 1, and use mc10 for a memory card in slot 2. The content of the memory card will then be available in /mnt/mc00 or /mnt/mc10 respectively. Before removing a memory card, remember to unmount it: "umount /dev/mc00" for a memory card in slot 1. Each directory on the memory card is a save file from one game. It might be difficult to see which game it is, but sometimes the filename(s) give helpful hints. To copy directories, use "cp -r <directory> <new directory>".

Feel free to write me an Email about the content of this webpage (make sure you put PS2 somewhere in the subject line). Use any of the information presented at your own risk Continued on the next page.