ERL in ps2sdk - relocatable binaries.

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

ERL in ps2sdk - relocatable binaries.

Post by pixel »

Hi there,

As some already may know, I've been working on some relocatable stuff for the SDK, that I named ERL. I got word that sony and sn made their own, called ERX, that's why I named mine ERL for Library, but it also works for binaries actually.

Now, I've been retaining my code since quite a time, because I want to try to put the most mature API as possible, in order to avoid changing API after release, and so to break eventual softwares which started to use the first API. I guess I should now ask people over here for a review of my work, so I post some of the docs I wrote, as well as some code snipplet.

Note that the current design inforces usage of a "erl-support.c" file within all libraries, beeing something like that:

Code: Select all

#include <erl.h>

char * erl_id = "hello";
char * erl_dependancies&#91;&#93; = &#123;
    "libc",
    0
&#125;;
Files are at http://nnoble.nerim.net/erl/

Comments utterly welcome (requested even :P)
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.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

that's a very nice work, thanks pixel :)
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

when are you going to release the remaining things? :)
i'm looking forward for it :))
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

Well, I am currently quite far from home, with very limited Internet access, and for some time I am affraid...
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.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

news? :)
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

Okay... let's commit this. I still think it's more or less "not good", but, whatever: it's sleeping on my HDD since too long. Maybe it'll be useful for some people, and maybe they'll fix it if it's not correctly designed.


Don't hesitate to post comments, flames, feedback, questions etc...
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.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

i was trying to compile the latest ps2sdk and i get these things: (i'm compiling with msys 1.0 and ee and iop gcc 3.2.2, the ps2sdk of two days ago was compiling without problems)

Code: Select all

/Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF___errno src/kernel.S -c -o obj/__errno.o
ee-gcc -D_EE -G0 -O2 -Wall   -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee/kernel/i                                             nclude -IC&#58;/msys/1.0/home/Administrator/PS2SDK/common/include -IC&#58;/msys/1.0/home                                             /Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF_errno src/kernel.S -c -o obj/errno.o
ee-gcc -D_EE -G0 -O2 -Wall   -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee/kernel/i                                             nclude -IC&#58;/msys/1.0/home/Administrator/PS2SDK/common/include -IC&#58;/msys/1.0/home                                             /Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF_strncpy src/kernel.S -c -o obj/strncpy.o
src/kernel.S&#58; Assembler messages&#58;
src/kernel.S&#58;1102&#58; Warning&#58; Loop length is too short for r5900.
ee-gcc -D_EE -G0 -O2 -Wall   -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee/kernel/i                                             nclude -IC&#58;/msys/1.0/home/Administrator/PS2SDK/common/include -IC&#58;/msys/1.0/home                                             /Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF_strlen src/kernel.S -c -o obj/strlen.o
ee-gcc -D_EE -G0 -O2 -Wall   -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee/kernel/i                                             nclude -IC&#58;/msys/1.0/home/Administrator/PS2SDK/common/include -IC&#58;/msys/1.0/home                                             /Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF_memcpy src/kernel.S -c -o obj/memcpy.o
src/kernel.S&#58; Assembler messages&#58;
src/kernel.S&#58;1239&#58; Warning&#58; Loop length is too short for r5900.
ee-gcc -D_EE -G0 -O2 -Wall   -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee/kernel/i                                             nclude -IC&#58;/msys/1.0/home/Administrator/PS2SDK/common/include -IC&#58;/msys/1.0/home                                             /Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF_memset src/kernel.S -c -o obj/memset.o
src/kernel.S&#58; Assembler messages&#58;
src/kernel.S&#58;1352&#58; Warning&#58; Loop length is too short for r5900.
src/kernel.S&#58;1380&#58; Warning&#58; Loop length is too short for r5900.
ee-gcc -D_EE -G0 -O2 -Wall   -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee/kernel/i                                             nclude -IC&#58;/msys/1.0/home/Administrator/PS2SDK/common/include -IC&#58;/msys/1.0/home                                             /Administrator/PS2SDK/ee/libc/include -IC&#58;/msys/1.0/home/Administrator/PS2SDK/ee                                             /erl/include -Iinclude -DF___syscall src/kernel.S -c -o obj/__syscall.o
src/kernel.S&#58; Assembler messages&#58;
src/kernel.S&#58;60&#58; Error&#58; illegal operands `mfc0 $v0,$12'
src/kernel.S&#58;61&#58; Error&#58; illegal operands `andi $v0,$v0,0x18'
src/kernel.S&#58;62&#58; Error&#58; illegal operands `beqz $v0,_kMode'
src/kernel.S&#58;68&#58; Error&#58; illegal operands `sll $v1,$v1,2'
src/kernel.S&#58;69&#58; Error&#58; illegal operands `lui $k0,0x8000'
src/kernel.S&#58;70&#58; Error&#58; illegal operands `lhu $v0,0x02F0&#40;$k0&#41;'
src/kernel.S&#58;71&#58; Error&#58; illegal operands `sll $v0,$v0,16'
src/kernel.S&#58;72&#58; Error&#58; illegal operands `lh $k0,0x02F8&#40;$k0&#41;'
src/kernel.S&#58;73&#58; Error&#58; illegal operands `add $v0,$k0'
src/kernel.S&#58;74&#58; Error&#58; illegal operands `addu $v1,$v0'
src/kernel.S&#58;75&#58; Error&#58; illegal operands `lw $k0,0x00&#40;$v1&#41;'
src/kernel.S&#58;76&#58; Error&#58; illegal operands `jr $k0'
make&#91;2&#93;&#58; *** &#91;obj/__syscall.o&#93; Error 1
make&#91;2&#93;&#58; Leaving directory `/home/administrator/ps2sdk/ee/kernel'
make&#91;1&#93;&#58; *** &#91;all-kernel&#93; Error 2
make&#91;1&#93;&#58; Leaving directory `/home/administrator/ps2sdk/ee'
make&#58; *** &#91;all-ee&#93; Error 2

Administrator@MAIN /home/administrator/ps2sdk
$ 
thanks in advance for help :)
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

*sigh*

Yeah, I changed some small things into the syscall facility in the meanwhile, and used the new register naming scheme. Seems you're having an old patch there, which doesn't support register aliases.


Anyway, I've changed that to no-register-aliases. Update'n'test!

Ho, and, mh.... the erl-loader needs something to compile, and I don't know if it'll work from msys....

Look at ee/erl/src/build-exports.sh for details: you need grep, awk, and sort.
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.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

ok thanks now it compiles, i also updated my toolchain thanks :)
Post Reply