Monday, 1 November 2010

Open sdk for Playstation 3 under osx environment

Cool stuff these days:

- AsbestOS from my old friend marcan. Full linux come back to PlayStation 3. Great job marcan !!!

- PSL1GHT an open sdk for homebrew development for PlayStation 3.

Step followed for PSL1GHT under osx snow leopard ( i like to have all playstation (1, 2 and 3) compiling stuff under one environment, instead of playing with multiples virtual machines for that):

- Install fink remember to choose 64 bits installation, it is asked when you are installing fink

- After fink installation install libelf (needed for sprxlinker) and other stuff like wget with sudo fink install wget libelf

- create a directory to clone git repositories with:
mkdir -p /usr/local/ps3dev/git
cd git
git clone git://github.com/HACKERCHANNEL/PSL1GHT
git clone git://github.com/HACKERCHANNEL/ps3chain

- declare environment variables in .profile
PS3DEV=/usr/local/ps3dev;export PS3DEV
PSL1GHT=$PS3DEV/psl1ght;export PSL1GHT
PATH=$PATH:/usr/local/ps2dev/bin:$PS3DEV/bin:$PS3DEV/ppu/bin:$PS3DEV/spu/bin:$PSL1GHT/bin;export PATH
PS3LOAD=tcp:YOURPLAYSTATION3IP;export PS3LOAD

- open a new shell and go to $PS3SDK/git/ps3chain

- for ppu build execute ./buildit.sh ppu

- for spu i got some problems and i solved it declaring first LDFLAGS=-L/sw/lib -L/usr/lib -lintl and CGLAGS=-I/sw/include -I/usr/include
./buildit.sh spu

- compiling psl1ght we get some problems with sprxlinker:
linker.c:1:20: error: libelf.h: No such file or directory

It was solved changing Makefile file in PSL1GHT/psl1ght/tools/sprxlinker/Makefile
change line INCLUDE := .
by
INCLUDE := /sw/include/libelf /sw/include

make
ppu-gcc -Iinclude -c stub/crt0.S -o stub/crt0.o
ppu-gcc -Iinclude -c stub/sprx.S -o stub/sprx.o
ppu-gcc -Iinclude -c stub/crt.c -o stub/crt.o
gcc -O2 -Wall --std=gnu99 raw2h.c -o raw2h
gcc -Wall -Wextra -Os -g -pipe -c -o main.o main.c
main.c: In function ‘main’:
main.c:278: warning: ‘res’ may be used uninitialized in this function
gcc main.o -Wall -Wextra -Os -g -pipe -lz -o ps3load
gcc -L/sw/lib -lelf -O2 -Wall --std=gnu99 -I/sw/include/libelf -I/sw/include linker.c -o sprxlinker
[CC] lv2.c
[AR] libpsl1ght.a
[CC] errno.c
[CC] exit.c
[CC] file.c
[CC] kill.c
[CC] pid.c
[CC] sbrk.c
[CC] sleep.c
[CC] socket.c
[AR] libc-glue-ppu.a
[CC] stub.S
[CC] lib.c
[AR] liblv2.a
[CC] stub.S
[CC] lib.c
[AR] libsysutil.a
[CC] stub.S
[CC] lib.c
[AR] libgcm_sys.a
[CC] stub.S
[CC] lib.c
[AR] libio.a

then make install


Environment ready to have a lot of fun :)

