Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being Copyright, with no Front-Cover Texts and with no Back-Cover Texts.
A copy of the GNU Free Documentation License is available on the World Wide Web at http://www.gnu.org/copyleft/fdl.html. You can also obtain it by writing to the
Table of Contents
Table of Contents
The Sony Playstation 2 Linux kit allows any owner of a consumer Playstation 2 unit to run Linux. The kit consists of an add on hard drive and ethernet combo as well as all of the software needed to install and run a full Linux system. It not only allows you to run all of the familar Linux applications like Apache, X Windows, telnet, mpg123, and the gimp, it also allows you the ability to compile programs directly on the Playstation 2 itself. Full access to the graphics and processing hardware is supported and writing any application is possible.
Several factors played into Sony's release of the Playstation 2 Linux kit:
Sony has also setup a community website for the Playstation 2 Linux kit, which can be found at http://www.playstation2-linux.com/.
If you are a regular Linux user, the kit is very easy to use. Infact, the kit operates just like a regular Linux system. You can login, change directories, run shell scripts, and use all the regular unix commands.
If you are unfamiliar with Linux or Unix in general, the learning curve is going to be steep. However, everybody has to start somewhere and setting up a Linux system on a Playstation 2 is quite easy compared to setting a similar system up on a PC. There are many books on learning Unix and many websites describing how to configure Linux software.
The kit's purpose is multi-faceted, but is meant primarily for homebrew game and application development. All the software that you need to create a game is included with the system. Other possibilities for the kit exist, some of which are:
If the application has anything to do with graphics or number crunching, the PS2 is usually a good fit.
Since all Playstation 2 systems are identical, every Playstation 2 Linux install is the exact same. No need to worry about incompatible hardware, or if the Linux kernel supports your particular graphics card or motherboard.
The physical size of the entire Linux system is quite tiny and does not require a large amount of resources or space to use. All you need is a Playstation 2, and the Linux kit (plus a Sync On Green monitor to perform the installation). The total cost for everything should be around $400 USD, which is quite affordable considering what you would pay for a comparable PC setup.
The Playstation 2 Linux distribution is based on Kondara Linux 5.2, which is subsequently based on RedHat Linux 5.2. Although this makes the PS2 Linux distribution quite outdated, there are several efforts to provide updated RPMs for the system.
Table of Contents
A 10/100 Mbit ethernet unit ships with the Playstation 2 Linux kit. The unit is compatible with any 10/100 Base-T network/hub. Along with the standard RJ-45 jack on the back of the unit (with link and activity LEDs), the ethernet unit houses three other connections. The Sony PS2 Hard Disk Drive (HDD) power and IDE data connections are kept opposite the RJ-45 jack as well as a proprietary PC card connector which is used to connect the unit to the Playstation 2.
The ethernet unit that ships with the Linux kit resembles the consumer one that will be sold in the US starting in August 2002. The one item that is missing is the 56k modem port.
The hard disk drive (HDD) unit that ships with the Playstation 2 is a standard IDE drive with specialized firmware to make it work in a Playstation 2. It is a 40 GB drive manufactured by Western Digital for Sony.
A Sony Playstation 2 USB keyboard is included in the Playstation 2 Linux kit. The keyboard is a standard black 104-key keyboard. There is a pass-through port for chaining another USB device off of the keyboard, such as a USB mouse or camera.
The Sony Playstation 2 USB mouse is of the standard two button mechanical variety. It is black in color and has a nice PS2 logo on the top.
The kit also comes with a VGA break-out cable for hooking the Playstation 2 to a VGA monitor. By default, the linux installer will only work with a Sync on Green VGA monitor. After the installation is complete, you can instruct the bootloader to only use NTSC or PAL for display (so you don't need to have a monitor nearby). The cable also has two RCA jacks for left and right stereo. It plugs directly into the Playstation 2 video port located at the back left of the machine.
The PS2 Linux kit ships with a version of Kondara Linux, which is based on RedHat Linux 5.2. The distribution's installer (anaconda) has been tailored towards the Playstation 2's hardware making installation a relatively straight forward process.
There are two DVD discs in the distribution, the first one is primarily a bootloader and rescue disc, the second is the software distribution. There are 581 binary RPM packages that are included with the system along with 389 source RPM packages.
The distribution is a relatively complete one, including a tailored X-Windows server, most common server packages and user applications.
Table of Contents
The Playstation 2 is a very complex beast, composed of several different types of specialized processors that are designed to operate in parallel. Most of the processors can access other parts of the system independently and thus a great deal of the work in the PS2 can be performed unattended by the main processor.
The diagram above shows the functional layout of the Playstation 2. The system can be broken down into three groups; graphics, control, and I/O. Most control and calculations happen in the Emotion Engine (EE), graphics rendering is done mostly in the Graphics Synthesizer (GS), and I/O is handled by the I/O Processor (IOP).
The main CPU in the Playstation 2 is one developed by Toshiba, exclusively for the console. It is a 128-bit MIPS ISA level III compliant processor. The Emotion Engine (EE) is the chip that manages most of the other processors in the system, performing the role of a traditional CPU.
Some of its more advanced features include:
The floating point unit included in the EE core is a high performance single-precision floating-point unit. The designers of the FPU decided to not make it IEEE compliant and save some silicon. All this means is that the floating point numbers generated do not comply -exactly- to the IEEE spec, but the numbers should be close enough for most programmers. The FPU contains one multiply-add unit and one floating point divide unit.
Due to the requirement of low manufacturing cost, the EE contains a very limited on-chip cache. 8KB of data cache and 16KB of instruction cache are included on-chip. There is also another cache specified as the Scratchpad that is used as a low-latency working area.
The memory management unit, RDRAM controller and DMA controller handle all memory access within the system. The Playstation 2 is rated at performing a peak theoretical bandwidth of 3.2 GBps.
The DMA controller is a 10 channel controller that can DMA data between main memory and an I/O device (such as the IPU) as well as memory and scratchpad RAM.
The MMU is capable of doing 32-bit physical/logical address space conversion and has a 48-entry TLB to speed lookups.
Vector Unit 0 (VU0) is one of the EE co-processors and is used primarily for geometry processing. Both vector units are micro-programmable processors with their own instruction and data space.
The main features of VU0 include:
VU0 can run in two modes; macro-mode and micro-mode. In macro-mode, the EE can call VU0 instructions directly and fetch the results. In micro-mode, a small vector unit micro-program is uploaded by the EE and subsequently executed. An example would be the VU0 processing physics effects on particles before they are sent to VU1 for the rendering phase. After the micro-program has run, the EE can then retrieve the results of the micro-program.
Vector Unit 1 (VU1) is one of the EE co-processors and is used primarily for graphics pre-processing for the GS. Both vector units are micro-programmable processors with their own instruction and data space.
The main features of VU1 include:
The main difference between VU0 and VU1 is the micro-memory available and their purpose. VU1 has 16KB more internal instruction and data space, versus just 4KB for VU0. VU1 is primarily used for pre-processing of geometry, texture and other graphics data before it is sent to the GS. VU0's primary purpose is to pre-process geometry or aid the EE with physics or other heavy floating point calculations. An example of VU1s use would be performing the perspective transform for all verticies before they are sent to the GS.
The Graphics Synthesizer (GS) is responsible for rendering all graphics primitives to the screen. It is capable of rendering between 25-75 million triangles per second at a fill-rate of about 2.4 Gigapixels per second. The GS can also output images in NTSC, PAL, VESA and DTV formats (either interlaced or non-interlaced). Some of its features include:
The Image Processing Unit is part of the Emotion Engine and performs MPEG-2 macro block decoding, color space conversion and vector quantization for 2D graphics data. This graphics data can be frames from an MPEG-2 movie or compressed textures for 3D models.
There really isn't much more to the IPU, it decodes image data very quickly and thats about it.
The I/O Processor on the Playstation 2 is actually the Playstation 1 main processor with several extensions to handle USB, Firewire, sound, and the other new peripherals introduced by the Playstation 2. It is a standard MIPS R3000R processor without a MMU and 2MB of local memory. All external I/O such as memory card access, USB control, Firewire devices and sound playback is handled via the IOP. Some of its features include:
Unfortunately, access to the entire IOP is not available to general users due to Sony's need to protect their Intellectual Property from pirates and other nefarious individuals.
A relatively gutsy move for Sony at the time was integrating two standard USB ports into the Playstation 2. These are standard USB 1.0 compliant ports and will accept any USB 1.0 compliant device. This includes USB cameras, keyboards, mice, storage devices, speakers, etc.
The USB devices are available to the PS2 Linux kit via the standard Linux USB device filesystem.
Another very gutsy move by SCE was to include a i.Link (Firewire) port with the Playstation 2. Sadly, this gamble seems to not have paid off as much as Sony would have liked it to. Only a select few games use the i.Link port. Gran Turismo 3 is probably the most successful PS2 title to use them for networked gameplay.
Unfortunately, the i.Link port is not accessible via the PS2 Linux kit. The IOP controls access via i.Link and the software calls in the closed source SBIOS do not exist for i.Link access.
The Sound Processing Unit (SPU2) handles all sound mixing and playback. It is a relatively advanced sound processor capable of a variety of sound effects, playback styles and output styles. SPU2 is actually composed of two sound processing cores (CORE0 and CORE1) each with 24-audio channels each. Both SPU cores are identical.
Some SPU2's features include:
Due to the parallel nature of the Playstation 2's many processors, communication between components is quite a complicated process. The system must guarantee a certain order of transmission from one part of the system to the other as well as provide a means to decide which transfer is most important. Like the rest of the system, the mechanism for arbitrating what data goes where is well designed and encapsulated in each of the bus interfaces.
The System Interface (SIF) and System Bus (SBUS) controllers connect the IOP to the main bus and control all data going to and coming from the IOP.
The SIF is comprised of a 8 quad-word FIFO and is used to transfer data to/from the IOP.
The SBUS is the bus between the SIF and the IOP. (THIS SECTION NEEDS MORE DOCUMENTATION - msporny)
The Vector Processor Interface (VIF) handles communication between each VU and main memory. Its main purpose is to decompress incoming data to each VPU (such as vertex data).
The Graphics Interface (GIF) unpacks and formats incoming data from main memory into a form that the GS can understand. An example would be packed vertex and color data that is unpacked into draw commands that will display a triangle on the screen of a specified color.
The DMA controller for the PS2 is an integral part of the system. All the system processors depend on the DMA controller to handle transferring data around the system. Once one of the main processors such as the EE or VPUs format data in a format that another processor can understand it, the DMA controller handles the monotonous task of physically feeding the data to the targeted processor.
An example of this would be the Emotion Engine creating a list of polygons to be rendered to the screen. The display data is then DMA'ed to the GIF via the DMA Controller, which then sends it to the Graphics Synthesizer to become displayed to the screen.
Table of Contents
Table of Contents
Table of Contents
Table of Contents