Hello world simple application : 80020148 error.

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

Moderators: cheriff, TyRaNiD

Post Reply
bubugian
Posts: 18
Joined: Thu Oct 09, 2008 7:20 am

Hello world simple application : 80020148 error.

Post by bubugian »

Hi all,
sorry for stupid question, I'm a noob.
Before writing here I did some searches over the net and inside the forum but I did not find anithing useful, so please, pe patient. Help me.

After havin fight with toolchain installation over ubuntu 8.04, I try to code with simple (a thing that does not work is simple) helloworld application (from psp-programming website)
I have this main.c :

[code]
#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO("Hello World", 0, 1, 1);

#define printf pspDebugScreenPrintf

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;

cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);

sceKernelSleepThreadCB();

return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;

thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}

return thid;
}

int main() {
pspDebugScreenInit();
SetupCallbacks();
printf("Hello World");
sceKernelSleepThread();
return 0;
}
[/code]

and following Makefile:
[code]
TARGET = hello
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World
PSPSDK := $(shell /usr/local/pspdev/bin/psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
[/code]

Compilation messages are ok (or at least seems to be ok to me )
[code]
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -c -o main.o main.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx main.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o hello.elf
psp-fixup-imports hello.elf
psp-prxgen hello.elf hello.prx
mksfo 'Hello World' PARAM.SFO
pack-pbp EBOOT.PBP PARAM.SFO NULL \
NULL NULL NULL \
NULL hello.prx NULL
[0] 408 bytes | PARAM.SFO
[1] 0 bytes | NULL
[2] 0 bytes | NULL
[3] 0 bytes | NULL
[4] 0 bytes | NULL
[5] 0 bytes | NULL
[6] 92026 bytes | hello.prx
[7] 0 bytes | NULL
[/code]

I have a PSP FAT with CF 4.01M33-2.
I put generated hello and hello% folder inside my PSP/GAME150 folder and I obtain a wonderful 80020148 error.
I try also with eboot.pbp (GAME150 and GAME) without success...

Are main.c, Makefile ok ? Is the output of compilation ok?
I put hello and hello% folder inside GAME150... is it correct ?
Where I shoud copy hello.prx ?
Does CF4.01M33-2 require some other stuff ?
What I'm doing wrong ?

I also try 'controller' sample from sdk with same result...

Any ideas ?
Please help me...

Thanks very much to all
regards, b.
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Did you install 1.5 kernel for 4.01 M33?
My PSP's Firmware:
5.00 M33-6 w/ LEDA 0.2

My PSP's Motherboard:
TA-088

My PSP's Model:
PSP-2001 (Slim)
flyboy2012
Posts: 11
Joined: Tue Oct 07, 2008 8:50 am

Post by flyboy2012 »

This does not require the 1.50 kernel addon

Makefile:

Code: Select all

TARGET = Hello World
OBJS = main.o

PSP_FW_VERSION = 380
BUILD_PRX = 1  

INCDIR = 
CFLAGS = -G4 -Wall -O2 
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$&#40;STDLIBS&#41;$&#40;YOURLIBS&#41;


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Donkey_Lesson1


PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak

PSP_MODULE_INFO&#40;"Hello World", 0x1000, 1, 1&#41;;

main.c:

Code: Select all

//OSlib header file
#include <oslib/oslib.h>

//callbacks
PSP_MODULE_INFO&#40;"Hello World", 0, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;
int main&#40;&#41;
&#123;
    //Initialization of the Oslib library
    oslInit&#40;0&#41;;

    //Initialization of the graphics mode
    oslInitGfx&#40;OSL_PF_8888, 0&#41;;

    //Initialization of the text console
    oslInitConsole&#40;&#41;;

    //Print on the screen this text
    oslPrintf&#40;"Hello World"&#41;;

    //Wait for a button to be pressed
    oslWaitKey&#40;&#41;;
    
    //terminate the program
    oslEndGfx&#40;&#41;;
    oslQuit&#40;&#41;;
This should work if it dosent please reply
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Instead of typing:

Code: Select all

make
or

Code: Select all

make kxploit
Type:

Code: Select all

make BUILD_PRX=1
Copy the single EBOOT.PBP to a folder in your GAME4XX directory.

Run it.

Win.
flyboy2012
Posts: 11
Joined: Tue Oct 07, 2008 8:50 am

Post by flyboy2012 »

i always type

Code: Select all

make
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Wait, it had Hello and Hello% folder, which is an 1.5 kernel homebrew, that I know of. Or, you compiled a 3.xx kernel of it, but put it in the wrong folder.
My PSP's Firmware:
5.00 M33-6 w/ LEDA 0.2

My PSP's Motherboard:
TA-088

My PSP's Model:
PSP-2001 (Slim)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

If you build a PRX, be sure to set the heap size or it'll most likely run out of memory. The default heap size is only 64K for PRXs.
whistler
Posts: 39
Joined: Tue Mar 04, 2008 7:08 am

Post by whistler »

its obvious from your compiler output that you didn't type "make kxploit" so why are you using 2 folders hello and hello%?

just type make clean then make, put the generated eboot in a folder called hello and then put the hello folder in ms0:/psp/game4xx
bubugian
Posts: 18
Joined: Thu Oct 09, 2008 7:20 am

Post by bubugian »

Hi all,
after having made a lot of test, I have definitively ascertained that the problem's origin is the the toolchain.
In fact, Eboot.pbp created from my system fail to run also on other psps.
Same code and Makefile compiled in other system originate a correct Eboot.psp that runs perfectly ALSO on my psp..

So the problem is the toolchain...

Thread will continue on a new post:
[url] http://forums.ps2dev.org/viewtopic.php?p=75312#75312 [/url]

Thanks all for help!
b
Post Reply