Next step go to samples and compile ps3load , zlib is needed but build.sh included to make zlib.a library must be fixed:
change
CC="ppu-gcc" CFLAGS="-g -O2 -Wall" ./configure --static
by
CC="ppu-gcc" CFLAGS="-g -O2 -Wall" AR="ppu-ar" RANLIB="ppu-ranlib" ./configure --static
then
make
zlib-1.2.5/
zlib-1.2.5/adler32.c
zlib-1.2.5/amiga/
zlib-1.2.5/amiga/Makefile.pup
zlib-1.2.5/amiga/Makefile.sas
zlib-1.2.5/ChangeLog
zlib-1.2.5/CMakeLists.txt
zlib-1.2.5/compress.c
zlib-1.2.5/configure
zlib-1.2.5/contrib/
zlib-1.2.5/contrib/ada/
zlib-1.2.5/contrib/ada/buffer_demo.adb
zlib-1.2.5/contrib/ada/mtest.adb
zlib-1.2.5/contrib/ada/read.adb
zlib-1.2.5/contrib/ada/readme.txt
zlib-1.2.5/contrib/ada/test.adb
zlib-1.2.5/contrib/ada/zlib-streams.adb
zlib-1.2.5/contrib/ada/zlib-streams.ads
zlib-1.2.5/contrib/ada/zlib-thin.adb
zlib-1.2.5/contrib/ada/zlib-thin.ads
zlib-1.2.5/contrib/ada/zlib.adb
zlib-1.2.5/contrib/ada/zlib.ads
zlib-1.2.5/contrib/ada/zlib.gpr
zlib-1.2.5/contrib/amd64/
zlib-1.2.5/contrib/amd64/amd64-match.S
zlib-1.2.5/contrib/asm686/
zlib-1.2.5/contrib/asm686/match.S
zlib-1.2.5/contrib/asm686/README.686
zlib-1.2.5/contrib/blast/
zlib-1.2.5/contrib/blast/blast.c
zlib-1.2.5/contrib/blast/blast.h
zlib-1.2.5/contrib/blast/Makefile
zlib-1.2.5/contrib/blast/README
zlib-1.2.5/contrib/blast/test.pk
zlib-1.2.5/contrib/blast/test.txt
zlib-1.2.5/contrib/delphi/
zlib-1.2.5/contrib/delphi/readme.txt
zlib-1.2.5/contrib/delphi/ZLib.pas
zlib-1.2.5/contrib/delphi/ZLibConst.pas
zlib-1.2.5/contrib/delphi/zlibd32.mak
zlib-1.2.5/contrib/dotzlib/
zlib-1.2.5/contrib/dotzlib/DotZLib/
zlib-1.2.5/contrib/dotzlib/DotZLib/AssemblyInfo.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/ChecksumImpl.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/CircularBuffer.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/CodecBase.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/Deflater.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/DotZLib.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/DotZLib.csproj
zlib-1.2.5/contrib/dotzlib/DotZLib/GZipStream.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/Inflater.cs
zlib-1.2.5/contrib/dotzlib/DotZLib/UnitTests.cs
zlib-1.2.5/contrib/dotzlib/DotZLib.build
zlib-1.2.5/contrib/dotzlib/DotZLib.chm
zlib-1.2.5/contrib/dotzlib/DotZLib.sln
zlib-1.2.5/contrib/dotzlib/LICENSE_1_0.txt
zlib-1.2.5/contrib/dotzlib/readme.txt
zlib-1.2.5/contrib/gcc_gvmat64/
zlib-1.2.5/contrib/gcc_gvmat64/gvmat64.S
zlib-1.2.5/contrib/infback9/
zlib-1.2.5/contrib/infback9/infback9.c
zlib-1.2.5/contrib/infback9/infback9.h
zlib-1.2.5/contrib/infback9/inffix9.h
zlib-1.2.5/contrib/infback9/inflate9.h
zlib-1.2.5/contrib/infback9/inftree9.c
zlib-1.2.5/contrib/infback9/inftree9.h
zlib-1.2.5/contrib/infback9/README
zlib-1.2.5/contrib/inflate86/
zlib-1.2.5/contrib/inflate86/inffas86.c
zlib-1.2.5/contrib/inflate86/inffast.S
zlib-1.2.5/contrib/iostream/
zlib-1.2.5/contrib/iostream/test.cpp
zlib-1.2.5/contrib/iostream/zfstream.cpp
zlib-1.2.5/contrib/iostream/zfstream.h
zlib-1.2.5/contrib/iostream2/
zlib-1.2.5/contrib/iostream2/zstream.h
zlib-1.2.5/contrib/iostream2/zstream_test.cpp
zlib-1.2.5/contrib/iostream3/
zlib-1.2.5/contrib/iostream3/README
zlib-1.2.5/contrib/iostream3/test.cc
zlib-1.2.5/contrib/iostream3/TODO
zlib-1.2.5/contrib/iostream3/zfstream.cc
zlib-1.2.5/contrib/iostream3/zfstream.h
zlib-1.2.5/contrib/masmx64/
zlib-1.2.5/contrib/masmx64/bld_ml64.bat
zlib-1.2.5/contrib/masmx64/gvmat64.asm
zlib-1.2.5/contrib/masmx64/inffas8664.c
zlib-1.2.5/contrib/masmx64/inffasx64.asm
zlib-1.2.5/contrib/masmx64/readme.txt
zlib-1.2.5/contrib/masmx86/
zlib-1.2.5/contrib/masmx86/bld_ml32.bat
zlib-1.2.5/contrib/masmx86/inffas32.asm
zlib-1.2.5/contrib/masmx86/match686.asm
zlib-1.2.5/contrib/masmx86/readme.txt
zlib-1.2.5/contrib/minizip/
zlib-1.2.5/contrib/minizip/crypt.h
zlib-1.2.5/contrib/minizip/ioapi.c
zlib-1.2.5/contrib/minizip/ioapi.h
zlib-1.2.5/contrib/minizip/iowin32.c
zlib-1.2.5/contrib/minizip/iowin32.h
zlib-1.2.5/contrib/minizip/make_vms.com
zlib-1.2.5/contrib/minizip/Makefile
zlib-1.2.5/contrib/minizip/miniunz.c
zlib-1.2.5/contrib/minizip/minizip.c
zlib-1.2.5/contrib/minizip/MiniZip64_Changes.txt
zlib-1.2.5/contrib/minizip/MiniZip64_info.txt
zlib-1.2.5/contrib/minizip/mztools.c
zlib-1.2.5/contrib/minizip/mztools.h
zlib-1.2.5/contrib/minizip/unzip.c
zlib-1.2.5/contrib/minizip/unzip.h
zlib-1.2.5/contrib/minizip/zip.c
zlib-1.2.5/contrib/minizip/zip.h
zlib-1.2.5/contrib/pascal/
zlib-1.2.5/contrib/pascal/example.pas
zlib-1.2.5/contrib/pascal/readme.txt
zlib-1.2.5/contrib/pascal/zlibd32.mak
zlib-1.2.5/contrib/pascal/zlibpas.pas
zlib-1.2.5/contrib/puff/
zlib-1.2.5/contrib/puff/Makefile
zlib-1.2.5/contrib/puff/puff.c
zlib-1.2.5/contrib/puff/puff.h
zlib-1.2.5/contrib/puff/README
zlib-1.2.5/contrib/puff/zeros.raw
zlib-1.2.5/contrib/README.contrib
zlib-1.2.5/contrib/testzlib/
zlib-1.2.5/contrib/testzlib/testzlib.c
zlib-1.2.5/contrib/testzlib/testzlib.txt
zlib-1.2.5/contrib/untgz/
zlib-1.2.5/contrib/untgz/Makefile
zlib-1.2.5/contrib/untgz/Makefile.msc
zlib-1.2.5/contrib/untgz/untgz.c
zlib-1.2.5/contrib/vstudio/
zlib-1.2.5/contrib/vstudio/readme.txt
zlib-1.2.5/contrib/vstudio/vc10/
zlib-1.2.5/contrib/vstudio/vc10/miniunz.vcxproj
zlib-1.2.5/contrib/vstudio/vc10/miniunz.vcxproj.filters
zlib-1.2.5/contrib/vstudio/vc10/miniunz.vcxproj.user
zlib-1.2.5/contrib/vstudio/vc10/minizip.vcxproj
zlib-1.2.5/contrib/vstudio/vc10/minizip.vcxproj.filters
zlib-1.2.5/contrib/vstudio/vc10/minizip.vcxproj.user
zlib-1.2.5/contrib/vstudio/vc10/testzlib.vcxproj
zlib-1.2.5/contrib/vstudio/vc10/testzlib.vcxproj.filters
zlib-1.2.5/contrib/vstudio/vc10/testzlib.vcxproj.user
zlib-1.2.5/contrib/vstudio/vc10/testzlibdll.vcxproj
zlib-1.2.5/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
zlib-1.2.5/contrib/vstudio/vc10/testzlibdll.vcxproj.user
zlib-1.2.5/contrib/vstudio/vc10/zlib.rc
zlib-1.2.5/contrib/vstudio/vc10/zlibstat.vcxproj
zlib-1.2.5/contrib/vstudio/vc10/zlibstat.vcxproj.filters
zlib-1.2.5/contrib/vstudio/vc10/zlibstat.vcxproj.user
zlib-1.2.5/contrib/vstudio/vc10/zlibvc.def
zlib-1.2.5/contrib/vstudio/vc10/zlibvc.sln
zlib-1.2.5/contrib/vstudio/vc10/zlibvc.vcxproj
zlib-1.2.5/contrib/vstudio/vc10/zlibvc.vcxproj.filters
zlib-1.2.5/contrib/vstudio/vc10/zlibvc.vcxproj.user
zlib-1.2.5/contrib/vstudio/vc9/
zlib-1.2.5/contrib/vstudio/vc9/miniunz.vcproj
zlib-1.2.5/contrib/vstudio/vc9/minizip.vcproj
zlib-1.2.5/contrib/vstudio/vc9/testzlib.vcproj
zlib-1.2.5/contrib/vstudio/vc9/testzlibdll.vcproj
zlib-1.2.5/contrib/vstudio/vc9/zlib.rc
zlib-1.2.5/contrib/vstudio/vc9/zlibstat.vcproj
zlib-1.2.5/contrib/vstudio/vc9/zlibvc.def
zlib-1.2.5/contrib/vstudio/vc9/zlibvc.sln
zlib-1.2.5/contrib/vstudio/vc9/zlibvc.vcproj
zlib-1.2.5/crc32.c
zlib-1.2.5/crc32.h
zlib-1.2.5/deflate.c
zlib-1.2.5/deflate.h
zlib-1.2.5/doc/
zlib-1.2.5/doc/algorithm.txt
zlib-1.2.5/doc/rfc1950.txt
zlib-1.2.5/doc/rfc1951.txt
zlib-1.2.5/doc/rfc1952.txt
zlib-1.2.5/doc/txtvsbin.txt
zlib-1.2.5/example.c
zlib-1.2.5/examples/
zlib-1.2.5/examples/enough.c
zlib-1.2.5/examples/fitblk.c
zlib-1.2.5/examples/gun.c
zlib-1.2.5/examples/gzappend.c
zlib-1.2.5/examples/gzjoin.c
zlib-1.2.5/examples/gzlog.c
zlib-1.2.5/examples/gzlog.h
zlib-1.2.5/examples/README.examples
zlib-1.2.5/examples/zlib_how.html
zlib-1.2.5/examples/zpipe.c
zlib-1.2.5/examples/zran.c
zlib-1.2.5/FAQ
zlib-1.2.5/gzclose.c
zlib-1.2.5/gzguts.h
zlib-1.2.5/gzlib.c
zlib-1.2.5/gzread.c
zlib-1.2.5/gzwrite.c
zlib-1.2.5/INDEX
zlib-1.2.5/infback.c
zlib-1.2.5/inffast.c
zlib-1.2.5/inffast.h
zlib-1.2.5/inffixed.h
zlib-1.2.5/inflate.c
zlib-1.2.5/inflate.h
zlib-1.2.5/inftrees.c
zlib-1.2.5/inftrees.h
zlib-1.2.5/make_vms.com
zlib-1.2.5/Makefile
zlib-1.2.5/Makefile.in
zlib-1.2.5/minigzip.c
zlib-1.2.5/msdos/
zlib-1.2.5/msdos/Makefile.bor
zlib-1.2.5/msdos/Makefile.dj2
zlib-1.2.5/msdos/Makefile.emx
zlib-1.2.5/msdos/Makefile.msc
zlib-1.2.5/msdos/Makefile.tc
zlib-1.2.5/nintendods/
zlib-1.2.5/nintendods/Makefile
zlib-1.2.5/nintendods/README
zlib-1.2.5/old/
zlib-1.2.5/old/as400/
zlib-1.2.5/old/as400/bndsrc
zlib-1.2.5/old/as400/compile.clp
zlib-1.2.5/old/as400/readme.txt
zlib-1.2.5/old/as400/zlib.inc
zlib-1.2.5/old/descrip.mms
zlib-1.2.5/old/Makefile.riscos
zlib-1.2.5/old/os2/
zlib-1.2.5/old/os2/Makefile.os2
zlib-1.2.5/old/os2/zlib.def
zlib-1.2.5/old/README
zlib-1.2.5/old/visual-basic.txt
zlib-1.2.5/old/visualc6/
zlib-1.2.5/old/visualc6/example.dsp
zlib-1.2.5/old/visualc6/minigzip.dsp
zlib-1.2.5/old/visualc6/README.txt
zlib-1.2.5/old/visualc6/zlib.dsp
zlib-1.2.5/old/visualc6/zlib.dsw
zlib-1.2.5/qnx/
zlib-1.2.5/qnx/package.qpg
zlib-1.2.5/README
zlib-1.2.5/treebuild.xml
zlib-1.2.5/trees.c
zlib-1.2.5/trees.h
zlib-1.2.5/uncompr.c
zlib-1.2.5/watcom/
zlib-1.2.5/watcom/watcom_f.mak
zlib-1.2.5/watcom/watcom_l.mak
zlib-1.2.5/win32/
zlib-1.2.5/win32/DLL_FAQ.txt
zlib-1.2.5/win32/Makefile.bor
zlib-1.2.5/win32/Makefile.emx
zlib-1.2.5/win32/Makefile.gcc
zlib-1.2.5/win32/Makefile.msc
zlib-1.2.5/win32/README-WIN32.txt
zlib-1.2.5/win32/VisualC.txt
zlib-1.2.5/win32/zlib.def
zlib-1.2.5/win32/zlib1.rc
zlib-1.2.5/zconf.h
zlib-1.2.5/zconf.h.cmakein
zlib-1.2.5/zconf.h.in
zlib-1.2.5/zlib.3
zlib-1.2.5/zlib.3.pdf
zlib-1.2.5/zlib.h
zlib-1.2.5/zlib.map
zlib-1.2.5/zlib.pc.in
zlib-1.2.5/zlib2ansi
zlib-1.2.5/zutil.c
zlib-1.2.5/zutil.h
~/Desktop/ps3dev/git/PSL1GHT/samples/ps3load/zlib/zlib-1.2.5 ~/Desktop/ps3dev/git/PSL1GHT/samples/ps3load/zlib
Building static library libz.a version 1.2.5 with ppu-gcc.
Checking for off64_t... No.
Checking for fseeko... Yes.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for attribute(visibility) support... Yes.
ppu-gcc -g -O2 -Wall -c -o example.o example.c
ppu-gcc -g -O2 -Wall -c -o adler32.o adler32.c
ppu-gcc -g -O2 -Wall -c -o compress.o compress.c
ppu-gcc -g -O2 -Wall -c -o crc32.o crc32.c
ppu-gcc -g -O2 -Wall -c -o deflate.o deflate.c
ppu-gcc -g -O2 -Wall -c -o gzclose.o gzclose.c
ppu-gcc -g -O2 -Wall -c -o gzlib.o gzlib.c
ppu-gcc -g -O2 -Wall -c -o gzread.o gzread.c
ppu-gcc -g -O2 -Wall -c -o gzwrite.o gzwrite.c
ppu-gcc -g -O2 -Wall -c -o infback.o infback.c
ppu-gcc -g -O2 -Wall -c -o inffast.o inffast.c
ppu-gcc -g -O2 -Wall -c -o inflate.o inflate.c
ppu-gcc -g -O2 -Wall -c -o inftrees.o inftrees.c
ppu-gcc -g -O2 -Wall -c -o trees.o trees.c
ppu-gcc -g -O2 -Wall -c -o uncompr.o uncompr.c
ppu-gcc -g -O2 -Wall -c -o zutil.o zutil.c
ppu-ar rc libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
ppu-gcc -g -O2 -Wall -o example example.o -L. libz.a
ppu-gcc -g -O2 -Wall -c -o minigzip.o minigzip.c
ppu-gcc -g -O2 -Wall -o minigzip minigzip.o -L. libz.a
~/Desktop/ps3dev/git/PSL1GHT/samples/ps3load/zlib
[CC] main.c
[LD] ps3load.elf


