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 does not work

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



Joined: 10 Dec 2006
Posts: 5

PostPosted: Sun Dec 10, 2006 6:01 am    Post subject: Hello World does not work Reply with quote

Last month I picked up a PSP with fw2.71.
This weekend I decided to write a homebrew.After reading some articles,I built the PSP Dev Environment ,compiled the HelloWorld sample,copy them to PSP(ms:/PSP/GAME/).But it does not work...

when running this HelloWorld(tow different results with different make options):
if using "make":a error "80020148" occur
elesif using "make kxploit": program stops,and shut down in seconds

My PSP Environment:
FW2.7, HENB AND devhook0.45(it might not related)

My Dev Environment:
Linux,psp sdk built with toolchain.sh,automake 1.9

Code and Make file(it's a sample from Internet):
Code:

/// Hello World - My First App for the PSP

/*
      This program was created by (Your Name Here) on (Date Here)
      It is a simple "Hello World" Application.
*/
#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO("HelloW", 0x0000, 1, 4);

#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("Callback Thread",CallbackThread,0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
      if(thid >= 0) {
            sceKernelStartThread(thid, 0, 0);
      }   

      return thid;
}

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



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 psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Any suggestion and help are welcome...thanks...
Back to top
View user's profile Send private message
TUniqueW



Joined: 09 Dec 2006
Posts: 12

PostPosted: Sun Dec 10, 2006 7:25 am    Post subject: Reply with quote

HEN B only loads .elf's .... update to HEN-D then you can load 2.71 kerlen eboots ..... OR else use your devhook and emulate 2.71 then load it from there.

Best,
TUW
_________________
Developer: C/C++ knows nothing about assembly!
Back to top
View user's profile Send private message MSN Messenger
surfchen



Joined: 10 Dec 2006
Posts: 5

PostPosted: Sun Dec 10, 2006 4:46 pm    Post subject: Reply with quote

thanks..
But I found that many homebrews can run under henb and without devhook..

How can they do that?
Back to top
View user's profile Send private message
TUniqueW



Joined: 09 Dec 2006
Posts: 12

PostPosted: Sun Dec 10, 2006 5:41 pm    Post subject: Reply with quote

surfchen wrote:
thanks..
But I found that many homebrews can run under henb and without devhook..

How can they do that?

I think you may can find how to make them for HEN in HEN SDK (but thats for HEN-D but it may help).....
HEN uses 2.71's kernel so your limited in making hombrew for it.

and finally,
your welcome :D
_________________
Developer: C/C++ knows nothing about assembly!
Back to top
View user's profile Send private message MSN Messenger
surfchen



Joined: 10 Dec 2006
Posts: 5

PostPosted: Sun Dec 10, 2006 8:07 pm    Post subject: Reply with quote

Hi, TUniqueW, I have updated to hend.But my helloworld still not works. :(

Could anyone code a sample homebrew which can compiled and runs on 2.71 for me?
Back to top
View user's profile Send private message
Ramon



Joined: 29 Jun 2006
Posts: 17

PostPosted: Mon Dec 11, 2006 9:32 pm    Post subject: Reply with quote

In your makefile, there are spaces at the end of some lines. Try removing it. (I think I had the same problem...)
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