[TUTORIAL] Setting up the PSXSDK under Windows and Linux

All other SDK help, questions and information
User avatar
danhans42
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 250
Joined: November 28th, 2012, 11:51 pm
IRC: danhans42
PlayStation Model: SCPH-7502
Want to Find: Inspiration
Location: West Yorkshire, UK
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by danhans42 » August 23rd, 2017, 1:10 am

Xavi92 wrote:I'm glad you finally got it working! If you have any questions regarding PSXSDK, please let me know. )
Will do. Im having problems getting my code to execute on the playstation using catflap and Caetla with the parallel port. I like using that due to the speed and it keeping the SIO port free, but I get an exception whenever I try and run anything.

My current thinking is that its the same issue you experienced with using psxserial, the address the code is being loaded into is not that from the EXE header.
♥ PSX - http://psx0.wordpress.com

My collection - SCPH-102/SCPH-7502, Yaroze Modded PSone, PocketStation (Clear), 2x Xplorer Carts, 2x Xplorer Pro, 2x AR Carts (1 with Ezoray), GS Pro 3, ISA Comms Link Card. Various USB serial devices, Gameshark Sharklink, Kentai Eddy, iMode Cable & other bits and bobs.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » August 25th, 2017, 3:41 pm

In such case, modify PSXSDK's linker script (playstation.x), which is automatically generated by genscripts.sh and set initial memory address (0x80010000 by default) to desired position. I don't recall what memory address Psy-Q games hosted in here were using - I'll check it out when I have some time. Recompile PSXSDK and ensure you made it righr by reading the output ELF file using mipsel-unknown-readelf.

User avatar
nocash
PSX Aficionado
PSX Aficionado
Posts: 306
Joined: November 12th, 2012, 2:36 pm
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by nocash » August 27th, 2017, 1:25 pm

danhans42 wrote:Caetla with the parallel port. I like using that due to the speed and it keeping the SIO port free
If you want it for speed, you could also give it a try with the kernel clone & upload function in no$psx: viewtopic.php?f=76&t=1319 It should be 3x faster than the original xplorer parallel port upload (and probably also than catflap, though I've never tried that). The drawback is that no$psx supports "upload to hardware" only (no debugging on hardware).
Xavi92 wrote:Recompile PSXSDK and ensure you made it righr by reading the output ELF file using mipsel-unknown-readelf.
Good that you mention that, I wondered what kind of debug info you have in psxsdk anyways. So it's in an ELF file with dwarf2 debug info in it? I am currently working on supporting PsyQ .SYM files, and could add support for ELF, too.
More on that here: viewtopic.php?f=76&t=1318
ELF could be even easier than SYM because the no$gba code (that no$psx is based on) already supports ELF symbols & source line numbers. I would only need some psxsdk sample with source code, elf file, and binary in cue/bin or exe format (though the exe is probably also contained inside of the elf file, or isn't it?).

Rooti
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: June 24th, 2017, 7:55 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Rooti » September 24th, 2017, 7:22 am

@danhans42 how did you compile GMP, MPFR and MPC? I think thats where my toolchain fails.
I have tried it with both windows and linux.

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Shendo » September 26th, 2017, 9:24 pm

If you are installing versions of gcc and binutils I listed in the first post make sure to install all mentioned packages (wget, make, mkisofs, g++, gmp, mpfr, mpfr-dev, mpc, diffutils) in cygwin.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Rooti
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: June 24th, 2017, 7:55 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Rooti » September 28th, 2017, 8:50 am

I did install the mentioned packages, via pacman in MSYS2 (Which is based on Cygwin), also tried it in a regular cygwin, so far no success.

I tried one of the prebuilt toolchains that are up on Google Code, which worked fine for me.
I then tried to build an image with the selfbuilt compiler, and the rest of the precompiled toolchain. So I would assume, that my selfbuilt compiler is not working.

Is it possible that some of the libraries have to be recompiled for the Mips-target of the Playstation?

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Cygwin

Post by Xavi92 » October 11th, 2017, 11:54 pm

Take into account even the version of your host compiler matters when you try to compile GCC from scratch. For example, for mipsel-unknown-elf-gcc 5.2.0, I explicitely had to use x86-64 GCC 5.4.1.

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Shendo » February 3rd, 2019, 8:41 am

I updated the guide. Now for both Windows and Linux (Ubuntu) and with the latest binutils and gcc.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

User avatar
gwald
1997 Yaroze Enthusiast
1997 Yaroze Enthusiast
Posts: 256
Joined: September 18th, 2013, 8:44 am
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Location: Australia
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by gwald » February 3rd, 2019, 10:41 am

Nice one, you make it look really easy! :D

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Shendo » February 4th, 2019, 2:06 am

Thanks. Yeah, it's a pain sometimes to get everything working.

I actually also wanted to add macOS to the list but I'm having trouble compiling PSXSDK's tools for the host OS.
Compiler seems to be stricter and what would otherwise be warnings it treats as errors.
But it's OK, those errors/warnings need to be fixed.

I'd like to fix those issues myself but having no official PSXSDK repo it's a difficult task.
I contacted Tails92 back in December asking him to make an official PSXSDK repository but I didn't receive a reply.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

User avatar
gwald
1997 Yaroze Enthusiast
1997 Yaroze Enthusiast
Posts: 256
Joined: September 18th, 2013, 8:44 am
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Location: Australia
Contact:

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by gwald » February 4th, 2019, 8:13 am

maybe use Xavi92's repo (the airport dev)?
https://github.com/XaviDCR92/psxsdk-20150729

User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Shendo » February 5th, 2019, 1:46 am

Yes, however that repo is outdated. The newest PSXSDK is 20180115.
I could make a new repository with the current version but there are two problems with that approach.

1. It's not my project,
2. If Tails keeps updating his SDK then we will have code discrepancy.

So I would really like to have an official repository.
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Xavi92
C Programming Expert
C Programming Expert
Posts: 122
Joined: October 6th, 2012, 12:53 am

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Xavi92 » February 6th, 2019, 5:14 pm

My repo is based on 20150729 but includes some experimental features here and there. However, there are some really interesting features I had missed from 20180115, so I might merge them into my repo so it is up to date while keeping those experimental features.

Rooti
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: June 24th, 2017, 7:55 am

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Rooti » February 11th, 2019, 4:54 am

It seems u forgot to add the part where u actually compile the binutils and gcc

For the current version of the tutorial it should be something like:

Code: Select all

cd $BASEDIR/build/psxsdk-binutils/
../../source/binutils-2.31/configure --prefix=/usr/local/psxsdk --target=mipsel-unknown-elf --with-float=soft
make
sudo make install


cd $BASEDIR/build/psxsdk-gcc/
../../source/gcc-8.2.0/configure --disable-libada --disable-libssp --target=mipsel-unknown-elf --prefix=/usr/local/psxsdk --with-float=soft
make
sudo make install


User avatar
Shendo
C Programming Expert
C Programming Expert
Posts: 238
Joined: March 21st, 2012, 4:34 am
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-9002
Location: Croatia, EU

Re: [TUTORIAL] Setting up the PSXSDK under Windows and Linux

Post by Shendo » February 11th, 2019, 1:06 pm

No I haven't. It's under "Download and install toolchain" section.
But you have to scroll to reveal the entire code, maybe that's throwing you off...
My PS1 consoles: 2 x SCPH-1002, SCPH-5552, SCPH-7002, 4x SCPH-9002, 2 x SCPH-102.
Dev console: SCPH-9002, MM3 - 7 wire modchip, PAL color mod, CH340 serial cable addon.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests