forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tutorial: How to setup a ps2dev env in cygwin
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Fri Jan 07, 2005 10:11 pm    Post subject: Tutorial: How to setup a ps2dev env in cygwin Reply with quote

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


Last edited by Lukasz on Tue Dec 13, 2005 7:12 am; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Mon Jan 10, 2005 9:31 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Mon Jan 10, 2005 10:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Mon Jan 10, 2005 11:14 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Tue Jan 11, 2005 7:44 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Tue Jan 11, 2005 10:09 pm    Post subject: Reply with quote

fucking nice work :)
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
evilo



Joined: 22 Apr 2004
Posts: 230

PostPosted: Tue Jan 11, 2005 11:04 pm    Post subject: Reply with quote

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 !
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Thu Jan 13, 2005 5:49 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
fr0st m0nkey



Joined: 30 Jan 2005
Posts: 10

PostPosted: Sat Feb 05, 2005 3:12 pm    Post subject: Reply with quote

Do you think it would be possible if you showed us how to set up the PS2 Debugger through Cygwin?

PS2 Debugger
Back to top
View user's profile Send private message Visit poster's website AIM Address
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sat Feb 05, 2005 4:10 pm    Post subject: Reply with quote

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.
Quote:
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".
Back to top
View user's profile Send private message
fr0st m0nkey



Joined: 30 Jan 2005
Posts: 10

PostPosted: Sun Feb 06, 2005 4:37 am    Post subject: Reply with quote

When I tried to install this, I got this:
Code:

wget: not found
Error: Please make sure you have 'wget' installed.


What should I do?
Back to top
View user's profile Send private message Visit poster's website AIM Address
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sun Feb 06, 2005 4:52 am    Post subject: Reply with quote

Install wget... ? duh
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
Kotti



Joined: 01 Feb 2005
Posts: 3
Location: Kansas

PostPosted: Mon Feb 07, 2005 5:50 am    Post subject: Reply with quote

Why do I get a Permission Denied Error when I try to run the autobuild script?
Back to top
View user's profile Send private message
fr0st m0nkey



Joined: 30 Jan 2005
Posts: 10

PostPosted: Mon Feb 07, 2005 6:07 am    Post subject: Reply with quote

How do I make a link?

Quote:

2. Make a link with "ln -s mips64r5900-sf-elf-gdb.exe ee-gdb.exe" and you should be ready to go.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Mon Feb 07, 2005 6:51 am    Post subject: Reply with quote

fr0st m0nkey wrote:
How do I make a link?

Quote:

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"
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
fr0st m0nkey



Joined: 30 Jan 2005
Posts: 10

PostPosted: Tue Feb 08, 2005 9:48 am    Post subject: Reply with quote

Do you mean type that in? It doesn't work for me when I try to type that out.
Back to top
View user's profile Send private message Visit poster's website AIM Address
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Fri Mar 04, 2005 12:24 am    Post subject: Reply with quote

the link needs to be in the dir with the file (the bin dir which is on the path in cygwin at least)
Back to top
View user's profile Send private message
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sun Mar 13, 2005 7:52 pm    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
Thanhda



Joined: 09 Apr 2005
Posts: 331
Location: Canada

PostPosted: Mon Apr 25, 2005 3:34 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Mon Apr 25, 2005 5:57 am    Post subject: Reply with quote

Ive updated the toolchains, read more at www.lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Mon Apr 25, 2005 7:08 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Steve F



Joined: 27 Apr 2005
Posts: 75
Location: Texas USA

PostPosted: Fri May 13, 2005 2:16 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Compound



Joined: 12 May 2005
Posts: 48

PostPosted: Fri May 13, 2005 3:57 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message MSN Messenger
Steve F



Joined: 27 Apr 2005
Posts: 75
Location: Texas USA

PostPosted: Fri May 13, 2005 9:01 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Mon May 16, 2005 5:08 am    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message Visit poster's website
Steve F



Joined: 27 Apr 2005
Posts: 75
Location: Texas USA

PostPosted: Thu May 19, 2005 6:45 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri May 20, 2005 2:02 am    Post subject: Reply with quote

It certainly looks that way to me.
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sat May 21, 2005 2:43 am    Post subject: Reply with quote

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:
# 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
Back to top
View user's profile Send private message
snowdog



Joined: 15 Jun 2005
Posts: 5

PostPosted: Wed Jun 15, 2005 8:51 am    Post subject: Reply with quote

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/
_________________
"You can keep all your Bests, Peles and Maradonas, Duncan Edwards was the greatest of them all!" - Tommy Docherty
Back to top
View user's profile Send private message
snowdog



Joined: 15 Jun 2005
Posts: 5

PostPosted: Thu Jun 16, 2005 9:56 am    Post subject: Reply with quote

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)
_________________
"You can keep all your Bests, Peles and Maradonas, Duncan Edwards was the greatest of them all!" - Tommy Docherty
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group