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 

Prbs compiling ps2menu

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



Joined: 30 Jan 2004
Posts: 33
Location: Hell

PostPosted: Sun Feb 01, 2004 3:38 am    Post subject: Prbs compiling ps2menu Reply with quote

Hello,

When I try to compile ps2menu, the assembler barks on the cfc2.ni $3, $28 and ctc2.ni $3, $28 instructions. I've never seen the .ni modifier before but then again I've only been programming R3000. Is .ni a legal modifier and if it is, what does it mean?
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sun Feb 01, 2004 4:22 am    Post subject: Reply with quote

I know I don't answer directly to your questions, but those 4 instructions were added lately to the binutils-2.13.2.1's mips r5900 instruction set patch:

cfc2.i
cfc2.ni
ctc2.i
ctc2.ni

Here is the patch to apply on your binutils's source in order to provide those instructions:

http://www.nobis-crew.org/~pixel/mips-opc.c.diff
_________________
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.
Back to top
View user's profile Send private message
Oobles
Site Admin


Joined: 17 Jan 2004
Posts: 362
Location: Melbourne, Australia

PostPosted: Sun Feb 01, 2004 8:58 am    Post subject: Reply with quote

You should fix up your compiler by adding those instructions, however, if you're really lazy. You can change the instructions in your ps2menu source to cfc and ctc instead. I was told that this will produce the same output.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
boman666



Joined: 30 Jan 2004
Posts: 33
Location: Hell

PostPosted: Mon Feb 02, 2004 10:02 am    Post subject: Reply with quote

Thanks guys, ps2menu compiles now but the assembler is emitting warnings saying "Loop length is too short for r5900". I hope they are spurious.

Anyways, I've prb getting any prg running on the PS2. I'm using the Linuxkit, but I can't even get the pre-compiled .elf's in reload1-0.1 to execute. Since that seems so trivial, I'm starting to suspect that it's not due to me screwing up but some other prb, maybe some incompatibility with my PS2. I got the SPCH-50004 model (unmodded by the way). I don't know how long that model has been around but I bought it brand new a copule of days ago. Any hints what the culprit can be and what should I do about it?
Back to top
View user's profile Send private message
Oobles
Site Admin


Joined: 17 Jan 2004
Posts: 362
Location: Melbourne, Australia

PostPosted: Mon Feb 02, 2004 12:47 pm    Post subject: Reply with quote

I'm not familiar with model numbers.. but I noticed this thread discussing changes required to reload for v9 ps2.

http://forums.ps2dev.org/viewtopic.php?t=29

Hope it helps.
Oobles.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
boman666



Joined: 30 Jan 2004
Posts: 33
Location: Hell

PostPosted: Tue Feb 03, 2004 2:31 am    Post subject: Reply with quote

Ok, with that change I got reload to work. However, I also had to change asm ("j\t%0" : : "i" (0xa0001000)); in reload1.c to asm ("j\t%0" : : "i" (0x00001000));. AFAICT, that must be a bug. I find it a little bit strange that it has slipped through unnoticed, but I guess the author has a different toolchain which just ignores the overflow.
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Tue Feb 03, 2004 3:01 am    Post subject: Reply with quote

I think you'd better change the

asm ("j\t%0" : : "i" (0xa0001000));

into:

asm ("li\t$31, %0\njr\t$31" : : "i" (0xa0001000));

Well, it seems to have more sense to me :)
_________________
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.
Back to top
View user's profile Send private message
boman666



Joined: 30 Jan 2004
Posts: 33
Location: Hell

PostPosted: Tue Feb 03, 2004 5:07 am    Post subject: Reply with quote

Agreed, that's a better solution since that's probably what the author intended. By the way, what's the purpose of the KSeg0/KSeg1?
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Feb 05, 2004 6:50 am    Post subject: Reply with quote

boman666 wrote:
Ok, with that change I got reload to work. However, I also had to change asm ("j\t%0" : : "i" (0xa0001000)); in reload1.c to asm ("j\t%0" : : "i" (0x00001000));. AFAICT, that must be a bug. I find it a little bit strange that it has slipped through unnoticed, but I guess the author has a different toolchain which just ignores the overflow.


It could be a bug in the toolchain, as "j" is a macro, which is supposed to expand to what pixel posted above (which is itself a macro :). Did you take a look at the generated assembly?

It has to be 0xa0001000 because I don't do an I-cache flush before jumping to the kernel startup code. IIRC I don't do it because redboot, the mostly-broken tool I used to test reload1 had funny issues with both caches (it had a bug that disabled both caches).

That sequence in reload1 is very finnicky, esp. as now I have to detect the start of the patched EELOAD startup. I'll get around to testing more it after my home dev env. is setup.
Back to top
View user's profile Send private message
boman666



Joined: 30 Jan 2004
Posts: 33
Location: Hell

PostPosted: Fri Feb 06, 2004 5:45 am    Post subject: Reply with quote

Thanks for the clarification. I haven't written any mipsassembler in about 6 years and I didn't remember j was a macro. Anyways, my toolchain, as you suggested, was probably broken in some way because the address became negative when I compiled ps2menu.
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