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

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

Moderators: cheriff, Herben

Post Reply
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

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

Post 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?
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post 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.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

b0rje
Posts: 7
Joined: Thu May 12, 2005 6:58 pm

Post 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
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Thanks. Yes, removing -m is an easier solution.
carlosn
Posts: 38
Joined: Thu Mar 10, 2005 2:14 am
Location: Orlando, Florida, US
Contact:

Post 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
b0rje
Posts: 7
Joined: Thu May 12, 2005 6:58 pm

Post 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
carlosn
Posts: 38
Joined: Thu Mar 10, 2005 2:14 am
Location: Orlando, Florida, US
Contact:

Post 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.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post 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.
ammonton
Posts: 3
Joined: Sat Feb 17, 2007 8:45 am

Post by ammonton »

DVD#2 is up on PirateBay. Search for "ps2 linux", there even seems to be a couple of seeders.
Post Reply