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

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
lynx44
Posts: 12
Joined: Wed Jun 01, 2005 7:58 pm

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

Post by lynx44 »

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: Select all

./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: Select all

./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
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

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!!!!!
Guest

Post by Guest »

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.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

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.
lynx44
Posts: 12
Joined: Wed Jun 01, 2005 7:58 pm

Post by lynx44 »

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: Select all

./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
Savoury SnaX
Posts: 3
Joined: Wed Jun 22, 2005 4:35 am

Post by Savoury SnaX »

outpatch will generate a file outp from out . it is this outp that needs to be put into the pbp.
lynx44
Posts: 12
Joined: Wed Jun 01, 2005 7:58 pm

Post by lynx44 »

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

-Matt
jboldiga
Posts: 27
Joined: Mon Jun 20, 2005 10:16 am

Post by jboldiga »

Post Reply