Hello world simple application : 80020148 error.
Hello world simple application : 80020148 error.
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.
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.
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
-
- Posts: 11
- Joined: Tue Oct 07, 2008 8:50 am
This does not require the 1.50 kernel addon
Makefile:
main.c:
This should work if it dosent please reply
Makefile:
Code: Select all
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: Select all
//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();
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm
Instead of typing:
or
Type:
Copy the single EBOOT.PBP to a folder in your GAME4XX directory.
Run it.
Win.
Code: Select all
make
Code: Select all
make kxploit
Code: Select all
make BUILD_PRX=1
Run it.
Win.
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
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
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