Setup a build environment for compiling and running homebrew for PS3
This the first of a series of articles I’ll write with the intent of build Scogger for PS3. Hope to finish this work before 2012.Last update 22-jan-11 see changelog
With the breaking out of PSJailbreak this summer, the homebrew sceene didn’t wait so long to appear on Playstation3.
So we are finally talking about the possibility to run our own unsigned code, using any of the available dongles (you can even build one yourself).
The latter one is very young (project started 29-oct-10) and continously mantained, so the are chances that something may not work as you would expect.
Updating git daily, reporting bugs and contributing is appreciated :)
First of all we need to set our PS3 dev directory and some system variables, as well as all software needed to build our toolchain.
This guide is written for user with Ubuntu 10.10 32bit, but also other Linux distribution are supported, I think.
Let’s start from software needed to build the toolchain:
sudo apt-get install autoconf automake bison flex gcc make wget git libppl0.10-dev libcloog-ppl-dev libelf-dev libncurses5-dev texinfo build-essential libgmp3-dev python zlib1g-dev pkg-config libtool python-dev
I’ve set my PS3 dev directory to ~/dev/ps3
mkdir -p ~/dev/ps3
Add these lines at the end of ~/.bashrc for setting needed system variables
export PSL1GHT=$PS3DEV/psl1ght export PATH=$PATH:$PS3DEV/bin:$PS3DEV/host/ppu/bin:$PS3DEV/host/spu/bin:$PSL1GHT/host/bin
Update bashrc for apply changes:
Installing the ps3toolchain toolchain
Let’s clone ps3chain git repository:
cd $PS3DEV git clone git://github.com/ooPo/ps3toolchain.git
Execute the automated script frorm the ps3toolchain directory just cloned:
cd ps3toolchain ./toolchain.sh
Have a loooooong break, then if you don’t see any error you can say to all your friends that the toolchain is installed :)
Installing the ps3chain toolchain (alternative to ps3toolchain, not supported right now)
Let’s clone ps3chain git repository:
cd $PS3DEV git clone git://github.com/HACKERCHANNEL/ps3chain.git
Execute the automated script frorm the ps3chain directory just cloned:
cd ps3chain ./buildit.sh all
Installing the PSL1GHT SDK
Update: This step is no longer needed, as ps3toolchain install psl1ght also.
Now clone the psl1ght git repository:
cd $PS3DEV git clone git://github.com/HACKERCHANNEL/PSL1GHT.git
Add these lines at the end of ~/.bashrc for setting needed system variables:
Build and install it:
cd $PS3DEV/PSL1GHT/psl1ght make make install
That’s all! :)
Compiling external libraries (libpng, zlib…)
Update: This step is no longer needed, as ps3toolchain install external libraries too.
We need to checkout another git, containing libs and patches for make them (almost) functional on a PS3 dev environment:
- cairo (COOL)
- fontconfig, freetype
cd $PS3DEV git clone git://github.com/ooPo/ps3libraries.git cd ps3libraries/
Launch the script libraries.sh
And it will download libraries, patch them, compile, then install.
Compiling and running samples
Samples are included in PSL1GHT samples directory: I suggest to start with VideoTest.
cd $PS3DEV/ps3toolchain/build/psl1ght/samples/video/videoTest make pkg
This command will compile the application and create a .pkg file that can be installed on your jailbroken PS3.
Copy it over a USB pendrive, start the PS3 in jailbreak mode, go to “Install package files”, select your app, install and finally run it!
A nice gray to red gradient screen will appear, press X to exit.
The above process is fine, but a bit slow. There is a smart way though: compile and launch via wifi using ps3load.
Ps3load is a tool like Nintendo Wii Wiiload that let us launch executables over the network.
First of all set this environment variables as we did with other ones, specifying your PS3 ip address (for example 192.168.0.10):
Compile and install ps3load under network/ps3load directory, just like the previous videoTest.
Please note: since it uses zlib you need to compile the above ps3libraries otherwise you’ll get compilation errors!
Once loaded on PS3 you’ll be welcomed (at least for now) with a nice black screen: this is normal.
You can now compile other samples with usual make command, then run over the network with:
A lot easier, uh?
You can start your own “hello world” program using the template under $PS3DEV/ps3toolchain/build/psl1ght/template directory.
Here it is mine (using libpng):
Trap15, ooPo, Aaron, Seigher and others for ps3toolchain, ps3chain and ps3libraries
AerialX, phiren, MattP and others for PSL1GHT and suggestions :)
- 22-jan-11: new paths required by psl1ght, no longer ps3libraries and psl1ght manual compilation, support for new build path
- 13-dec-10: Added python-dev dependence thanks to Cyberw0rm
- 22-nov-10: using ooPo’s ps3toolchain instead of ps3chain: it is updated and let me build ps3load
- 21-nov-10: added other packages to prerequisites, thanks to KDSBest