Page 1 of 1

Debugging dvp-as... (crashes on DMARet *)

Posted: Wed Feb 21, 2007 11:27 pm
by ps2devman
dvp-as crashes while trying to compile this .vsm :

.align 4
DMAret *
vifnop
vifnop
vifnop
MPG 0,*
NOP
.align 4
.EndMPG
.EndDmaData

The problem seems to be "DMAret *", but it's something automatically generated by vcl... So, better fix that problem...

Using addr2line tool I could find out that crash occurs in this function :
(gas/configure/tc-dvp.c line 1757)

long
dvp_relax_frag (fragP, stretch)
fragS * fragP;
long stretch;
{
/* Address of variable part. */
long address = fragP->fr_address + fragP->fr_fix;
/* Symbol marking start of data. */
symbolS * symbolP = fragP->fr_symbol;
/* Address of the symbol. */
long target;
long growth;

/* subtype >= 10 means "done" */
if (RELAX_DONE_P (fragP->fr_subtype))
return 0;

/* vu insn? */
if (fragP->fr_subtype == RELAX_VU)
{
fragP->fr_subtype = RELAX_ENCODE (RELAX_VU, 0);
return 0;
}

target = S_GET_VALUE (symbolP) + symbolP->sy_frag->fr_address;
...


It's symbolP->sy_frag that points to an illegal address...

Is there anyone here knowing well this code, added by ps2toolchain's binutil2.14 patch?

Posted: Thu Feb 22, 2007 12:57 am
by ps2devman
Until some guru pops up, I think I will just add my own version of dvp-as in archive ps2_gasp_vcl.zip.

This version will ignore the following lines:

DMAret *
vifnop
MPG 0,*
.EndMPG
.EndDmaData

And will consider DMAret * as the missing .vu

It seems compilation goes well with these changes.

Posted: Thu Feb 22, 2007 2:16 am
by ps2devman

Posted: Thu Feb 22, 2007 4:56 am
by b0rje
hi,
i had the same problem. Its not the DMAret, its the MPG that crashes dvp-as, as well as DIRECT(HL) commands. Its a pity this doesnt work, this would make some things much more comfortable..
Are you using the "-m" flag when calling vcl? Without this flag, those tags are generally not generated, so ommiting this, you would not have to use this kind of patched dvp-as. hope this helps.
(I'm using vcl vcl_14beta7_x86)

b0rje

Posted: Thu Feb 22, 2007 7:17 pm
by ps2devman
Thanks. Yes, removing -m is an easier solution.

Posted: Fri Feb 23, 2007 12:02 pm
by carlosn
I have used ee-dvp-as from the PS2Linux kit in native ps2 elfs. It works like a charm. Last time I checked, they were binaries available for download from the Playstation2-linux website. There is also vumacros.h which contains useful VU macros as the name implies.
Try these links

Under Cygwin

------------

http://playstation2-linux.com/projects/cfyc/


download the file gcc-2.95.2-ps2linux-win32.zip



Under linux

-----------

http://playstation2-linux.com/projects/ps2stuff/


download the file binutils-2.9EE-cross.tar.gz



Sample Code (vumacros.h)


http://playstation2-linux.com/projects/vcl

download the file vcl-samples.tgz

Posted: Sat Feb 24, 2007 4:42 am
by b0rje
yep,
interesting, this really seems to work with this binary version. there is another bug "solved" in this version concerning correct handling of dma-tags, using:

Code: Select all

DMAref qcount,label
..
label:
..
resulted in "internal error: unsupported relocation error" when linking with ee-ld. With this version it works (at least no error message, I didnt test the resulting chain)!
Are there any sources for those binutils (packaged in 2002, quite old)?

b0rje

Posted: Sat Feb 24, 2007 9:57 am
by carlosn
The sources are on DVD # 2 of the Playstation2 linux Kit. The good news is that the second DVD is all GPL and can be distributed at will. I own a set of discs but I don't have a site to host the packages.

Posted: Sat Feb 24, 2007 6:53 pm
by ps2devman
Wow... That's great news! Thx a lots for the tip carlosn!
I've added stripped versions (smaller) of ee-gasp & ee-dvp-as to the archive and where it comes from in txt file.

Posted: Sat Feb 24, 2007 9:02 pm
by ammonton
DVD#2 is up on PirateBay. Search for "ps2 linux", there even seems to be a couple of seeders.