HI, Excellent tutorial but where can I find the toolchain in which webpage
ThakU
Lesson 01
Setting up the Development Environment
How to get the toolchain and PSPSDK up and running with CYGWIN on a windows machine. The complete newbie's guide.
This is the first installment in a series of tutorials focussed on getting a novice programmer well on his way to developing his own homebrew applications for the Sony Playstation Portable (PSP). If you are reading this, congratulations, you have hurdled one of the biggest obstacles for a programmer. Likely the most difficult thing about programming is getting started. Well, by starting to read this tutorial, you are well on your way.
The first step to creating your own program is getting your environment set up. This environment is how you will convert the source code you write into a compiled file formatted for execution on you PSP. We will be setting up two important tools on our system.
The first of these tools is called CYGWIN. It is basically a Linux emulator for windows. It will create a simulated Linux environment on your computer so that you can run native Linux applications. This may sound intimidating, but don't worry, it's very simple to use.
The second thing you'll need is the toolchain. This is the key to programming for the PSP. It will set up everything you need, from header files, to libraries, to the compiler itself, to the sample programs. Once you have this installed, you will be nearly ready to create your first program.
Now for the part we've all been waiting for: the installation.
The first step is to install CYGWIN. You can download the install file from the CYGWIN website here. After it has finished downloading, open up the executable. You will see a splash screen; click next. Now you will be asked what you want to do. Select the default option of "Install from Internet," and hit the next button. Now you will be prompted where you want to install CYGWIN. Change the install directory to "C:/cygwin" if it is not set as such already (where C: is your local hard drive). Leave the other options set to their defaults and hit next. Now you will be asked where you want to save the installation files. What you select here doesn't really matter, but I suggest putting them someplace where you will be able to find them and delete them after the installation is complete. Once you have selected a suitable location, click next. The next screen will ask about your network settings, if you don't use a proxy (or don't know what a proxy is), just click next on this screen. If it doesn't work, go back and try letting it use Internet Explorer's settings. Now you should be presented with a list of servers to download the installation files from. Any one of these will do, so select one, and then click on next. Now it will download the package list, this could take a few minutes, depending on your connection speed. Once it is done, click on "view" at the top to view the packages available for you to install. You will need the following:
autoconf2.1
automake1.9
gcc
gcc-g++
make
patchutils
subversion
wget
You can select them by clicking where it says "skip." "Skip" should then change to a version number. Don't worry if other packages are selected; packages that are required by CYGWIN or by other packages you select will be automatically set to install. When you are finished, click next. CYGWIN will now download and install the selected packages. This will quite possibly take a while, so go watch a TV show or do some web surfing while you wait. After the install has finished, you are ready to install the toolchain.
Now, we are going to install the toolchain into our CYGWIN environment. To set up our environment, we will need to run CYGWIN first. So, either from the start menu, or from "C:/cygwin," run a CYGWIN bash shell (cygwin.bat). This will open up a command line. Once you see "yourusername@yourcomputername ~" you may close the window; your environment has successfully set up. To download the latest toolchain, go here. It should be at the very bottom of the page. At the time of writing, the latest toolchain file is dated 20050725. Download this file. When it is finished, use Winrar to extract the file contents to "C:/cygwin/home/user," where "user" is your username.
The toolchain needs a bit of customization to work with CYGWIN, so fire up Wordpad, and open "C:/cygwin/home/user/psptoolchain/toolchain.sh" and do a "Find and Replace" to replace all instances of "gmake" with "make" and all instances of "gpatch" to "patch" and then save the file. Now it's time to install, so open up your CYGWIN bash shell again. Now it's time to introduce you to the Linux command line. You should see a "$" at the beginning of the line. This means that you are running the shell in user mode, as opposed to root (or admin) mode. This is of little importance in CYGWIN, but if you ever use an actual Linux command line, this is an important thing to notice.
We now need to change directories to where we extracted the toolchain. Type "ls" in the bash shell; this stands for list. It will give us an output of all of the files in our current directory (this is similar to "dir" in a Windows command line). Now you should see a folder named "psptoolchain," this is where we want to go. So type "cd psptoolchain" and hit enter. CD stands for change directory, and it will (obviously) switch the current operating directory). Now do a quick "ls" again, and you will see the files in this folder. The one that we want is "toolchain.sh." To execute this file, type "./toolchain.sh" and hit enter. In Linux, "." means the current directory, and ".." means the parent directory, so this command means to execute "toolchain.sh," which is in the current directory. The toolchain.sh script will do the rest, for you. This can take up to several hours, depending on the specifications of your machine. For a frame of reference, my 3.0GHz Pentium 4 took about three hours to run the entire script, so be patient.
Now for the last step. We have to tell CYGWIN where it can find the PSPSDK (which the toolchain just installed) and the toolchain. To do this, we need to change "C:/cygwin/cygwin.bat" to include the paths. So, close CYGWIN, and navigate Explorer to "C:/cygwin" and right click on cygwin.bat. Select "Edit" and a Notepad window should appear with the following:
@echo off
C:
chdir C:\cygwin\bin
bash --login -i
Change this to:
@echo off
C:
chdir C:\cygwin\bin
set path=%path%;C:/cygwin/usr/local/pspdev/bin
set PSPSDK=C:/cygwin/usr/local/pspdev
bash --login -i
Now you're ready to go! If you have source code that you want to compile, go into that directory with "cd" and type "make" and it should give you an eboot.pbp that you can put on your PSP. If not, check out Lesson 02 to learn how to create your own simple application for the PSP.
If you have enjoyed this tutorial and have a spare buck or two, please consider donating to the author.
Tutorial written by Brad Dwyer (aka Yeldarb). Copyright 2005.
HI, Excellent tutorial but where can I find the toolchain in which webpage
ThakU
http://milhouse.blogsome.com/
They have a real nice program. 43 meg but it at least has a nice help menu on the comand functions you select.
Perfect programming windows envio for the PSP
auto ajustable Window of projects In addition this version brings all the necessary one to be able to begin to program, since this distribution is made up of: - PSPide C++ 1.0.8.30: IDE of development for PSP - PSPsdk Beta 1.0: SDK of PSP created by scene - Kxploit 0.3: Creator of "licenses" to be able to execute programs in PSP.
MIRROR OF UNLOADINGS (Installation of 45 Mb): 1. From www.MegaUpload.com 2, From www.PSPupdates.com
http://ps2dev.org/psp/Tools
is where to get the toolchain. the time it takes to execute toolchain.sh is dependant on your internet connection speed, not your processor speed. eta 13 minutes for me on 1mbit/sec broadband with bittorrent and messenger on the go
so far so good with this tutorial.... cant wait till suse 10.0 is released so i can get in to real linux again, i have been waiting for it for ages.
edit: maybe i spoke too soon, it seems it is dependant on cpu power too
Downloading it and setting it up are different. If you're having trouble telling the difference between the two... sorry.
Hi, I'm new to PSP development, so I hope you guys can give me some help. I followed the above instructions and successfully installed CYGWIN with the necessary components. I then proceeded to run the cygwin bash shell (cygwin.bat). After that, I tried to look for the /home/user directory but I couldn't find it.
I ran the bash shell again to see the path that it starts up in and found that it's in C:\Documents and Settings\myname\ instead.
Did I do something wrong?
In any case, I proceeded to copy the psptoolchain directory into C:\Documents and Settings\myname\ and started the toolchain.sh script. It seems to run fine... after 2 hours, it suddenly stopped with the following errors:
./toolchain.sh: line 239: cd: pspsdk: No such file or directory
./toolchain.sh: line 242: ./bootstrap: No such file or directory
ERROR RUNNING PSPSDK BOOSTRAP
P/S: I am installing on a Windows XP SP2 machine and cygwin net release setup program version 2.510.2.2
Any help with this is very much appreciated. Thank you.
Edited: After researching on the error, it appears to me that my internet connection might be blocking svn access. I'll try again when I get home. Thanks.
Regards,
chronos
http://forums.ps2dev.org/viewtopic.p...451a28e4d0b44c
(re)install automake and autoconf
That's the forum you might consider going to for pspsdk related stuff.
Hah, the first time I downloaded this it was connecting at 2KBps... Then after waiting two days it stopped all together. Man was I pissed. I tried again a few minutes ago... and it finished under 30 seconds. The point of this post? If you're connecting at less than 40Kps, cancel and try again.
awesome guide!
just thought i'd add a few things i had trouble with...
1. error messages (something about "flex");
i ran the cygwin setup again and installed the flex package.
2. toolchain.sh script wouldn't download files from ftp sites (probably firewall); so i downloaded through web browser (filenames & versions need be same as in toolchain.sh) and placed files in /home/user directory. After this i ran the toolchain again but used "./psptoolchain/toolchain.sh -b-g-n-p" as this will skip trying to re-download the files and go straight to installing them.
3. half-way thru installing binutils/gcc/etc i got fatal error messages; needed to move the 4 .patch files from psptoolchain folder to /home/user directory.
after this i managed to get it installed, with no fatal error messages.
heya
ive been trying to install this, i have gotten a few errors and used google to fix them but i cant find anything on this "error building newlib"
any help would be appreciated
thx in advance
i finally git i tto work, what i did was reinstall the toolchain from scratch
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks