Page 1 of 2

[TUTORIAL] Setting up the PSXSDK under Windows and Linux

Posted: March 28th, 2012, 4:08 am
by Shendo
Image
About PSXSDK:
PSXSDK is an open source software development kit for the
Sony PlayStation 1 console made by NextVolume aka Tails92.

In this tutorial I will explain how to install and use PSXSDK.

Currently this tutorial is for Windows and Ubuntu linux.
Other operating systems will be added in the future.

Windows XP, Vista, 7 and 8:
As PSXSDK requires POSIX environment we will be using Cygwin.
Download x86 version even if you use x64 build of Windows (thanks Xavi92).

After you have downloaded "Setup.exe" run it, choose the Internet instalation and select a source
closest to your location (or any one if you don't mind the slower download rate).

Default packages wil now be shown.
The following packages need to be added to the installation (use the search command):
wget, make, mkisofs, gcc-g++, diffutils, zlib-devel

When the setup is done run the "Cygwin Terminal" shortcut that was placed on your desktop.

Note: Don't use sudo command on Cygwin, just omit it.

Windows 10:
On Windows 10 for our POSIX needs we can use WSL (Windows Subsystem for Linux).
Follow this guide and make sure you have a working Ubuntu WSL setup before proceeding.

If for some reason you can't or won't use WSL follow the guide for older Windows releases
but I really recommend WSL on Windows 10 as it compiles faster in my experience.

Ubuntu:
Just follow the guide, there are no extra steps.

Install prerequisites (Windows 10 and Ubuntu):

Code: Select all

sudo apt-get update
sudo apt-get install wget mkisofs gcc g++ make zlib1g-dev
Download and install toolchain:

Code: Select all

wget http://ftp.gnu.org/gnu/binutils/binutils-2.31.tar.gz
wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz

export BASEDIR=$PWD
mkdir source build

tar -zxf binutils*gz -C source
tar -zxf gcc*gz -C source

cd build
mkdir psxsdk-binutils
mkdir psxsdk-gcc

cd psxsdk-binutils
$BASEDIR/source/binutils*/configure --disable-nls --prefix=/usr/local/psxsdk --target=mipsel-unknown-elf --with-float=soft
make
sudo make install

cd $BASEDIR/source/gcc*
./contrib/download_prerequisites
cd $BASEDIR/build/psxsdk-gcc
$BASEDIR/source/gcc*/configure --disable-nls --disable-libada --disable-libssp --disable-libquadmath --disable-libstdc++-v3 --target=mipsel-unknown-elf --prefix=/usr/local/psxsdk --with-float=soft --enable-languages=c,c++
make
sudo make install
Download and install PSXSDK:

Code: Select all

cd $BASEDIR
wget http://unhaut.x10host.com/psxsdk/psxsdk-20180115.tar.bz2
tar xvjf psxsdk-20180115.tar.bz2 -C source
cd source/psxsdk-20180115

export PATH=$PATH:/usr/local/psxsdk/bin
Open Makefile.cfg inside psxsdk directory and change line "MAKE_COMMAND = gmake" to "MAKE_COMMAND = make".
Save the file and proceed. You can use Vim ( to close it press ESC, then ":" and "x" to save changes).

Code: Select all

vi Makefile.cfg
Then build and install it.

Code: Select all

make
sudo make install
Permanently exporting path:

Code: Select all

vi ~/.bashrc
Add "export PATH=$PATH:/usr/local/psxsdk/bin" without quotes at the end of the file.
Congratulations :clap You have successfully installed PSXSDK on your PC.

To test your newly installed SDK run the example, eg. mandel.

Code: Select all

cd examples/mandel
make

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: October 11th, 2012, 8:55 am
by Xavi92
Hell YEAH! THANK YOU! I had tried to do this for ages and I hadn't achieved it until I read your tutorial! Seriously, thanks a lot again! :D

Users who need compiling GMP, MPFR and MPC before GCC (as me) should read this how-to:

http://www.acsu.buffalo.edu/~charngda/cc_build.html

PD: BTW, I didn't need to change those lines in Makefile - doing it caused me an error, so I kept them as they were before. I've used Kubuntu 10.10 instead of Windows though.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: October 29th, 2012, 11:56 pm
by armorineSKY
This also works in windows?

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: November 1st, 2012, 10:14 pm
by Mdrb

Code: Select all

...Cygwin (POSIX environment for Windows)...
@armorineSKY: Yes, this tutorial is made for Windows users ! (so it'll work on this OS ;))

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: November 2nd, 2012, 3:01 am
by Xavi92
Although nowadays this procedure isn't needed anymore unless you want to compile PSXSDK under Linux. There is an automatic installer which eases the job:

https://code.google.com/p/psxsdk/downlo ... e&can=2&q=

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: December 6th, 2012, 8:47 pm
by CodeAsm
Sadly your forum seems offline, but thanx for the automated installer :D

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: December 15th, 2012, 5:46 am
by Xavi92
CodeAsm wrote:Sadly your forum seems offline
Hey, that's Tails92, not me. I'm just a PSXSDK user. :)

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: October 3rd, 2015, 5:05 am
by Shendo
Updated for newest release.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: October 5th, 2015, 3:26 am
by Xavi92
Getting this error when configuring binutils-2.25:

Code: Select all

$ ./configure --disable-nls --prefix=/usr/local/psxsdk --target=mipsel-unknown-elf --with-float=soft
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking target system type... mipsel-unknown-elf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking to see if cat works as expected... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... configure: error: in `/home/Xavi/binutils-2.25':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Have you ever encountered this problem before?

EDIT: Solved. I was using Cygwin for x64 systems, instead of Cygwin x86.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: October 7th, 2015, 10:29 pm
by Shendo
I never encountered that error. Glad you solved it. I'll add a note in the tutorial.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: June 24th, 2017, 8:26 am
by Rooti
Hello everyone; first time poster, long time lurker here :D

I was successful in compiling and setting up the tool chain using binutils-2.28, gcc-7.1.0 and psxsdk-20160603 within Msys2.
I compiled the mandelbrot example and tried to master the image according to this guide:
http://www.psxdev.net/help/cdrom_mastering.html

I ran the programs, which wouldn't run in windows 10 64 bit, in DosBox.
I then tried to run the Image in Xebra, which didn't work. I am just stuck at the PlayStation screen.
To test my Xebra setup I loaded a copy of Crash Bandicoot, which worked excellent.

So any guesses what went wrong? Any tips?

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: June 24th, 2017, 11:58 pm
by Shadow
Could be anything. Need more info though.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: July 5th, 2017, 3:51 am
by Xavi92
Why don't you use the tools PSXSDK already provides to create a valid BIN/CUE image instead of looking at PSXDEV Psy-Q oriented tutorials? I would recommend you taking a look into the Makefile for my video game, specially lines 60-68.

https://github.com/XaviDCR92/Airport/bl ... e/Makefile

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: July 19th, 2017, 2:33 am
by Rooti
Thank you all for the replies.
I did try the Makefile that came with the psx-sdk but when i tried to load them up in XEBRA, it usually got stuck in one of the First screens.

I Also did try the lines of the Makefile (https://github.com/XaviDCR92/Airport/bl ... e/Makefile) but ended up with the same result.

Has anyone had experience with GCC7 so far?

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: July 19th, 2017, 9:57 pm
by Shendo
Make sure you run .bin image. Xebra can't load .cue sheets afaik.

You can also try other emulators. no$psx is another great one with features like disassembler, tty debug window and support for loading executables without the need for a cd image.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: July 20th, 2017, 5:31 am
by Xavi92
So far I've tested GCC 5.2.0 with no issues. In any case, I would always recommend PCSX-R for testing, as it also supports TTY printf debug messages. AFAIK, no$psx does not recognize joypad input on games created with PSXSDK.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: August 19th, 2017, 4:26 am
by danhans42
Anyone have any tips on this with Linux? Im trying to get setup on Debian 9 but stuck on getting binutils compiled. Make goes without issue, but on 'make install' i get..

Code: Select all

libtool: link: ranlib .libs/libbfd.a
libtool: link: ( cd ".libs" && rm -f "libbfd.la" && ln -s "../libbfd.la" "libbfd.la" )
libtooldir=`/bin/bash ./libtool --config | sed -n -e 's/^objdir=//p'`; if [ -f $libtooldir/libbfd.a ]; then   cp $libtooldir/libbfd.a libbfd.tmp;   ranlib libbfd.tmp;   /bin/bash ./../move-if-change libbfd.tmp libbfd.a; else true; fi
touch stamp-lib
make[5]: Entering directory '/home/dan/binutils-2.25/bfd'
make[5]: Nothing to be done for 'install-exec-am'.
test -z "" || /bin/mkdir -p ""
test -z "" || /bin/mkdir -p ""
make[5]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[4]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[3]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[2]: Leaving directory '/home/dan/binutils-2.25/bfd'
make[2]: Entering directory '/home/dan/binutils-2.25/opcodes'
make[2]: *** No rule to make target 'install'.  Stop.
make[2]: Leaving directory '/home/dan/binutils-2.25/opcodes'
Makefile:3106: recipe for target 'install-opcodes' failed
make[1]: *** [install-opcodes] Error 2
make[1]: Leaving directory '/home/dan/binutils-2.25'
Makefile:2154: recipe for target 'install' failed
make: *** [install] Error 2
root@debian:/home/dan/binutils-2.25#
I have all the dependencies installed (mpc etc..)

Any ideas?


EDIT: Started over but changed to GCC 7.1.0 and Bin Utils 2.28 and seems to be going fine now.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: August 19th, 2017, 6:04 am
by Xavi92
Have you tried any other Binutils version?

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: August 19th, 2017, 6:14 am
by danhans42
Hi Xavi92

Yep, just edited my post above, changed to GCC 7.1.0 and Bin Utils 2.28 and im now building GCC, so got a lot further.

Thanks

EDIT: Works perfect with the above. Only thing I had to do was to install zlib (as I hadn't), and also create a symbolic link for mkisofs, as mkisofs isnt in the debian repo.

All in all its great, I now have a £15 HP Thin Client running Debian 9 with the open source SDK and Catlflap. I can log into it from anywhere. Great guide thanks.

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Posted: August 20th, 2017, 8:41 pm
by Xavi92
I'm glad you finally got it working! If you have any questions regarding PSXSDK, please let me know. )