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 

Help newbie

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



Joined: 26 Mar 2005
Posts: 2

PostPosted: Sat Mar 26, 2005 11:12 pm    Post subject: Help newbie Reply with quote

Hi !
I'm totally a newbie to PS2 programming so sorry for my stupidness, just recently take a look at PS2SDK. I also coded some simple programs, work fine on Naplink but totally failed from other loaders such as LaunchELF even the "Hello world" that was bundled in PS2SDK1.2

I did these steps for the "Hello world !" ELF:
FTP -> mc0:/HELLO.ELF --> boot LaunchELF -->FileBrower --> execute --> freeze...nothing

(Here Helloworld from PS2SDK for your easy ref.)
Code:

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>
#include <sifrpc.h>
#include "sio.h"

int main()
{   
   SifInitRpc(0);
/*
   init_scr();
   scr_printf("Hello, world!\n"); // hello world in the screen
*/
   printf("Hello, world!\n");
   nprintf("Hello, again, from Naplink RPC!\n");
   
   sio_init(115200, 0, 0, 0, 0);
   sio_printf("Hello from EE SIO!\n");

   /* Return to the bootloader or PS2 browser. */
   SleepThread();
}


This is a quite simple program but I still can not execute it from the MC. Did I do something wrong ? Do we have to manually reset IOP in our programs ?

Moreover, how do we know the location that our ELF was loaded ? Supposed to be in arg[0] but see nothing in Naplink.

Thx
NEWBIE
Back to top
View user's profile Send private message
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sun Mar 27, 2005 1:58 am    Post subject: Reply with quote

which version of ps2link are you using? are you modded or using swap/exploit?

I have problems with the 1.30 version (Im with a mod chip) that is floating around, best to go with the v1.24 from the link on ps2dev.org - it was built with a myriad of IRX versions that seem to really work well together -http://ps2dev.org/kb.x?T=1078 - you will need to upload the IRX's from the zip along with the elf to make it work.

Make sure you have the config file done up with your proper IP too, although Im sure you already know that since it did upload.

Hope that helps, hello world worked for me, all it really does is echo "Hello world" back through to ps2link, the screen if you include debug.h and the debug lib (if you look for one of my other posts on this you can download the source to an updated version I did that compiled from the getgo) and the sio cable.
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Sun Mar 27, 2005 5:09 am    Post subject: Re: Help newbie Reply with quote

PS2Newbie wrote:

Moreover, how do we know the location that our ELF was loaded ? Supposed to be in arg[0] but see nothing in Naplink.

Unfortunatly Naplink does not provide the boot location via argv[0] like it should.
There are a couple other rare cases such as reload1 that you won't have argv[0] information, but when argv[0] is not present you can usually still figure out where you were booted from 99% of the time.. PS2link does (or at least used to) contain an example of how to do that.. The best thing would be for all the loaders to get fixed though ;)
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
PS2Newbie



Joined: 26 Mar 2005
Posts: 2

PostPosted: Sun Mar 27, 2005 3:12 pm    Post subject: Reply with quote

Thx all for promt reply !
Modded PS2, dont use PS2Link, use Naplink instead but the problem didn't come from Naplink. My problem is that I have tried to launch the Hello example of PS2SDK from LaunchELF 3.33 at the location mc0:\MyApp\HELLO.ELF but totally failed, it's freezed. It's work fine on Naplink.

Quote:

I have problems with the 1.30 version (Im with a mod chip) that is floating around, best to go with the v1.24 from the link on ps2dev.org - it was built with a myriad of IRX versions that seem to really work well together -http://ps2dev.org/kb.x?T=1078 - you will need to upload the IRX's from the zip along with the elf to make it work.

Make sure you have the config file done up with your proper IP too, although Im sure you already know that since it did upload.


How can I directly execute my homebrew app from MC via loader such as LaunchELF not PS2Link? Need to patch something ?

Thank Drakonite for your helps, I will try to figure out the executed path of my ELF.
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Sun Mar 27, 2005 6:01 pm    Post subject: Reply with quote

the execution isn't failed and crashed like you think simply it doesn't show anything to tv and without ps2link you can't read what printf does

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>
#include <sifrpc.h>
#include "sio.h"

int main()
{
SifInitRpc(0);
//see there you commented the only thing that will show up on screen
//you need to uncomment them to see something with launchelf launching it
/*
init_scr();
scr_printf("Hello, world!\n"); // hello world in the screen
*/
printf("Hello, world!\n");
nprintf("Hello, again, from Naplink RPC!\n");

sio_init(115200, 0, 0, 0, 0);
sio_printf("Hello from EE SIO!\n");

/* Return to the bootloader or PS2 browser. */
SleepThread();
}
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sun Mar 27, 2005 6:25 pm    Post subject: Reply with quote

cory1492 wrote:
all it really does is echo "Hello world" back through to ps2link, the screen if you include debug.h and the debug lib (if you look for one of my other posts on this you can download the source to an updated version I did that compiled from the getgo) and the sio cable.

if you grab that source I edited it prints hello world to the screen as well...
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 -> PS2 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