Best ps2linux based development environment ?
Best ps2linux based development environment ?
I am gearing up to do some major porting. My plan is to do
some initial porting work in ps2 linux, and then when I am
far enough along, work on making the app native.
The question is, what is the best environment for ps2linux ?
There is the stock ps2linux distribution, there is the BlackRhino
updated kernel and distribution, and then there is the newer
Sony BB 2.4.x kernel. Actually, I don't want to use the stock
environment, but would like to know what else is better
recommended.
My needs are a decent gcc and binutils that supports all 5900
instructions, which mrbrown magnificently provides. What is
the best underlying environment and kernel for these tools ?
Gorim
some initial porting work in ps2 linux, and then when I am
far enough along, work on making the app native.
The question is, what is the best environment for ps2linux ?
There is the stock ps2linux distribution, there is the BlackRhino
updated kernel and distribution, and then there is the newer
Sony BB 2.4.x kernel. Actually, I don't want to use the stock
environment, but would like to know what else is better
recommended.
My needs are a decent gcc and binutils that supports all 5900
instructions, which mrbrown magnificently provides. What is
the best underlying environment and kernel for these tools ?
Gorim
Use xRhino 2.2.21 and the BlackRhino distribution. As far as GCC and binutils, you have a choice: the GCC/binutils shipped with the kit are "stable" but crappy (W.R.T. code generation). You could use binutils 2.13.2.1 and GCC 3.0.4 instead, but few people use these so if something goes wrong you won't get much support.
Thanks for the great info. Actually, I had poor luck with the stockmrbrown wrote: You could use binutils 2.13.2.1 and GCC 3.0.4 instead, but few people use these so if something goes wrong you won't get much support.
PS2Linux version of the assembler - it didn't like EE 128bit MMI
instructions, but when I installed the 2.13.2.1 last night, the assembler
had no problems. Unfortunately, the resulting executable wouldn't
work, but I expected that from previous forum posts. I will try
getting xrhino/blackrhino up and running with the newer binutils and
gcc and see how the whole picture works out.
Thanks again!
Gorim
Could you provide me with some info about that?gorim wrote:but when I installed the 2.13.2.1 last night, the assembler
had no problems. Unfortunately, the resulting executable wouldn't
work, but I expected that from previous forum posts.
I am currently looking into differences between gas 2.9ee and gas 2.14.
If you want to use gas 2.14 (dit not look into 2.13.2.1) you have to add -mabi=32. Could you try that?
ldesnogu wrote:Could you provide me with some info about that?gorim wrote:but when I installed the 2.13.2.1 last night, the assembler
had no problems. Unfortunately, the resulting executable wouldn't
work, but I expected that from previous forum posts.
I am currently looking into differences between gas 2.9ee and gas 2.14.
If you want to use gas 2.14 (dit not look into 2.13.2.1) you have to add -mabi=32. Could you try that?
Sure,
It was a simple experiment. I created a simple C program that
did a simple "C= A + B" on register variables. I used GCC -S
to create assembler output. The actual output wasn't relevant,
I just wanted something where I could quick edit it and insert
a MMI instruction to see if the assembler would grok it. Sorry I
can't cut and paste it right now, but essentually I inserted
PADDSW $2,$3,$4 or something like that.
The gas that came with the linux kit didn't like it, but then I
installed the newer and patched (specifically for EE) binutils
provided by mrbrown and the assembler took it just fine. The
resulting executable wasn't runnable, but as mentioned, it was
an expected result. I first wanted to know which assemblers
would understand MMI, and then I would install my development
environment/toolchain around that.
Hope that helps,
Gorim
IIRC you already documented that in your PS2 binutlis release.mrbrown wrote:Yes, but -mabi won't fix the problem with missing instructions, only -mips3 and -mcpu will.
-mabi does not only change the calling convention, it seems to also change gp_rel stuff, wich makes me guess it *may* have a positive impact on the dynamic linking problems you found: on a stupid test I did, using the old ld (called by old gcc collect2), the generated exec looks very similar.-mabi only deals with calling conventions.
They are not identical because of the way the more recent binutils generate code for la encoding to deal with offsets bigger than 16 bits for PIC.
My ps2linux kit is in a box, so I can't make any further tests, so I thought gorim was an ideal guinea pig :)
Note I may be completely off on that topic...
i would also like to use some multimedia instructions since i have some programs for PC which use MMX which i want to port to PS2, but i have problems to find any info or examples about MMI on the EE (am already searching for about two weeks).
does anyone have some links to maybe just a list of instructions or some macros or examples how to implement MMI?
thanks ;)
does anyone have some links to maybe just a list of instructions or some macros or examples how to implement MMI?
thanks ;)
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
-
- Posts: 51
- Joined: Sat Apr 03, 2004 10:22 am
Re: Best ps2linux based development environment ?
Well, there are 3 different Linux based systems which can be installed on the PS2 thru the Linux kit which are:
BlackRhino Linux:
http://blackrhino.xrhino.com/main.php?page=home
Gentoo Linux for PS2:
http://dev.gentoo.org/~kumba/mips/ps2/gentoo-ps2/
Netbsd for PS2:
http://www.netbsd.org/Ports/playstation2/ . Unfortuntly, Netbsd for PS2 doesn't have support for the game controller, Audio , i.LINK, Memory Card & DVD/CD-ROM drive.
BlackRhino Linux:
http://blackrhino.xrhino.com/main.php?page=home
Gentoo Linux for PS2:
http://dev.gentoo.org/~kumba/mips/ps2/gentoo-ps2/
Netbsd for PS2:
http://www.netbsd.org/Ports/playstation2/ . Unfortuntly, Netbsd for PS2 doesn't have support for the game controller, Audio , i.LINK, Memory Card & DVD/CD-ROM drive.
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
Re: Best ps2linux based development environment ?
Ill just have to state the obvious *BSD is not a "Linux based system" if at all it could be said the other way around.EugeneE3RD wrote:Well, there are 3 different Linux based systems which can be installed on the PS2 thru the Linux kit which are:
Netbsd for PS2:
http://www.netbsd.org/Ports/playstation2/ . Unfortuntly, Netbsd for PS2 doesn't have support for the game controller, Audio , i.LINK, Memory Card & DVD/CD-ROM drive.
/disgruntled BSD user.
Kung VU
Sorry no. I didn't have a chance to try the binutils release youldesnogu wrote:Did you try to use -mabi=32 as I suggested?gorim wrote:The
resulting executable wasn't runnable, but as mentioned, it was
an expected result.
suggested. I would like to try soon, but I am actually on vacation
and only sneak to ps2dev or my ps2 as my wife allows.
I hope to be able to spend this coming weekend setting up my
dev environment and test more things.
Gorim
Ok, I have used those flags with the stock ps2linux gcc in combo withmrbrown wrote:He needs to use -mips3 and/or -m5900. The equivalent to -m5900 is -mcpu=5900 or -mcpu=r5900, IIRC.
your newer patched binutils. The problem I am having is that the
gcc does not appear to output double-word arithmetic instructons
for add/sub if I *do not* used -mips3. On the other hand, if I use
-mips3, not only will it output the double-word add/sub, it will
output double-word mult, the latter of which is unsupported in the EE.
Am I missing some options on the stock compiler, or should I assume
that updating the compiler to the more recent patched one you
provide should solve the problem ?
On the other hand, the linker absolutely chokes on any object file
compiled with -mips3 and/or -mabi=64.
Gorim
Your best bet is to acquire the Linux kit. The accompanying DVD romsSaotome wrote: does anyone have some links to maybe just a list of instructions or some macros or examples how to implement MMI?
thanks ;)
include the entire EE instruction set reference in PDF, which is invaluable
if you want to do ANY MMI coding.
Or, as others suggested, you can paw through patched binutils code
and derive the instruction descriptions that way, which is the hard way.
No doubt they chuckled on making those suggestions :)
Gorim
Yeah, your mistake in thinking it was me he was responding to, butmrbrown wrote:Yeah, sorry I was thinking it was gorim, who I assume has the manuals since he's porting stuff to the Kit. My mistake.blackdroid wrote:yeah but it doesnt seem like he has the manuals, now does it ? :)
not mistaken that I do have the manuals. :)
Gorim
actually i dont have enough money to afford the linux kit at the moment, and i dont want to acquire the linux kit just to do some MMI coding ;)gorim wrote: Your best bet is to acquire the Linux kit. The accompanying DVD roms
include the entire EE instruction set reference in PDF, which is invaluable
if you want to do ANY MMI coding.
but maybe anyone knows if i can download the instruction set reference somewhere? i already found an "EE Core User's Manual" via google, but the link doesnt work.
actually i already had a look at the instruction descriptions and it doesnt really look that hard ;) i'm used to that kind of work because its similar to how i began with MMX when i didnt have a mmx-compilergorim wrote: Or, as others suggested, you can paw through patched binutils code
and derive the instruction descriptions that way, which is the hard way...
I finally dug out my PS2 to test what I told. The poor beast had been off since last June...
My silly stupid program is:
Impressive heh ? :)
I then used the following Makefile (sorry it's even dumber than the .c file and is for cross compilation):
Nothing complex as you can see.
And the PS2linux happily ran both simple-old and simple-newas.
Some notes:
- the execs are dynamically linked
- the linker used is the old one
- to make large scale tests one should change gcc spec file.
Time to move on to something more complex, as this does not prove much from my point of view.
Next step is to build a dynamically shared library...
My silly stupid program is:
Code: Select all
#include <stdio.h>
int main(int argc, const char *argv[])
{
fprintf(stderr, "Was here\n");
return 1;
}
I then used the following Makefile (sorry it's even dumber than the .c file and is for cross compilation):
Code: Select all
CC = /usr/local/ps2/bin/mipsEEel-linux-gcc
DEBUG = -g
CFLAGS = $(DEBUG)
LDFLAGS = $(DEBUG)
# Binutils execs
OLDAS = /usr/local/ps2/mipsEEel-linux/bin/as
NEWAS = /home/ldesnogu/Binutils/Dev/strippeddown-2.14/mybinutils-2.14/build/gas/as-new
# Flags
OLDASFLAGS = -v -mwarn-short-loop -mcpu=r5900 -KPIC -mips2 -msingle-float
NEWASFLAGS = -v -mwarn-short-loop -march=r5900 -KPIC -msingle-float -mabi=32
all: simple-oldas simple-newas
###############################################################################
# Generate execs (using gcc collects)
simple-oldas: simple-oldas.o
simple-newas: simple-newas.o
###############################################################################
# Generate .o (using as)
simple-oldas.o: simple.s
$(OLDAS) $(OLDASFLAGS) simple.s -o simple-oldas.o
simple-newas.o: simple.s
$(NEWAS) $(NEWASFLAGS) simple.s -o simple-newas.o
###############################################################################
# Generate .s
simple.s: simple.c
$(CC) $(CFLAGS) -S simple.c
###############################################################################
.PHONY: clean
clean:
rm -f simple-oldas simple-oldas.o
rm -f simple-newas simple-newas.o simple.s
And the PS2linux happily ran both simple-old and simple-newas.
Some notes:
- the execs are dynamically linked
- the linker used is the old one
- to make large scale tests one should change gcc spec file.
Time to move on to something more complex, as this does not prove much from my point of view.
Next step is to build a dynamically shared library...
And now for the shared library stuff.
Makefile
testso.h
testso.c
testso-main.c
All four generated execs behave as expected.
So did I miss anything or can we conclude that gas 2.14 can be used in place of the older one?
Makefile
Code: Select all
CC = /usr/local/ps2/bin/mipsEEel-linux-gcc
DEBUG = -g
CFLAGS = $(DEBUG)
LDFLAGS = $(DEBUG)
# Binutils execs
OLDAS = /usr/local/ps2/mipsEEel-linux/bin/as
NEWAS = /home/ldesnogu/Binutils/Dev/strippeddown-2.14/mybinutils-2.14/build/gas/as-new
# Flags
OLDASFLAGS = -mwarn-short-loop -mcpu=r5900 -KPIC -mips2 -msingle-float
NEWASFLAGS = -mwarn-short-loop -march=r5900 -KPIC -msingle-float -mabi=32
all: main-oldas-oldlib main-oldas-newlib main-newas-oldlib main-newas-newlib
###############################################################################
# Generate execs (using gcc collect2)
main-oldas-oldlib: testso-main-oldas.o testso-oldas.so
$(CC) $(LDFLAGS) -o $@ $^
main-oldas-newlib: testso-main-oldas.o testso-newas.so
$(CC) $(LDFLAGS) -o $@ $^
main-newas-oldlib: testso-main-newas.o testso-oldas.so
$(CC) $(LDFLAGS) -o $@ $^
main-newas-newlib: testso-main-newas.o testso-newas.so
$(CC) $(LDFLAGS) -o $@ $^
###############################################################################
# Generate .so (using gcc collect2)
testso-oldas.so: testso-oldas.o
$(CC) $(LDFLAGS) -shared -o $@ $<
testso-newas.so: testso-newas.o
$(CC) $(LDFLAGS) -shared -o $@ $<
###############################################################################
# Generate .o (using as)
testso-oldas.o: testso.s
$(OLDAS) $(OLDASFLAGS) -o $@ $<
testso-newas.o: testso.s
$(NEWAS) $(NEWASFLAGS) -o $@ $<
testso-main-oldas.o: testso-main.s
$(OLDAS) $(OLDASFLAGS) -o $@ $<
testso-main-newas.o: testso-main.s
$(NEWAS) $(NEWASFLAGS) -o $@ $<
###############################################################################
# Generate .s
testso.s: testso.c
$(CC) $(CFLAGS) -fPIC -S testso.c
testso-main.s: testso-main.c
$(CC) $(CFLAGS) -fPIC -S testso-main.c
###############################################################################
files.tar: main-oldas-oldlib main-oldas-newlib \
main-newas-oldlib main-newas-newlib \
testso-oldas.so testso-newas.so
tar cf $@ $^
.PHONY: clean
clean:
rm -f testso-oldas.o testso-oldas.so \
testso-newas.o testso-newas.so \
testso-main.s testso.s \
testso-main-newas.o testso-main-oldas.o \
main-oldas-oldlib main-oldas-newlib \
main-newas-oldlib main-newas-newlib
Code: Select all
#ifndef TESTSO_H
#define TESTSO_H
int shared_fn(const char *fmt, ...);
#endif /* TESTSO_H */
Code: Select all
#include <stdio.h>
#include <stdarg.h>
int shared_fn(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
return 0x1234DEAD;
}
Code: Select all
#include <stdio.h>
#include "testso.h"
int main(int argc, const char *argv[])
{
int res;
res = shared_fn("Call it with %s and %x\n", "string", 0x9876CAFE);
fprintf(stderr, "res = %x\n", res);
return 0;
}
So did I miss anything or can we conclude that gas 2.14 can be used in place of the older one?
[quote="Saotome"][quote="gorim"]
actually i dont have enough money to afford the linux kit at the moment, and i dont want to acquire the linux kit just to do some MMI coding ;)
but maybe anyone knows if i can download the instruction set reference somewhere? i already found an "EE Core User's Manual" via google, but the link doesnt work.
That link has existed for years and has always been inaccessible
(at least since the time Sony or someone told them to clam up)
Anyhow, you have some alternatives:
The kit is being sold for $99 right now, an awesome deal, but it
won't last. I am not sure they plan to produce the kit anymore.
Or maybe, now with the HD and BBA released, they could choose
to sell only the DVDs. Anyhow, checkout playstation2-linux.com.
I bought the JAP Linux DVDs off ebay 2 years ago. Someone apparently
bought that kit and split it up. Check out ebay, or playstation2-linux.com
for people who no longer want their kit, you might get a deal.
Finally, I have an extra printed copy of that manual. But I think
copyright would prevent me from sending it to you. I don't want
it anymore because its thick and cumbersome, my first printed
copy. I printed it again on A4 landscape two pages per side of
each sheet so it took less space and I can see more info at a time.
The original was merely single-page per side of each sheet. The
difference being, the latter is 2 printed pages per sheet, while the
former (newer) is 4 printed pages per sheet.
If it was legal for me to distribute a copy I printed originally for
my own personal purposes to someone else, I would be willing
to send it to you, but I will wait on the advice of others first.
Otherwise I just have to throw it away. If you already had a Linux
DVD, I could probably for sure legally give you one printed copy.
(at least, Sony probably wouldn't care if I did), but then you prob
wouldn't need my copy.
Gorim
actually i dont have enough money to afford the linux kit at the moment, and i dont want to acquire the linux kit just to do some MMI coding ;)
but maybe anyone knows if i can download the instruction set reference somewhere? i already found an "EE Core User's Manual" via google, but the link doesnt work.
That link has existed for years and has always been inaccessible
(at least since the time Sony or someone told them to clam up)
Anyhow, you have some alternatives:
The kit is being sold for $99 right now, an awesome deal, but it
won't last. I am not sure they plan to produce the kit anymore.
Or maybe, now with the HD and BBA released, they could choose
to sell only the DVDs. Anyhow, checkout playstation2-linux.com.
I bought the JAP Linux DVDs off ebay 2 years ago. Someone apparently
bought that kit and split it up. Check out ebay, or playstation2-linux.com
for people who no longer want their kit, you might get a deal.
Finally, I have an extra printed copy of that manual. But I think
copyright would prevent me from sending it to you. I don't want
it anymore because its thick and cumbersome, my first printed
copy. I printed it again on A4 landscape two pages per side of
each sheet so it took less space and I can see more info at a time.
The original was merely single-page per side of each sheet. The
difference being, the latter is 2 printed pages per sheet, while the
former (newer) is 4 printed pages per sheet.
If it was legal for me to distribute a copy I printed originally for
my own personal purposes to someone else, I would be willing
to send it to you, but I will wait on the advice of others first.
Otherwise I just have to throw it away. If you already had a Linux
DVD, I could probably for sure legally give you one printed copy.
(at least, Sony probably wouldn't care if I did), but then you prob
wouldn't need my copy.
Gorim
thanks gorimgorim wrote:... I would be willing
to send it to you...
but i think i will try first with what i have now: i have the instructions from "mips-opc.c" - there is no info what each instruction does, but i think i'll find out somehow ;) and with the examples which bigboss posted (here) i can already see how to use some of them.
actually thats more than i had before i asked here, so i'm happy with it :)
thanks again