Page 1 of 3

Tutorial: How to setup a ps2dev env in cygwin

Posted: Fri Jan 07, 2005 10:11 pm
by Lukasz
Update #2
I've now written a full tutorial on how to install the toolchains in cygwin using toolchain.sh. http://ps2dev.lukasz.dk/cygwintutorial.html


Updated - No longer supported

This small tutorial will show you how to setup a ps2dev env in cygwin.

First of all you need to install cygwin with http://www.cygwin.com/setup.exe.

Now download this file http://cygwin.lukasz.dk/cygwin-toolchain.sh and save it in a directory in cygwin (home dir for instance) and now log into cygwin and change to the directory where you have downloaded the file to and type ./cygwin-toolchain.sh (use TAB for autocompletion). This script does not compile anything, it just downloads and extracts the binaries.

This script will now download and install the ps2dev (ee toolchain, iop toolchain, dvp toolchain, ps2sdk CVS build and ps2client) env and setup the necessary env vars ($PS2DEV, $PS2SDK and change $PATH).

Its all installed in /usr/local/ps2dev and you can test it by typing 'ee-gcc -v' and you will see that ee-gcc is installed. I've tested the script and everything should be working.

If any one wants to use this script for other systems or if they want to mirror the toolchains, please see the cygwin-toolchain.sh for instructions.

Old cygwin setup files
For those interested in how to make setup files which can be used with setup.exe from cygwin.com. You can grab those files here:
http://www.lukasz.dk/files/setup.bz2
http://www.lukasz.dk/files/setup.ini

Posted: Mon Jan 10, 2005 9:31 pm
by cory1492
LOL this looks too easy...

edit:
I just did this update it from a clean cygwin + cygwin/x install and here is what I learned:
-make sure you log into cygwin at least once so it creates your home dir
-for whatever reason it showed all packages like I was doing the install from scratch (except the stuff I installed were marked keep instead)

When I tried to add this in on a clean install I wound up with a unhandled Win32 exception from setup.exe with the following in the cygwin setup window:
Installing
dvp-2.14-041130
/etc/postinstall/dvp-toolchain.sh
package: 0%
Total 25%
(approx. values of the progress bars)

perhaps I have left out some vital package on my install like sh or something but I doubt it...

Posted: Mon Jan 10, 2005 10:46 pm
by Lukasz
Thanks for your response.

For postinstall all you should need is echo, sh and grep, since thats what I use in the postinstall script.

Its best to update/clean install your cygwin with these utils and then install the provided packages. Could look like my packages get installed before the utils mentioned above get installed/updated and therefor setup.exe crashes.

Posted: Mon Jan 10, 2005 11:14 pm
by cory1492
setup.exe is crashing on each of the individual packages (which I only tried to install once I made sure cygwin was working fine) when it gets to the etc/sh file, even though I have the commands echo, sh and grep installed.

I tried reinstalling cygwin again, and doing the packages agian, but the only way I have been able to get them to add the PATH is to extract the .sh file and sh file.sh (run) it directly from bash. (all the toolchain files extracted into their dirs just fine, but the sh + setup.exe is what seems to be causing the problem here)

Im stumped, about the only thing that I did differently is that I used the newest setup from cygwins site, perhaps something got broken in their last update of it with relation to the etc files?

I like the idea though of not having to build the entire toolchain whenever it is updated (although oopo's work helps to fix that) so this is great anyways.

After running the .sh files I get (to ee-gcc -v : gcc version 3.2.2 but just an error before the PATH was appended)

Edit: justaboutforgot to mention - Thanks Lukasz for your work on this!

Posted: Tue Jan 11, 2005 7:44 am
by Lukasz
Your problems got me thinking that it maybe be best to not use setup.exe because I myself also had problems with setup.exe crashing when I was creating the setup files. And setup.exe isn't meant to be customized and why would I want to depend on a system which does nothing more than download and extact some files and run a simple script.

Therefor I've decided to not use setup.exe, but instead I've made a cygwin-toolchain.sh which does the same, download and extract and setup the ps2dev env.

I will be uploading the script and new .tar.gz files in some 10 hours time or so and I will also rewrite the tutorial. I will also make the files I've used to make the whole setup it "work" with setup.exe avaliable, if others what to pursue this direction. Until then, I will just leave everything, in case some one is already downloading or want to download.

Posted: Tue Jan 11, 2005 10:09 pm
by blackdroid
fucking nice work :)

