forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Wed Feb 21, 2007 11:27 pm    Post subject: Debugging dvp-as... (crashes on DMARet *) Reply with quote

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?
Back to top
View user's profile Send private message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Thu Feb 22, 2007 12:57 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Thu Feb 22, 2007 2:16 am    Post subject: Reply with quote

Done.
http://home.tele2.fr/~fr-51785/ps2_gasp_vcl.zip
Back to top
View user's profile Send private message
b0rje



Joined: 12 May 2005
Posts: 7

PostPosted: Thu Feb 22, 2007 4:56 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Thu Feb 22, 2007 7:17 pm    Post subject: Reply with quote

Thanks. Yes, removing -m is an easier solution.
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Fri Feb 23, 2007 12:02 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
b0rje



Joined: 12 May 2005
Posts: 7

PostPosted: Sat Feb 24, 2007 4:42 am    Post subject: Reply with quote

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:

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
Back to top
View user's profile Send private message
carlosn



Joined: 10 Mar 2005
Posts: 38
Location: Orlando, Florida, US

PostPosted: Sat Feb 24, 2007 9:57 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Sat Feb 24, 2007 6:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ammonton



Joined: 17 Feb 2007
Posts: 3

PostPosted: Sat Feb 24, 2007 9:02 pm    Post subject: Reply with quote

DVD#2 is up on PirateBay. Search for "ps2 linux", there even seems to be a couple of seeders.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group