make pkg
make[1]: Nothing to be done for `all'.
make[1]: `/usr/local/ps3dev/git/PSL1GHT/samples/ps3load/ps3load.self' is up to date.
Creating PKG...
[X] Magic: 7f504b47
[X] Type: 00000001
[X] Offset to package info: 000000c0
[ ] unk1: 00000005
[X] Head Size: 00000080
[X] Item Count: 00000004
[X] Package Size: 0000000000057370
[X] Data Offset: 0000000000000140
[X] Data Size: 00000000000571d0
[X] ContentID: 'UP0001-PSL145310_00-0000000000000000'
[X] QA_Digest: 1881D6153B18C66AC23B3219FF03C6E
[X] K Licensee: 00000000000000000000000000000000

- Intall ps3load.pkg in your PlayStation 3
- Run it
- To test compile echoserv and run from your mac
ps3load echoserv.self
ps3load v0.5
coded by dhewg, #wiidev efnet

compressing 339640 bytes... 11.65%
connecting to myplaystationip:4299
sending upload request
sending file size (39567 bytes)
sending data
sending arguments (15 bytes)
done.

- Test from your mac
telnet myplaystationip 2002
Trying myplaystatioip...
Connected to myplaystationip.
Escape character is '^]'.
Welcome to ECHOServer test.
Type exit and hit enter to close app, otherwise type anything you want and hit enter and I will replay it back to you free of charge. :)hola
hola
Connection closed by foreign host.

