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 

Hello world simple application : 80020148 error.

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



Joined: 09 Oct 2008
Posts: 18

PostPosted: Thu Oct 09, 2008 7:33 am    Post subject: Hello world simple application : 80020148 error. Reply with quote

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



Joined: 06 Jul 2008
Posts: 70

PostPosted: Thu Oct 09, 2008 7:47 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
flyboy2012



Joined: 07 Oct 2008
Posts: 11

PostPosted: Thu Oct 09, 2008 8:09 am    Post subject: Reply with quote

This does not require the 1.50 kernel addon

Makefile:
Code:

TARGET = Hello World
OBJS = main.o

PSP_FW_VERSION = 380
BUILD_PRX = 1 

INCDIR =
CFLAGS = -G4 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Donkey_Lesson1


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

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



main.c:
Code:

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

//callbacks
PSP_MODULE_INFO("Hello World", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0)
int main()
{
    //Initialization of the Oslib library
    oslInit(0);

    //Initialization of the graphics mode
    oslInitGfx(OSL_PF_8888, 0);

    //Initialization of the text console
    oslInitConsole();

    //Print on the screen this text
    oslPrintf("Hello World");

    //Wait for a button to be pressed
    oslWaitKey();
   
    //terminate the program
    oslEndGfx();
    oslQuit();


This should work if it dosent please reply
Back to top
View user's profile Send private message Send e-mail
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Thu Oct 09, 2008 8:49 am    Post subject: Reply with quote

Instead of typing:

Code:
make


or

Code:
make kxploit


Type:

Code:
make BUILD_PRX=1


Copy the single EBOOT.PBP to a folder in your GAME4XX directory.

Run it.

Win.
Back to top
View user's profile Send private message
flyboy2012



Joined: 07 Oct 2008
Posts: 11

PostPosted: Thu Oct 09, 2008 9:20 am    Post subject: Reply with quote

i always type
Code:
make
Back to top
View user's profile Send private message Send e-mail
dennis96411



Joined: 06 Jul 2008
Posts: 70

PostPosted: Thu Oct 09, 2008 9:23 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Oct 09, 2008 10:12 am    Post subject: Reply with quote

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



Joined: 04 Mar 2008
Posts: 40

PostPosted: Thu Oct 09, 2008 6:36 pm    Post subject: Reply with quote

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



Joined: 09 Oct 2008
Posts: 18

PostPosted: Fri Oct 10, 2008 8:05 am    Post subject: Reply with quote

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