From LinuxMIPS
Jump to: navigation, search

This article is a stub. You can help by expanding it

Rumor is that .ru has done a port of uClinux to the Playstation 1 (as the system lacks a MMU), sources seem hard to come by due and .ru website gone.

The Internet Archive still holds most of their web-pages, but no files.

According to their own press release its based on the uClinux 2.4.x kernel

Runix also made special addons to make Linux run on the Playstation 1

  • GPU virtual console;
  • Playstation memory card block driver;
  • ability to mount root file system on Playstation memory card;
  • USB hardware support (this requires a hardware addon made by Runix)

The Hardware for USB

USB host controller SL811H driver with keyboard and mouse support; 
PSXLinux kernel beta 1 release.

no board or other details are found yet only a notion in the sourcecode for a "PIO extension board" with maybe a SmartMedia controller

To compile PSXLinux kernel you will need:

[edit] I found the sources on a russian mirror... unfortunately, there's no documentation about installing it. A HOWTO was made, but only in italian :( [edit by codeasm] please check: [1]

[added by codeasm] Ive not seen anyone succesfully compile it or even trying, I like to do that soon. some new sources might help others: [[2]] or read more Source: [3]

While hordes of barbarians are cannibalizing PS2s and Xboxs, there’s still someone without money tinkering with a (measly) r3000a :)

Introduction This HOWTO started the 4th novembre 2001 at 00.13 AM by Antonio "Willy" Malara, known as BeHappy on IRC, and shows hot to run Linux 2.4.0 kernel on Sony Playstation (PSX), it can be redistributed totally o partly under GPL license terms. I’d like to thank i8088, sckness and suppaman and the whole #linux-it IRCnet channel.