Cool !!!
- To finish echoserver
telnet myplaystationip 2002
Trying myplaystationip...
Connected to myplaystationip.
Escape character is '^]'.
Welcome to ECHOServer test.
Type exit and hit enter to close app, otherwise type anything you want and hit enter and I will replay it back to you free of charge. :)exit
exit
Connection closed by foreign host.

And your PlayStation go back to xmb


Nice tools, time to code...

19 comments:

Anonymous said...

Hi

I'm using macports instead of fink but I'm getting a problem with the linker.


ls /opt/local/include/libelf/
elf_repl.h gelf.h libelf.h nlist.h sys_elf.h


gcc linker.c -lelf -O2 -Wall --std=gnu99 -I/opt/local/include/libelf -I/opt/local/include -o sprxlinker
ld: library not found for -lelf
collect2: ld returned 1 exit status

Any ideas? Thanks

bigboss said...

i modified makefile for sprlinker
TARGET := sprxlinker
SOURCE := .
INCLUDE := /sw/include /sw/include/libelf

CFLAGS := -O2 -Wall --std=gnu99
LDFLAGS := -L/sw/lib -lelf

CC := gcc

CFILES := $(foreach dir,$(SOURCE),$(wildcard $(dir)/*.c))

CFLAGS += $(foreach dir,$(INCLUDE),-I$(dir))

all: $(TARGET)

clean:
rm -rf $(TARGET)

$(TARGET): $(CFILES)
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $@



my libelf is in /sw/lib, check where are yours

RedOsh said...

Hi!

I followed all steps but it wasn't working fine until I added
--disable-nls

to the configure option of binutils; then it worked.

Just if somebody had the same problem...

Thanks!!

Dyorgio said...

I replace fink by macports too.
I belive macports is more updated.
I will try to clone gif monday, because is to late now in brazil :).
To found this tutorial I needed to google for 3 hours...:(

Do you have more thinks about PS3 dev in Mac?

I like to use eclipse IDE to developer, because I hate make files and like to port some projects opensource to ps3, VLC for example

bigboss said...

I use fink because i have all my old stuff from ps2 days with it and i don't want waste my time recompiling and adapting all my environment. There are many unpublished stuff and all is done in osx since 6 years ago ...

Right now i am working in move stuff for 3.55 firmware and i am waiting an libusb in psl1ght to finish kinect port, psl1ght has already some part of libgem (move) published, i need to commit some changes to make run it fine and some samples for people interesting in make things with it.

About eclipse i like more light editors like Textmate with some custom command, i come from old school :P, i don't need full ide with a good editor like Textmate i can all my tasks without too much resources.

i know that right now some people are working in ffmpeg port.

if you are interested hermes made a 3d library with many features. Checkout at https://github.com/hermesEOL/tiny3d

Sebastian said...

Hey,
big thx for this tut but I've a small problem there. + I'm kinda new to the UNIX EnvironmentSetups

-declare environment variables in .profile
How I've to do that?
when I just enter the Paths and stuff it stays for one session and disappears the next time I start the Terminal

- open a new shell and go to $PS3SDK/git/ps3chain .
*Not $PS3DEV?*

- When I enter
"./buildit.sh ppu"

>>Output:
Downloading binutils-2.20.tar.bz2...
./buildit.sh: line 110: wget: command not found
Could not download binutils-2.20.tar.bz2

-> I've set up fink + downloaded addons etc...
-How can I start/run the fink environment manually and check if its running?

Thanks in advance!

bAstimc

bigboss said...

Sebastian i am not at home now, tonight i will post to help you step by step don't worry.

Sebastian said...

thanks :)

bigboss said...

File .profile is localized in /Users/yourusername

It is a hidden file, and it is not show in finder by default.

Open a terminal (i use iTerm instead of classic apple Terminal application but you can use it)

Execute:
pwd

It will show something like
Last login: Tue Jan 11 20:03:51 on ttys000
yourcomputername:~ yourusername$ pwd
/Users/yourusername

Execute pico .profile

Add your environment variables and save it with ctrl+O return

after that to check, close Terminal and open a new Terminal

execute echo $PS3DEV

it should show tha value that you created in .profile

Next step, instead of use ps3chain from psl1ght git you can use ps3toolchain from oopo it's cleaner right now i am usit it https://github.com/ooPo/ps3toolchain

about fink there is already environment variables for it in your .profile file you don't need to worry about it. It's a line in your .profile like: test -r /sw/bin/init.sh && . /sw/bin/init.sh



you need to install wget tool

sudo fink install wget

bAstimc said...

Thx!

-ok I added those vars in .profile
-copied the toolchain into $PS3DEV/git/ps3toolchain
- ./toolchain.sh needs WGET TOOL
-after that I tried: sudo fink install wget
>> sudo: fink: command not found

mh but I know that I've installed it yesterday with: sudo fink install wget libelf
for example the libelffolder exists in /sw/include

-even the ./init.sh in /sw/bin isnt working
>> -bash: ./init.sh: Permission denied

I checked the chmod
>> -rw-r--r-- 1 root admin 3790 10 Jan 16:51 init.sh

so that would mean nobody can execute those files in /sw...

BUT: source /sw/bin/init.sh
is working :O + started fink

------------------------------------
and again:

./toolchain.sh
-> Seems to work :) I'll continue with the other steps tomorrow

GN8

bAstimc

bAstimc said...

hey,
the toolchain ran fine until the point after downloading the psl1ght files + extracting(ps3toolchain/scripts/011-psl1ght.sh)
those seemed to be succesfully extracted

>>Output:
...
ppu-gcc -Iinclude -c stub/crt0.S -o stub/crt0.o
ppu-gcc -Iinclude -c stub/sprx.S -o stub/sprx.o
ppu-gcc -Iinclude -c stub/crt.c -o stub/crt.o
gcc -O2 -Wall --std=gnu99 raw2h.c -o raw2h
gcc -Wall -Os -g -pipe -c -o main.o main.c
gcc main.o -Wall -Os -g -pipe -lz -o ps3load
gcc linker.c -lelf -O2 -Wall --std=gnu99 -I. -o sprxlinker
linker.c:1:20: error: libelf.h: No such file or directory

-> so changed the includepath in that makefile
switched to the psl1ght/psl1ght folder and ran make(or what should I do? again running the ps3toolchain/scripts/011-psl1ght.sh would overwrite the corrected Makefile :/ )

>>Output:
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
gcc linker.c -lelf -O2 -Wall --std=gnu99 -I/sw/include/libelf -I/sw/include -o sprxlinker
ld: library not found for -lelf
collect2: ld returned 1 exit status
make[1]: *** [sprxlinker] Error 1
make: *** [all] Error 2

bye

bigboss said...

modify Makefile on PSL1GHT/psl1ght/tools/sprlinker

TARGET := sprxlinker
SOURCE := .
INCLUDE := /sw/include /sw/include/libelf

CFLAGS := -O2 -Wall --std=gnu99
LDFLAGS := -L/sw/lib -lelf

CC := gcc

CFILES := $(foreach dir,$(SOURCE),$(wildcard $(dir)/*.c))

CFLAGS += $(foreach dir,$(INCLUDE),-I$(dir))

all: $(TARGET)

clean:
rm -rf $(TARGET)

$(TARGET): $(CFILES)
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $@

bAstimc said...

ok I changed that what you also posted before and yea
>>Output:

make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
Makefile:17: *** missing separator. Stop.
make: *** [all] Error 2

when I delete the space
clean:
rm -rf $(TARGET)

to->

clean: rm -rf $(TARGET)

then it occurs in the last line
Makefile:19: *** missing separator. Stop.

thanks so far :)

bigboss said...

cut and paste problem

use original file and change these lines

INCLUDE := /sw/include /sw/include/libelf

LDFLAGS := -L/sw/lib -lelf

bAstimc said...

Big THX :)
I should have used my Textmate before ;)

bAstimc said...

does anybody tried anything with the vpcomp?

There is missing a file..

gcc -Wall -Os -g -pipe -I../../include/rsx -c main.cpp -o main.o
main.cpp:8:19: error: cg/cg.h: No such file or directory

I can't find such file in the environment. Do I have missed to install anything important?

bigboss said...

there is some stuff for compiling nvdia shaders it's only for windows.

You don't need compiling shader yo make cool things so you have now a funtional environment.

I will wait your samples :P

bAstimc said...

ye that's what I found so far too^^
I'll see what I can do :)

the pad and kb sample didn't worked ... black screen and nothing happens
on 3.41

bigboss said...

Well i use printf over ethernet cable(no wifi)
Install ps3load package in ps3
Download in your mac https://github.com/downloads/AerialX/Kammy/EthernetDebugLoader-v2.self


1) run ps3load in ps3
2) open a terminal in your mac
3) run this command:
socat udp-recv:18194 stdout

4) open other terminal in your mac and run ps3load EthernetDebugLoader-v2.self

Now in first terminal you will have your debug output from printf and other internal events

5) Run with this method your own self files

EthernetDebugLoader must be run only when you switch on your ps3. After that you have debug over udp broadcast in ethernet port