Skip to content

Commit 7ef0b69

Browse files
committed
README for the PlayStation 2 Linux kernel
1 parent 2853c84 commit 7ef0b69

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# PlayStation 2 Linux kernel
2+
3+
This Linux kernel branch implements the [o32 ABI](https://www.linux-mips.org/wiki/MIPS_ABI_History) for the Sony [PlayStation 2](https://en.wikipedia.org/wiki/PlayStation_2).
4+
5+
```
6+
# uname -mrs
7+
Linux 5.4.169+ mips
8+
# cat /proc/cpuinfo
9+
system type : Sony PlayStation 2
10+
machine : SCPH-37000 L
11+
processor : 0
12+
cpu model : R5900 V3.1
13+
BogoMIPS : 291.58
14+
wait instruction : no
15+
microsecond timers : yes
16+
tlb_entries : 48
17+
extra interrupt vector : yes
18+
hardware watchpoint : no
19+
isa : mips1 mips3
20+
ASEs implemented : toshiba-mmi
21+
shadow register sets : 1
22+
kscratch registers : 0
23+
package : 0
24+
core : 0
25+
VCED exceptions : not available
26+
VCEI exceptions : not available
27+
```
28+
29+
## Building
30+
31+
A `mipsr5900el-unknown-linux-gnu` target GCC cross-compiler is recommended, with for example the command `make ARCH=mips CROSS_COMPILE=mipsr5900el-unknown-linux-gnu- vmlinux`. A provisional configuration is available in [arch/mips/configs/ps2_defconfig](arch/mips/configs/ps2_defconfig).
32+
33+
The [wiki](https://github.com/frno7/linux/wiki) includes a guide on [building and installing PlayStation 2 Linux](https://github.com/frno7/linux/wiki/Building-and-installing-PlayStation-2-Linux).
34+
35+
## Input/output processor (IOP) modules
36+
37+
The [input/output processor (IOP)](https://en.wikipedia.org/wiki/PlayStation_2_technical_specifications#I/O_processor) is a [MIPS R3000A](https://en.wikipedia.org/wiki/R3000), or in later PlayStation 2 models a [PowerPC 405GP](https://en.wikipedia.org/wiki/PowerPC_400#PowerPC_405) emulating a MIPS R3000A. This processor provides a number of kernel services, for example handling of USB OHCI interrupts. These are implemented as IOP modules that the kernel loads as firmware.
38+
39+
This kernel requires the IOP modules provided with the [iopmod](https://github.com/frno7/iopmod) repository, to be installed as kernel firmware.
40+
41+
See also [#11](https://github.com/frno7/linux/issues/11).
42+
43+
## Installing
44+
45+
This kernel can be started directly from a USB flash drive, using for example uLaunchELF for the PlayStation 2. A special kernel loader is unnecessary.
46+
47+
See also [#4](https://github.com/frno7/linux/issues/4) and [#7](https://github.com/frno7/linux/issues/7).
48+
49+
## Limitations
50+
51+
This PlayStation 2 Linux kernel is work in progress, and only a minimum of devices for a useful system have been ported to the latest kernel version. A much older version [2.6.35.14 kernel](https://github.com/frno7/linux/tree/ps2-v2.6.35.14) from 2010 supports more devices etc.
52+
53+
See also [#3](https://github.com/frno7/linux/issues/3), [#5](https://github.com/frno7/linux/issues/5), [#14](https://github.com/frno7/linux/issues/14), [#15](https://github.com/frno7/linux/issues/15), [#16](https://github.com/frno7/linux/issues/16), [#18](https://github.com/frno7/linux/issues/18), [#19](https://github.com/frno7/linux/issues/19), [#21](https://github.com/frno7/linux/issues/21), [#22](https://github.com/frno7/linux/issues/22), [#23](https://github.com/frno7/linux/issues/23), [#24](https://github.com/frno7/linux/issues/24) and [#25](https://github.com/frno7/linux/issues/25).
54+
55+
## Graphics
56+
57+
The [Graphics Synthesizer](https://en.wikipedia.org/wiki/PlayStation_2_technical_specifications#Graphics_processing_unit) device driver supports 1920x1080p (noninterlace), with either an HDMI adapter or component video, as well as common video resolutions such as 720x576p, 720x480p, 640x512i, 640x480i, etc. Console text is accelerated with hardware texturing.
58+
59+
This kernel implements an early `printk`. The conventional `putc` prints to a serial port, that requires soldering on the PlayStation 2. This `putc` instead prints to a video frame buffer using the Graphics Synthesizer, which at the moment is fixed at the video resolution 1920x1080p for an HDMI adapter or component video. The following three lines are the first ones visible on the screen when the kernel boots:
60+
61+
```
62+
zimage at: 00803BE0 00BDDE8C
63+
Uncompressing Linux at load address 80010000
64+
Now, booting the kernel...
65+
```
66+
67+
An experimental [Direct Rendering Manager](https://en.wikipedia.org/wiki/Direct_Rendering_Manager) (DRM) driver for the Graphics Synthesizer is implemented, as this is requirement for [#1](https://github.com/frno7/linux/issues/1).
68+
69+
See also [#9](https://github.com/frno7/linux/issues/9) and [#10](https://github.com/frno7/linux/issues/10).
70+
71+
## USB devices
72+
73+
USB devices such as keyboards, flash drives, wifi, etc. are supported. However, due to memory limitations in the PlayStation 2 I/O Processor (IOP), some USB device drivers may need to be adjusted to work properly.
74+
75+
See also [#2](https://github.com/frno7/linux/issues/2) and
76+
[#17](https://github.com/frno7/linux/issues/17).
77+
78+
## Dependencies when compiling PlayStation 2 Linux programs
79+
80+
GCC 9.1 or later is recommended. Older GCC versions can be used if commit [d728eb9085d8](https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d728eb9085d8) (MIPS: Default to --with-llsc for the R5900 Linux target as well) is applied.
81+
82+
Glibc 2.29 or later is recommended. Older Glibc versions can be used if commit [8e3c00db16fc](https://sourceware.org/git/?p=glibc.git;a=commit;h=8e3c00db16fc) (MIPS: Use `.set mips2' to emulate LL/SC for the R5900 too) is applied.
83+
84+
GAS 2.32 or later is optional. It has the `-mfix-r5900` option to compile generic MIPS II and MIPS III code with the appropriate workaround for the R5900 short-loop hardware bug.
85+
86+
See also [#8](https://github.com/frno7/linux/issues/8).
87+
88+
## PlayStation 2 Linux distributions
89+
90+
A modern [Gentoo Linux](https://gentoo.org/) can be compiled for the R5900 and the PlayStation 2. The Gentoo [sys-devel/crossdev](https://wiki.gentoo.org/wiki/Crossdev) package page and the [cross build environment guide](https://wiki.gentoo.org/wiki/Cross_build_environment) explain the details involving configuring for example a Gentoo profile and a corresponding overlay. Once those simple steps have been taken the command `# crossdev -s4 -t mipsr5900el-unknown-linux-gnu` can be used to obtain an R5900 cross toolchain as well as the basis of an R5900 Gentoo root filesystem in `/usr/mipsr5900el-unknown-linux-gnu`. As the guide explains, the R5900 base system can be built from scratch using the command `# mipsr5900el-unknown-linux-gnu-emerge -uva --keep-going @system`. The root filesystem can then be used with R5900 QEMU user mode emulation for further compilations and testing, or directly in Linux on PlayStation 2 hardware.
91+
92+
## PlayStation 2 Linux emulation
93+
94+
[R5900 QEMU](https://github.com/frno7/qemu) can be used to emulate programs compiled for PlayStation 2 Linux.
95+
96+
## General README
97+
98+
Read the general [README](README) for further information on the Linux kernel.

0 commit comments

Comments
 (0)