Porting to PlayStation1 Guide

This is an old revision of Porting to PlayStation1 Guide, edited by Key-Real at . The current revision is 149698.

/* Overview */

Overview

This is a step by step tutorial based on the example of my FPC port to the PlayStation 1.

To see the port in action look at the PlayStation 1 compilation manual.

This Guide assumes we are working under Linux.

Forking and Merging

The first step is to create an GitLab account and Fork the compiler sources from

https://gitlab.com/freepascal.org/fpc/source

when done, create a new branch. I called it PS1. Now when Your are done with the work, just do a merge request. The FPC Team will review Your changes and merge them into the main branch.

Preparing the Assembler and Linker

As we don't going to write our own internal Assembler and Linker we use GNU BinUtils. In our case we need the MIPSEL one.

Download a recent version from https://ftp.gnu.org/gnu/binutils/ . Then run shell commands:

./tar -xf <binutils.tar.gz>
./cd <binutils>
./mkdir build
./cd build
../configure --prefix=/usr/local/mipsel-unknown-elf --target=mipsel-unknown-elf --with-float=soft
make -j$(nproc)
sudo make install
export PATH="/usr/local/mipsel-unknown-elf/bin:$PATH"

Now you can go two ways:

1) Let the binaries as they are and always use the compiler option

-XP/usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf-

2) Create symlinks

sudo ln -s /usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf-as /usr/bin/mipsel-ps1-as
sudo ln -s /usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf-ld /usr/bin/mipsel-ps1-ld
sudo ln -s /usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf-objcopy /usr/bin/mipsel-ps1-objcopy