Posted: Tue Jan 11, 2005 11:04 pm
by evilo
Wonderfull !!!

I remember having installed the whole stuff manually including the toolchain... I was still afraid to have to do it again (as it took me 2 days to get the whole thing running and most of all being able to compile shtg correctly...)

thx !

Posted: Thu Jan 13, 2005 5:49 pm
by cory1492
Nice one Lukasz, works great & thanks.

edit: just out of curiosity, would it be better to put the env. vars into a users .bashrc instead of the global bash.bashrc?

Posted: Sat Feb 05, 2005 3:12 pm
by fr0st m0nkey
Do you think it would be possible if you showed us how to set up the PS2 Debugger through Cygwin?

PS2 Debugger

Posted: Sat Feb 05, 2005 4:10 pm
by cory1492
fr0st:
from the readme included with it, note the first line I put here. I personally would like to see a better open debugger (or an emulator+debugger for pc). Wouldnt it be nice to get a hold of the open source code from the official SCE dev pack? I think so.
This is only a proof of concept build, hacked up mercilessly, see the disclaimer.

I've insterted debug printfs too, making it ugly. To use, do the following:-

1. Copy mips64r5900-sf-elf-gdb.exe to you ee/bin folder (e.g. on my system it's c:\cygwin\usr\local\ps2dev\ee\bin).
2. Make a link with "ln -s mips64r5900-sf-elf-gdb.exe ee-gdb.exe" and you should be ready to go.

There's a ps2.cmd command file there to try out. It loads the stub, inserts a breakpoint and continues execution to that
breakpoint. Launch with "ee-gdb -x ps2.cmd".

Posted: Sun Feb 06, 2005 4:37 am
by fr0st m0nkey
When I tried to install this, I got this:

Code: Select all

wget: not found
Error: Please make sure you have 'wget' installed.
What should I do?

Posted: Sun Feb 06, 2005 4:52 am
by pixel
Install wget... ? duh

Posted: Mon Feb 07, 2005 5:50 am
by Kotti
Why do I get a Permission Denied Error when I try to run the autobuild script?

Posted: Mon Feb 07, 2005 6:07 am
by fr0st m0nkey
How do I make a link?
2. Make a link with "ln -s mips64r5900-sf-elf-gdb.exe ee-gdb.exe" and you should be ready to go.

Posted: Mon Feb 07, 2005 6:51 am
by Drakonite
fr0st m0nkey wrote:How do I make a link?
2. Make a link with "ln -s mips64r5900-sf-elf-gdb.exe ee-gdb.exe" and you should be ready to go.
with "ln -s mips64r5900-sf-elf-gdb.exe ee-gdb.exe"

Posted: Tue Feb 08, 2005 9:48 am
by fr0st m0nkey
Do you mean type that in? It doesn't work for me when I try to type that out.

Posted: Fri Mar 04, 2005 12:24 am
by cory1492
the link needs to be in the dir with the file (the bin dir which is on the path in cygwin at least)

Posted: Sun Mar 13, 2005 7:52 pm
by cory1492
Here is a small script based on ooPos script that will update&reinstall the PS2SDK to whatever is currently in the cvs, of course you need cvs and make installed in cygwin to use this script.

ps2sdkupdate.sh
just download it, put it in your cygwin dir and run it with "sh ps2sdkupdate.sh"

Posted: Mon Apr 25, 2005 3:34 am
by Thanhda
cory1492 wrote:Here is a small script based on ooPos script that will update&reinstall the PS2SDK to whatever is currently in the cvs, of course you need cvs and make installed in cygwin to use this script.

ps2sdkupdate.sh
just download it, put it in your cygwin dir and run it with "sh ps2sdkupdate.sh"
says error building, do i need to install the ps2dev sdk first into the home/ dir?

Posted: Mon Apr 25, 2005 5:57 am
by Lukasz
Ive updated the toolchains, read more at www.lukasz.dk

Posted: Mon Apr 25, 2005 7:08 pm
by cory1492
nice one lukasz, thanks! I updated my script up above today as well, to clean out the old sdk dirs (but leave ports dirs intact) but I imagine yours is better.

Posted: Fri May 13, 2005 2:16 pm
by Steve F
Hey Lukasz,

I followed the instructions at the beginning of the post. Didn't work. Took awhile to figure out there was some manual setup required and the instructions were listed elsewhere. (use-newiop.sh or use-oldiop.sh and setting up the symlinks /bin/mkdir -> /bin/cyg-mkdir, ...rmdir, and echo.

Would it be a good idea to put a message at the end of cygwin-toolchain.sh stating there are more things to do or actually list the remaining settings needed?

Thanks, I appriciate not having to fiddle for days or weeks. Besides the download time for cygwin it only took about an hour to get to the ps2sdk-update.sh part and that is still running (so far without any errors).

Posted: Fri May 13, 2005 3:57 pm
by Compound
there should be no manual setup required, the only thing i did have to do was set an enviroment variable (in mycomp->properties) PS2DEV C:\cygwin\usr\local\ps2dev.

Posted: Fri May 13, 2005 9:01 pm
by Steve F
Well, the symlinks could be setup from the script. Choosing new or old iop would have to be a prompt or at least a message saying what to do, why and how.

Posted: Mon May 16, 2005 5:08 am
by Lukasz
For the next update of the toolchain I will include a readme on how to use the toolchain after install and also make more of the process automatic, like calling the ps2sdk-update and use-oldiop script at the end of the toolchain script.

Thanks for the feedback guys :)

