[TUTORIAL] Setting up the PSXSDK under Windows and Linux

All other SDK help, questions and information
danhans42
BANNED
BANNED
Posts: 330
Joined: Nov 28, 2012

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.

Xavi92
Verified
C Programming Expert
C Programming Expert
Posts: 161
Joined: Oct 06, 2012
PlayStation Model: SCPH-5502
Contact:

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
Verified
PSX Aficionado
PSX Aficionado
Posts: 534
Joined: Nov 12, 2012
Contact:

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: http://www.psxdev.net/forum/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: http://www.psxdev.net/forum/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: Jun 24, 2017

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
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

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.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

Rooti
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: Jun 24, 2017

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
Verified
C Programming Expert
C Programming Expert
Posts: 161
Joined: Oct 06, 2012
PlayStation Model: SCPH-5502
Contact:

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
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

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.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

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

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

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

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.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

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
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

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.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

Xavi92
Verified
C Programming Expert
C Programming Expert
Posts: 161
Joined: Oct 06, 2012
PlayStation Model: SCPH-5502
Contact:

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: Jun 24, 2017

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
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

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...
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest