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 

Can't get my compiled "Hello world" code to execut

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



Joined: 01 Jun 2005
Posts: 12

PostPosted: Mon Jun 20, 2005 6:19 pm    Post subject: Can't get my compiled "Hello world" code to execut Reply with quote

So I finally got everything to compile, but when I attempt to run the code on my 1.5 using the swap method, it just freezes on the white screen with a solid lit memory stick light. I'm using these commands to compile it in Cygwin, using the PSP toolchain:

Code:

./psp-gcc -march=r4000 -g -mgp32 -mlong32 -c hellopsp.c
./psp-gcc -march=r4000 -g -mgp32 -mlong32 -c pg.c
./psp-as -march=r4000 -g -mgp32 -O -o startup.o startup.s
./psp-ld -O0 startup.o hellopsp.o pg.o -M -Ttext 8900000 -q -o out > hellopsp.map


I'm assuming that using the assembler is fine, rather than using:

Code:

./psp-gcc -march=r4000 -g -mgp32 -c -xassembler -O -o startup.o startup.s


as it shows in the make.bat for helloworld. I tried that method, but it gives me errors, where as it doesn't with the psp assembler.

However, at the end of the make.bat in the helloworld source, it has a command, "outpatch." I'm totally new to command line stuff, and when I try to call it, it doesn't do anything. I've successfully been able to run the already compiled helloworld source, but not my own.

I also noticed that the size of data.psp in the already compiled version is about 62Kb, where mine is about 71Kb. However, when I used psp-strip, it made my file 62Kb. I've tried both versions, and neither work.

Sorry for the newb questions, but I don't see what I'm doing wrong.

-Matt
Back to top
View user's profile Send private message
Warren



Joined: 24 Jan 2004
Posts: 173
Location: San Diego, CA

PostPosted: Mon Jun 20, 2005 7:28 pm    Post subject: Reply with quote

There is no need to use -march=r4000 -mgp32 -mlong32 with the PSP toolchain. The -march is just plain wrong and the two -m's are builtin. You need to use outpatch as it fixes some things that the psp toolchain doesn't do yet and I suspect this is your problem.

Note to everyone that is reading this:
DO NOT USE -march=r4000 WITH THE PSP TOOLCHAIN!!!!!
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Jun 20, 2005 7:35 pm    Post subject: Reply with quote

Yes, those options were only suggested as temporary workarounds for some issues with using the ee-gcc toolchain for PSP dev. It was never perfect, but thats why people worked on the psp dev toolchain. From this point on, don't use any flags unless you know why they need to be used specifically for use with that toolchain.
Back to top
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Jun 20, 2005 7:55 pm    Post subject: Reply with quote

gorim wrote:
Yes, those options were only suggested as temporary workarounds for some issues with using the ee-gcc toolchain for PSP dev. It was never perfect, but thats why people worked on the psp dev toolchain. From this point on, don't use any flags unless you know why they need to be used specifically for use with that toolchain.


-march=4000 was wrong even for the EE toolchain :). If anything it should've been -march=6000, since that's what the Allegrex is closest to.
Back to top
View user's profile Send private message
lynx44



Joined: 01 Jun 2005
Posts: 12

PostPosted: Wed Jun 22, 2005 8:47 pm    Post subject: Reply with quote

Alright, well I still can't get this to work, not even with the new non-swap method for 1.5.

I compile with these commands:

Code:

./psp-gcc -c hellopsp.c
./psp-gcc -c pg.c
./psp-as startup.s
(Then I rename the a.out to startup.o)
./psp-ld startup.o pg.o hellopsp.o
(Then I rename the a.out to out)
./outpatch


Then I pack it into a PBP and run it, and it gives me error 800200D9. I'm supposed to use the -c flag, that tells GCC to compile it as C code, right? I don't know if I need to use some other flags or what, I'm completely new to Linux and toolchains (I've always had a Windows program of some sort with a nice "compile" button).

I'm probably making a stupid mistake, but I don't know what else to do. I've tried other variations of commands, but nothing has worked.

-Matt
Back to top
View user's profile Send private message
Savoury SnaX



Joined: 22 Jun 2005
Posts: 3

PostPosted: Thu Jun 23, 2005 12:00 am    Post subject: Reply with quote

outpatch will generate a file outp from out . it is this outp that needs to be put into the pbp.
Back to top
View user's profile Send private message
lynx44



Joined: 01 Jun 2005
Posts: 12

PostPosted: Thu Jun 23, 2005 8:32 am    Post subject: Reply with quote

Yeah, sorry, I forgot to say that I was using the outp for the elf file. Any other suggestions?

-Matt
Back to top
View user's profile Send private message
jboldiga



Joined: 20 Jun 2005
Posts: 27

PostPosted: Thu Jun 23, 2005 11:44 am    Post subject: Reply with quote

Try this

http://forums.ps2dev.org/viewtopic.php?t=1844&postdays=0&postorder=asc&start=30
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 -> PSP 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