Posted: Thu May 19, 2005 6:45 pm
by Steve F
I set up cygwin. I ran cygwin-toolchain.sh. Then in ps2dev/bin I ran use-oldiop.sh. When I tried to run ps2sdk-update.sh it fails with cannot cd to ps2sdk. I found in the script two lines commented out;

## Remove any previous builds.
# rm -Rf ps2sdk

## Check out the latest source.
# cvs -d $CVSROOT checkout ps2sdk

## Enter the source directory.
cd ps2sdk

The 'cd ps2sdk' fails because the cvs never runs?

Posted: Fri May 20, 2005 2:02 am
by ooPo
It certainly looks that way to me.

Posted: Sat May 21, 2005 2:43 am
by cory1492
Thanhda wrote:
cory1492 wrote:Here is a small script based on ooPos script that will update&reinstall the PS2SDK to whatever is currently in the cvs, of course you need cvs and make installed in cygwin to use this script.

ps2sdkupdate.sh
just download it, put it in your cygwin dir and run it with "sh ps2sdkupdate.sh"
says error building, do i need to install the ps2dev sdk first into the home/ dir?
You need the ee/iop toolchain installed and the paths setup to them properly to have access to ee-gcc and iop-gcc or the SDK will not build. If you already do have such done, then let me know the specific error and I will see if I can figure out why its happening (although ooPo and Pixel are MUCH better at that sort of thing than I am)

lukasz has prebuilt binaries of the toolchain and on a new install with his it wasn't always the most recent release of the SDK - BUT he has since incorporated this idea, so see his website for his toolchain/sdk builder.

I use it to refresh/rebuild my SDK, cleaning up all the garbage first so everything is new (except the ports)

compound: if you are using cygwin you can also set cygwin only environment vars in your homedir's .bashrc or in /etc/bash.bashrc instead of cluttering you path in windows.

this is what the inside of my bash.bashrc file under cygwin looked like before I moved on to debian:

Code: Select all

# base-files version 3.2-1

# System-wide .bashrc file
## ps2dev env vars
export PS2DEV=/usr/local/ps2dev
export PS2SDK=$PS2DEV/ps2sdk
export PATH=$PATH:$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin

Posted: Wed Jun 15, 2005 8:51 am
by snowdog
pixel wrote:Install wget... ? duh
I got the same error message as fr0st. Haven't used Unix for around 15 years! Where do we find wget and how do we install it? :o/

Posted: Thu Jun 16, 2005 9:56 am
by snowdog
Doh!!! Just realised my mistake! Just had everything set to default, changed it to Install for everything. Shouldn't have any more problems now hopefully ;o)