Let’s start PSX has a built in 33Mhz MIPS R3000A processor without floating point support, 2 MB of programs RAM, 1 MB of VRAM and a further MB for sound. The architecture is a mipsel, that is mips little endian processors. Now we could download the SGI kernell and work with it, but fortunately the russian society Runix ( did the dirtiest job for us, so will be good download the kernel port from their site. Now it’s time to set the compilers, and there’s two paths to choose: using the binary tarball provided by Runix or patching the binaries as explained in the MIPS-HOWTO. For now I personally decided to use the Runixset, even if I have to compile by myself gcc and binutils later, in search of the phantom binary format `flat' which seems the only one compatible with PSXLinux, as we will see later.

Configuration and compilation Now that the sistem is set up to cross-compiling on mipsel architecture, let’s untar the file `PSXLinux-kernel-2.4.x-alpha2.tar.gz' getting the typical tree of Linux sources, the usual make menuconfig and then proceed with our configuration paying attention in not select, into "PlayStation Character devices"menu, the "PlayStation SIO console" option, unless we have a serial PSX-PC cable adaptor (later I’ll provide you a link with a scheme to build one by yourself). If we don’t have the serial cable adaptor is mandatory select `RAM disk support' and ` Initial RAM disk (initrd) support', both inside `Block devices' menù. Inside`README.PSXLinux' there are directions we will promptly follow:

Code maturity level options: Prompt for development and/or incomplete code/drivers - YES

Machine selection: Support for Sony Playstation - YES

Loadable module support: Enable loadable module support - NO

CPU selection: CPU type - R3000

General setup: Kernel floating-point emulation - YES Kernel support for flat binaries - YES Kernel support for a.out binaries - NO Kernel support for ELF binaries - NO Kernel support for MISC binaries - NO

Block devices: PSX memory card support - YES

File systems: Second extended fs support -YES

Console drivers: PSX GPU virtual console - YES Virtual terminal - YES Support for console on virtual terminal - YES

Kernel hacking: Are you using a crosscompiler -YES

Now we can `make' - no need to specify bzImage or else as indicated in the menuconfig final step. If everything went well, we’ll get a binary ELF named `linux'. `README.PSXLinux' tells us we can now run the binary on the PlayStation, but descriptions on how-to are very few. Now there are two ways to proceed: use the serial cable or burn a disc. And now becomes problematic, because the programs provided by Runix require this famous cable: if you own that, you can just use `psx-serial' from Runix, composed by the PSX-side program (provided as ISO to burn on disc) and PC-side program (in binary form, which allows the PSX to run ELF files), but, if you don’t own that magic cable (like me), let’s take a darker path which will lead us to goal anyway.

Preparing an ISO with our kernel Well, to sum up, we have just one kernel compiled in ELF. The Playstation has it’s own format for executables named PS-EXE; some time ago Sony release a black version of PlayStation, called`Net Yaroze', sold as amateur development kit. This kit included the PlayStation Net Yaroze, the mystic serial cable, and GNU compilers (yes, GNU) and development libraries; this PSX use the ECOFF executables format, like some SGIs, but, since the Net Yaroze project had a closed number and in order to access was needed to sign a highly restrictive agreement about distributing the software (except other Yaroze members), some Demo-Coder groups developed tools to help those who wanted to challenge themselves in PSX programming, including a program called `eco2exe' which converts Yaroze executables, ECOFF, in `PSX' executables, PS-EXE indeed. What has all of this to do with our goal that seems far away as ever? Well, looking inside the`PSXLinux/' I found some usefull utilities, for example in `PSXLinux/arch/mipsnommu/boot' there are `elf2ecoff.c' and `addinitrd.c' files, that will serve us. Let’s compile the programs using: gcc -o elf2ecoff elf2ecoff.c gcc -o addinitrd addinitrd.c and convert the resulting `linux' file in ECOFF format using: elf2ecoff linux linux.ecoff At this point for a fully working Linux system we need a root filesystem. In the Runix project, the root filesystem should be inserted into PSX memory cards, and is up to the program `psx-mcard' managing the rest. Even this program requires the serial cable, and is distribuited as ISO for PSX-side and binaries for PC-side; untarring the `psx-mcard.0.8.2.tar.gz' file we’ll find `mem_card.example' as a pleasant surprise, a little working filesystem ext2 to use as root filesystem, or as guide to create a new one by ourselves. Now let’s use `addinitrd' to merge the root filesystem with kernel image, since at the moment we’re unable to access the PlayStation cd player, using the command: addinitrd linux.ecoff mem_card.example linux.image.ecoff The result is the kernel image (with the initrd) in ecoff format. Now we need to move on Windows platform, real or emulated is no difference, to finish the final ISO to burn. Let’s give the command: eco2exe linux.image.ecoff to convert the binary in PS-EXE format, and rename it (to avoid any kind of problem on both Windows and PSX enviroment) in a more canonical 8.3 linux.exe move linux.image.ecoff linux.exe It’s time to see the result of our efforts on a PSX emulator, to check the operations accuracy. Before to burn the result disc there’s a final step: Sony’s CD player can’t read executibles file that aren’t multiple of 2048 bytes, so, to fix the file length, we’ll use another tool, exefixup: C:> exefixup linux.exe

[...] [save as padded.exe]? yes

C:> move padded.exe psx.exe

The psx.exe file is now filled with zeros (nop in assembler mips) to became 2048 bytes mutiple. With our favourite burning program let’s create an ISO XA (Mode 2) image containing the psx.exe file: that’s all it needs because the PSX automatically runs the file if located into the disc root. The last thing to do before burn the disc is licensing, i.e. let the PSX able to run the disc, and to do that let’s use the program bootedit2 in windows, which allow us not only to license the ISO, but also to edit writings and image in the boot sequence. Let’s burn and see the result ;).

Conclusions We have a kernel executable by Sony Playstation and nothing more, because the Runix root filesystem redirects the console to the serial port (in the next update of this HOWTO I’ll describe how to redirect the console to the GPU), nothing more. I think we did a real big step, mostly because an operative system without kernel is nothing :).


• insert missing links • try to compile gcc with flat binaries support • find a reason to run linux on playstation ;)

Antonio "Willy" Malara (BeHappy_ on IRC)

(finished on the 4th November 2001 at 03:15 AM)

External Links