Sony PlayStation 2 (MIPS R5900) - buxus

Sony PlayStation 2

Sony Playstation 2

The legendary game console of the 2000s.

The PlayStation 2 (PS2) had a version of Linux available which included a hard-disk drive, ethernet adapter, a VGA graphics adapter and a USB keyboard and mouse.

Specification

System Namebuxus
SystemSony PlayStation2
CPUEmotion Engine with a MIPS R5900 294MHz CPU core
RAM32 MiB
StorageMaxtor 4D040H2, 40GB
DVD-ROM
Videobuilt-in
Soundbuilt-in
Network10/100 Mb/s ethernet
OSLinux for PlayStation2

Further Sources

System Information - Linux

So what does Linux have to say about the PS2...

uname

Operating system kernel information:

$ uname -a
Linux buxus 2.2.1 #1 Wed Nov 14 18:28:00 JST 2001 mips unknown

So a "Linux" kernel, on node named "buxus", kernel version "2.2.1", kernel release "#1 Wed Nov 14 18:28:00 JST 2001", machine architecture "mips", processor type "unknown".

/proc/cpuinfo

System processor information:

cpu			: MIPS
cpu model		: R5900 V3.1
system type		: EE PS2
BogoMIPS		: 392.40
byteorder		: little endian
unaligned accesses	: 0
wait instruction	: no
microsecond timers	: no
extra interrupt vector	: yes
hardware watchpoint	: no
VCED exceptions		: not available
VCEI exceptions		: not available

The Emotion Engine CPU core is based on the MIPS R5000 processor, with support for MIPS III, a subset of MIPS IV and a custom Sony instruction set. The additional Sony instructions provide single instruction multiple data (SIMD) functionality, a common improvement to handle multimedia processing requirements.

lsdev

Device information:

$ lsdev
Device            DMA   IRQ  I/O Ports
------------------------------------------------
cascade             4
Ch-0 timer/counter          9
fromIPU DMA              19
fromSPR DMA              24
GIF DMA                  18
GS FINISH                33
ide0                         b4000040-b4000047 b400005c-b400005c
PlayStation 2 Ethernet         41
SIF0 DMA                 21
toIPU DMA                20
toSPR DMA                25
usb-ohci                 42
VIF0 DMA                 16
VIF1 DMA                 17

Well I see the IDE controller ("ide0"), the ethernet adapter ("PlayStation 2 Ethernet"), and the USB controller ("usb-ohci") in there.

/proc/devices

Devices according to the kernel:

$ cat /proc/devices
Character devices:
  1 mem
  2 pty
  3 ttyp
  4 tty0
  5 ptmx
  7 vcs
 10 misc
 14 sound
128 ptm
136 pts
180 usb
240 ps2dev
242 tst

Block devices:
  1 ramdisk
  3 ide0
  7 loop
243 ps2cdvd

Recognizable devices for the IDE controller and CD/DVD drive.

/proc/meminfo

Memory information:

$ cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  31612928 29855744  1757184 15347712  7471104 13877248
Swap: 271392768   299008 271093760
MemTotal:     30872 kB
MemFree:       1716 kB
MemShared:    14988 kB
Buffers:       7296 kB
Cached:       13552 kB
SwapTotal:   265032 kB
SwapFree:    264740 kB

The PS2 has 32 MiB of RAM, and that is reflected here.

/proc/bus/usb/devices

Devices on the USB bus:

$ cat /proc/bus/usb/devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB OHCI Root Hub
S:  SerialNumber=1f801600
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 2
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=054c ProdID=005d Rev= 0.01
S:  Manufacturer=Sony Computer Entertainment Inc.
S:  Product=SCE USB Keyboard Hub
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms
T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=054c ProdID=005c Rev= 0.01
S:  Manufacturer=Sony Computer Entertainment Inc.
S:  Product=SCE USB Keyboard
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=keyboard
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl= 10ms
T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  4 Spd=1.5 MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=054c ProdID=0061 Rev= 4.41
S:  Manufacturer=Sony Computer Entertainment Inc.
S:  Product=SCE USB MOUSE
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usb_mouse
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl= 10ms

So there is the system root hub ("USB OHCI Root Hub"), with keyboard hub ("SCE USB Keyboard Hub") attached which connects to the keyboard ("SCE USB Keyboard") and mouse ("SCE USB MOUSE").

dmesg

System boot messages:

$ dmesg
use boot information at 0x81fff000(old style)
boot option string at 0x81fff100: root=/dev/hda6 crtmode=pal
Loading R5900 MMU routines.
CPU revision is: 00002e31
Primary instruction cache 16kb, linesize 64 bytes
Primary data cache 8kb, linesize 64 bytes
  Branch Prediction  : on
  Double Issue       : on
Linux version 2.2.1 (root@anps2rel1) (gcc version 2.95.2 19991024 (release)) #1 Wed Nov 14 18:28:00 JST 2001
no initrd found
Console: colour dummy device 80x25
Calibrating delay loop... 392.40 BogoMIPS
Estimated CPU clock:  294.240 MHz
Memory: 30828k/32760k available (1192k kernel code, 672k data)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PlayStation 2 SIF BIOS: 0250
Linux NET4.0 for Linux 2.2
Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0 for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
Linux IP multicast router 0.06 plus PIM-SM
Starting kswapd v 1.5
PlayStation 2 device support: GIF, VIF, GS, VU, IPU, SPR
Graphics Synthesizer revision: 0000551b
Console: switching to colour PlayStation 2 Graphics Synthesizer 80x30
pty: 256 Unix98 ptys configured
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb.c: registered new driver usb_mouse
usb.c: registered new driver keyboard
usb-ohci.c: USB OHCI at membase 0x1f801600, IRQ 42
usb-ohci.c: GrowLocalMem 64K bytes
usb.c: new USB bus registered, assigned bus number 1
usb.c: USB new device connect, assigned device number 1
hub.c: USB hub found
hub.c: 2 ports detected
RAM disk driver initialized:  1 RAM disks of 10240K size
loop: registered device at major 7
PlayStation 2 IDE DMA driver
hda: Maxtor 4D040H2, ATA DISK drive
ide0 at 0xb4000040-0xb4000047,0xb400005c on irq 41
hda: Maxtor 4D040H2, 38146MB w/2048kB Cache, CHS=4863/255/63, (U)DMA
scsi : 0 hosts.
scsi : detected total.
Partition check:
 hda: hda1 hda2 < hda5 hda6 >
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 44k freed
usb.c: USB new device connect, assigned device number 2
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: USB new device connect, assigned device number 3
keybdev.c: Adding keyboard: input0
input0: USB HIDBP keyboard
usb.c: USB new device connect, assigned device number 4
input1: USB HIDBP mouse
PlayStation 2 Real Time Clock driver
PlayStation 2 Sound driver with 32bit DMA support
Adding Swap: 265036k swap-space (priority -1)
eth0: MAC address 00:04:1f:04:34:00
PlayStation 2 SMAP(Ethernet) device driver is loaded.
eth0: Auto-negotiation complete. 100Mbps Full duplex mode.
Uniform CDROM driver Revision: 2.52
PS2 CD/DVD-ROM driver
VFS: Disk change detected on device ps2cdvd(243,0)

Lots of hardware detection in here, showing various PlayStation 2 components being picked up.

lsmod

Loaded kernel modules:

$ lsmod
Module                  Size  Used by
ps2cdvd                22144   1 (autoclean)
cdrom                  14640   0 (autoclean) [ps2cdvd]
isofs                  20608   1 (autoclean)
smap                   24480   1 (autoclean)
tst_dev                 2848   0 (autoclean)
ps2sd                  39152   0
sound                  78960   0 [ps2sd]
soundcore               3552   7 [ps2sd sound]
ps2debuglog             2240   0 [ps2sd]
ps2rtc                  1888   0

Not sure what all these are... but the PS2 related ones look to be:

  • ps2cdvd - PlayStation 2 CD/DVD drive
  • ps2sd - PlayStation2 Sound Driver
  • ps2debuglog - PlayStation 2 Debug Log?
  • ps3rtc - PlayStation 2 Real Time Clock (RTC)

Looking in /lib/modules/2.2.1/misc/ there are a couple more PlayStation 2 modules:

  • ps2mc - PlayStation 2 Memory Card
  • ps2mcfs - PlayStation 2 Memory Card Filesystem
  • ps2pad - PlayStation 2 Game Pad

Benchmark

To give some idea of relative performance, let's run some benchmarks...

BogoMips

The BogoMips pseudo-benchmark (Wikipedia) is used by the Linux kernel to calibrate a wait loop. The value obtained at boot is reported by '/proc/cpuinfo' and 'dmesg' (see above).

Calibrating delay loop... 392.40 BogoMIPS
Estimated CPU clock:  294.240 MHz

For an MIPS R5000 processor the BogoMips result is expected to be roughly equal to the processor clock. But the result for the R5900 is higher than this, suggesting that custom instruction set is having an effect on this algorithm.

OpenSSL

The OpenSSL library of cryptographic methods provides a means to test the performance of the methods. Using this we can get a feel for the computational performance of a system, and comparisons with real hardware and other emulations can show how well a particular emulation performs. Since we are mainly interested in old hardware, we'll test using two of the older methods: MD5 and RSA.

$ openssl speed md5
Doing md5 for 3s on 8 size blocks: 817356 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 499587 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 233404 md5's in 3.00s
Doing md5 for 3s on 1024 size blocks: 74704 md5's in 3.00s
Doing md5 for 3s on 8192 size blocks: 9904 md5's in 3.00s
OpenSSL 0.9.6b [engine] 9 Jul 2001
built on: Sat Oct 13 02:45:57 JST 2001
options:bn(64,32) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish(idx)
compiler: gcc -fPIC -DTHREADS -D_REENTRANT -DNO_ASM -DL_ENDIAN -DTERMIO -O2 -Wall
The 'numbers' are in 1000s of bytes per second processed.
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5               2179.62k    10657.86k    19917.14k    25498.97k    27044.52k
$ openssl speed rsa
Doing 512 bit private rsa's for 10s: 1061 512 bit private RSA's in 10.00s
Doing 512 bit public rsa's for 10s: 12965 512 bit public RSA's in 10.00s
Doing 1024 bit private rsa's for 10s: 234 1024 bit private RSA's in 10.03s
Doing 1024 bit public rsa's for 10s: 4547 1024 bit public RSA's in 10.00s
Doing 2048 bit private rsa's for 10s: 39 2048 bit private RSA's in 10.01s
Doing 2048 bit public rsa's for 10s: 1311 2048 bit public RSA's in 10.00s
Doing 4096 bit private rsa's for 10s: 6 4096 bit private RSA's in 10.65s
Doing 4096 bit public rsa's for 10s: 350 4096 bit public RSA's in 10.00s
OpenSSL 0.9.6b [engine] 9 Jul 2001
built on: Sat Oct 13 02:45:57 JST 2001
options:bn(64,32) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish(idx)
compiler: gcc -fPIC -DTHREADS -D_REENTRANT -DNO_ASM -DL_ENDIAN -DTERMIO -O2 -Wall
                  sign    verify    sign/s verify/s
rsa  512 bits   0.0094s   0.0008s    106.1   1296.5
rsa 1024 bits   0.0429s   0.0022s     23.3    454.7
rsa 2048 bits   0.2567s   0.0076s      3.9    131.1
rsa 4096 bits   1.7750s   0.0286s      0.6     35.0

Extracting the relevant figures for comparisons (see OpenSSL Speed Results):

  • OpenSSL speed MD5 8,192 bytes: 27,044.52k
  • OpenSSL speed RSA 4,096 bytes sign/s: 0.6
  • OpenSSL speed RSA 4,096 bytes verify/s: 35.0

Would be interesting to have similar figures for a regular MIPS R5000 to see if the customizations are being used and having an effect.


No comments: