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 

PSPLINK
Goto page Previous  1, 2, 3, 4, 5 ... 9, 10, 11  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Wed Mar 15, 2006 8:53 am    Post subject: Reply with quote

Any ideas on why .elf files won't run? Does anyone else see this problem? It would greatly streamline my efforts to not have to create .prx or eboot files during the debug process...
Back to top
View user's profile Send private message
ginka



Joined: 17 Feb 2006
Posts: 15

PostPosted: Wed Mar 15, 2006 9:42 am    Post subject: Reply with quote

Sharkus wrote:
Any ideas on why .elf files won't run? Does anyone else see this problem?


Nope - it works fine for me. I compile with '-g' and I can then run it as 'ld ./ck.elf', './ck.elf' or 'debug ./ck.elf' if I want to run psp-gdb.
Back to top
View user's profile Send private message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Wed Mar 15, 2006 12:14 pm    Post subject: Reply with quote

Hmmm... Very frustrating. Here's my configuration:

WinXP / Cygwin
Latest toolchain / sdk (SVN revision 1835)
PSPLink v0.9d
using usbhostfs / pcterm

PSPLink configuration:

Code:

usbmass=1
usbhost=1
pluser=1
resetonexit=1
sioshell=0
wifi=0
wifishell=0
usbshell=1
usbgdb=1
conshell=0
consinterfere=0


I've tried the following sample apps from the SDK (along with the app which I'm workin on which fails with a 0x800200D2):

controller/controller_basic (Error: 0x800200D2)
gu/sprite (Error: 0x800200D9)
gu/cube (Error: 0x800200D2)

pspkerror.h file shows 0x800200d2 = SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT and 0x800200D9 = SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED. Unfortunately, neither really shed much light on why these don't work as .elf but do work as .prx...

Any guidance would be appreciated.
Back to top
View user's profile Send private message
ginka



Joined: 17 Feb 2006
Posts: 15

PostPosted: Wed Mar 15, 2006 1:24 pm    Post subject: Reply with quote

I tried all three elfs and they worked. My config:

Linux
latest sdk/psplink 0.9d
usbhostfs/pcterm

Here's some output from the controller:
Quote:

host4:/controller/basic/> ls
Listing directory host4:/controller/basic/
drwxr-xr-x 4096 14-03-2006 22:22 .
drwxr-xr-x 4096 09-02-2006 14:05 ..
-rw-r--r-- 39056 14-03-2006 22:22 EBOOT.PBP
-rw-r--r-- 304 08-03-2006 12:53 Makefile
-rw-r--r-- 256 14-03-2006 22:22 PARAM.SFO
-rwxr-xr-x 165582 14-03-2006 22:22 controller_basic.elf
-rw-r--r-- 2953 08-03-2006 12:53 main.c
-rw-r--r-- 4348 14-03-2006 22:22 main.o

host4:/controller/basic/> ld ./controller_basic.elf
Load/Start host4:/controller/basic/controller_basic.elf UID: 0x039B9F19 Name: CONTROLTEST

---< did a reset >----

host4:/controller/basic/> debug ./controller_basic.elf

host4:/controller/basic/> PSPLink USB GDBServer (c) 2k6 TyRaNiD/Lovely2
GDBServer: Loaded host4:/controller/basic/controller_basic.elf - UID 0x0280E409

The sprite ran fine in both modes as well. I'm sorry I can't give any other help. My psplink.ini is almost the same, except 'usbmass=0'
Back to top
View user's profile Send private message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Wed Mar 15, 2006 2:34 pm    Post subject: Reply with quote

I tried it on my Linux box (that has a slightly older build of the SDK). Loading .elf files work just fine there... I'll upgrade to the latest SDK (to match my Cygwin configuration) and post my results.

**UPDATE**

Everything works fine on my Linux box (with the latest build of everything). This is a bit disappointing. Looks like I need to install Linux on my laptop and ditch the whole cygwin business...

**NEW UPDATE**

On my Cygwin box I deleted my entire pspdev directory and started over (i.e. reran the latest toochain script). Things are working great now! The complete delete and rebuild is probably a recommendation that should be made when people are having random problems.
Back to top
View user's profile Send private message
AtaruZ



Joined: 09 Mar 2006
Posts: 14
Location: Italy

PostPosted: Thu Mar 16, 2006 8:28 pm    Post subject: Eclipse and gdb Reply with quote

Hello everybody!
I've managed to build pspsdk samples within the Eclipse IDE (very powerful and, above all, cross-platform IDE) and launch them via PSPLINK (USB connected) on my AMD64 Gentoo box.

I've also built psp-gdb and managed to run it from Eclipse and from command line. Setting remote gdb to localhost port 10001 works. The debugger connects and the first automatic bp (start) activates.
After this, I'm not able to break at any other place (like main or line number) and I'm stuck on it...
I've tried it from Eclipse and from command-line psp-gdb.

In psp-gdb the behaviour is the following (assuming cube example under gu):

- when I type "break main" in gdb, looks like it wants to create a BP in the crt0.c file (if I remember well).
- if I type "break 131" (where 131 is a line number where I've put a printf statement), he tries to put this BP in the crt0.c file.
-If I type "break cube.c:131" gdb complaints that there's any cube.c file!

Arghh!!!

Is there something I'm missing?
For building, I've just typed "make all" nd obtained th file "cube.elf" and I'm debugging it under PSPLINK (d cube.elf) and under gdb (psp-gdb cube.elf and the remote stuff).
Maybe "normal" programs can't be debugged so easy? Where's my mistake? Please give me a hand!

Thanks for your time in reading this crap from a n00b PSP (semi-alpha-pre)programmer! :D

AtaruZ
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 17, 2006 2:56 am    Post subject: Reply with quote

AtaruZ it looks like you are not compiling cube.elf with debugging symbols, change the makefile so that you have -ggdb (just -g will work as well) in the CFLAGS and rebuild it. The reason it is failing is most likely because crt0.c was the only file in the entire executable which has debugging symbols so it gets itself confused :)
Back to top
View user's profile Send private message
AtaruZ



Joined: 09 Mar 2006
Posts: 14
Location: Italy

PostPosted: Fri Mar 17, 2006 9:12 am    Post subject: Reply with quote

Oooh, thanks a lot for the tip TyRaNiD!
Now it works like a charm under Eclipse! I'me ready to code something useful now, no more excuses!!!

Again, thanks a lot for this great tool (PSPLINK, of course) and for all your efforts in PSP developing!
I hope to be able to help then scene somehow and to improve my programming skills as much as possible!

Bye!

AtaruZ
Back to top
View user's profile Send private message
hubevolution



Joined: 17 Mar 2004
Posts: 32

PostPosted: Fri Mar 17, 2006 6:43 pm    Post subject: Reply with quote

from what I have read I understand that I can run psplink on a 2.01 psp using GTA eloader and the shell will work in usb mode since libusb works under usermode am I right ? So I can finally stop reloading GTA everytime I compile my homebrew code?
Please tell me that this is correct will be the end of a nightmare !! :)
Back to top
View user's profile Send private message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Fri Mar 17, 2006 7:47 pm    Post subject: Reply with quote

I ran into a problem where the stat() routine does not quite work properly for files on hostx:/

Basically, the mode member of the stat structure only returns the lower octlet (permissions), with the upper octlet always set as zero, which causes failures if applications use the mode to determine if something is a file or directory.
Back to top
View user's profile Send private message
hubevolution



Joined: 17 Mar 2004
Posts: 32

PostPosted: Fri Mar 17, 2006 9:26 pm    Post subject: Reply with quote

ok had a look at the code ... all kernel mode .. and the prx loading is a big issue for making it work under user mode ...
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Mar 18, 2006 2:45 am    Post subject: Reply with quote

Sharkus, oki will fix that. You can of course determine what the type of file is from the attr value as well but it really should be replicated in the mode value :)
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Mar 18, 2006 3:07 am    Post subject: Reply with quote

hubevolution, not sure where you read that psplink can run on 2.01. It is 1.0 and 1.5 only due to (as you have found out) requiring kernel mode. There is no way of getting around that until someone works out how to break into kernel mode on higher psp revisions. Sorry.
Back to top
View user's profile Send private message
jimbo



Joined: 31 Mar 2005
Posts: 6
Location: Sunny Southern CA

PostPosted: Tue Mar 21, 2006 5:10 pm    Post subject: Reply with quote

I'm looking forward to trying this out, but I can't get the USB shell to respond. I'm running Win2k / Cygwin and PSPLink v0.9d.

my psplink.ini:
Code:

usbmass=0
usbhost=1
pluser=1
resetonexit=1
sioshell=1
wifi=0
wifishell=0
usbshell=1
usbgdb=1
conshell=1
consinterfere=0
pcterm=1

I run psplink on the psp and it outputs "PSPLINK User Module v0.9d" on a black screen.

usbhostfs_pc.exe outputs "Connected to device". After I execute pcterm it outputs "Accepting shell connection from 127.0.0.1".

I run pcterm as follows:
$ ./pcterm.exe -p 10000 localhost
and it outputs "Opening connection to localhost port 10000"

But I get no prompt in pcterm, pressing enter just gives me a linefeed on a blank line. Is there something I'm forgetting?
Back to top
View user's profile Send private message Visit poster's website AIM Address
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Mar 22, 2006 3:04 am    Post subject: Reply with quote

Well there is a bug in the usb shell that it doesn't wait for the connection to be made before actually printing out anything useful, either update psplink from svn or when you connect try typing somthing like ? and hit enter and see if you get no response. If still nothing then it might just a cygwin bug.

As you have conshell enabled do you get a host0:/> being printed on the screen at all?

Also I would probably disable sioshell and conshell anyway if you are just using usb.
Back to top
View user's profile Send private message
Phantom8



Joined: 17 Jun 2005
Posts: 30

PostPosted: Wed Mar 22, 2006 3:24 pm    Post subject: Reply with quote

I've experienced Memory Stick corruption when enabling usbmass storage. If you turn on usb mass storage, copy a file from PC to MS. Turn off usb mass storage with "usbmoff". Create a file on the MS with one of the shell command, like memdump. Then, your MS will have a 50% of chance being corrupted. If you reboot your PSP and connect USB via XMB, run chkdsk from PC on the MS. You'll most likely see a cross linked allocated unit between the file you copy from PC to MS and the file you've created with memdump.

I've repeated the above procedures several times with a newly formatted MS and encountered the same problem. It seems to me there are some cache coherence issue even after you switch off USB mass storage.
Back to top
View user's profile Send private message
alain91



Joined: 01 Mar 2006
Posts: 13

PostPosted: Thu Mar 23, 2006 7:15 pm    Post subject: usbhostfs binary Reply with quote

would it be possible to get the pc side software (pcterm & usbhostfs) already compiled ?

Thanks a lot,
Alain - alain.cnc@gmail.com
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Thu Mar 30, 2006 6:30 am    Post subject: Reply with quote

Holy mother of God!

TyRaNiD man, I take my hat off to you!

This is the most useful tool I've come across for PSP dev! I'm using WiFi mode at the moment as getting parts from the States to out here takes a few days, so I was going to wait until I'd finished my SIO cable. But I got impatient and thought I'd try it now!

Wow! That's all I can say. Wow!

If you have a PayPal donation thingy anywhere, I'd be happy to throw you a few bucks just for the amount time you've saved me from constantly resetting the PSP & manually loading the files up, let alone all the debug tools you've coded in too!

Big thumbs up man, keep up the good work!
Back to top
View user's profile Send private message
Oobles
Site Admin


Joined: 17 Jan 2004
Posts: 362
Location: Melbourne, Australia

PostPosted: Thu Mar 30, 2006 8:38 pm    Post subject: Reply with quote

In my long tale of trying to get loadable modules into LuaPlayer, I used a bit of code from psplink to get a specific export from a PRX. I used libsFindExportAddrByName to get a valid export. I then tried calling the export, however, I got an exception. Have you checked the function to see if the addresses it returns are correct?

David aka Oobles.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 31, 2006 3:31 am    Post subject: Reply with quote

white rabbit, thx glad you find it useful. Out of interest though why have you not tried to use the USB mode, it is far superior to the wifi shell in almost every respect, I actually use it almost exclusively, only reverting to SIO when I really need Kprintf support.

I do not have a paypal account nor will I ever to take donations, thx for the offer though. I just don't agree with donations in homebrew psp dev, just feel it is against the spirit of it :) If you really have money to burn perhaps getting in touch with oobles to donate some cash towards to running pspdev.org would be best, without this site psp dev would be a worse place (if it really even existed).

And Oobles, that function is used in psplink as part of the decode addr code and the apihooker, I have used it successfully before. What is the actual exception you are getting, perhaps it is actually crashing inside the function it self.
Back to top
View user's profile Send private message
__count



Joined: 23 Mar 2006
Posts: 22

PostPosted: Sat Apr 01, 2006 11:25 pm    Post subject: Reply with quote

I finally sat down and setup PSPLINK and was it ever worth it. My usual turnaround time of 15 seconds practically disappeared. The pdf manual is great too.

Thanks so much TyRaNiD and others who contributed.

One note to other WinXP/Cygwin users, if you find inf-wizard.exe (of the usb-win32 lib) keeps crashing, try changing the name of the vendor and device to something without spaces (e.g. 'PSPLINK'). That worked for me.
Back to top
View user's profile Send private message
Oobles
Site Admin


Joined: 17 Jan 2004
Posts: 362
Location: Melbourne, Australia

PostPosted: Sun Apr 02, 2006 3:20 pm    Post subject: Reply with quote

I'm still not having any success with calling the export. The address I get back from libsFindExportAddrByName is 0x08876DE4. I'm assuming I can simply call into this address? eg

Code:

luaC_function f = libsFindExportAddrByName( id, "simple", "init" );
f( L );


libsFindExportAddrByName is exported from a kernel mode prx and called via syscall from a usermode prx. The function is a usermode prx being called from another usermode prx.

I get an exception of the following:

Exception - Bus error (instr)
Thread ID - 0x04FDCC65
Th Name - User Mode Thread
Module ID - 0x04FE6337
Mod Name - simple
EPC - 0x08876DE4
Cause - 0xA0000018
Status - 0x20008613
BadVAddr - 0x00010020
zr:0x00000000 at:0x0008FF00 v0:0x08876DE4 v1:0x00000018
a0:0x08B65480 a1:0x08B784E8 a2:0x882272A0 a3:0x00000001
t0:0x00000030 t1:0x00000000 t2:0x0000001C t3:0x00000007
t4:0x09FFF9D0 t5:0x00000E00 t6:0x089E9898 t7:0x00008600
s0:0x08B77998 s1:0x08B65480 s2:0x00000006 s3:0x00000000
s4:0x00000000 s5:0x08B65480 s6:0x00000198 s7:0x00000000
t8:0x00000001 t9:0x880107E0 k0:0x09FFFF00 k1:0x00000000
gp:0x08A3A970 sp:0x09FFFB70 fp:0x09FFFB70 ra:0x089194BC

Any ideas what I might be doing wrong?

David. aka Oobles.
[/code]
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Oobles
Site Admin


Joined: 17 Jan 2004
Posts: 362
Location: Melbourne, Australia

PostPosted: Mon Apr 03, 2006 11:16 pm    Post subject: Reply with quote

Thanks to TyRaNid and the wonders of psplink, I worked out the problem. Turned out that libsFindExportAddrByName was returning a pointer to a pointer to the function.

David. aka Oobles.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
GenericBum



Joined: 07 Jan 2006
Posts: 17

PostPosted: Tue Apr 04, 2006 1:30 pm    Post subject: Reply with quote

First off.. Kudos to TyRaNiD for the awesome work on this project. :)

I just had to rebuild my development laptop, so I did the install of cygwin and a full rebuild of the toolchain. I pulled PSPLink from SVN.

When I compile I get this error right at the end during the link process for psplink.elf:

/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -lpsppower_driver

I've research psppower_driver and cannot find much at all. There is a psppower library.. but no psppower_driver that I can find.

Any help would be much appreciated.
Thanks,
GenericBum
Back to top
View user's profile Send private message
GenericBum



Joined: 07 Jan 2006
Posts: 17

PostPosted: Tue Apr 04, 2006 2:55 pm    Post subject: Reply with quote

Hmm..

I was able to change the last line of the psplink/psplink/Makefile from:

LIBS += -lpsphprm_driver -lpsppower_driver

to:

LIBS += -lpsphprm_driver -lpsppower

That enabled the project to compile.

GenericBum
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue Apr 04, 2006 3:22 pm    Post subject: Reply with quote

Yes well the reason for that is I just added psppower_driver to pspsdk :) Gota love them random changes I make to to the sdk to support my further goals.

For info using psppower will work but it is suboptimal, psppower_driver is a direct kernel library which should be slightly better.
Back to top
View user's profile Send private message
GenericBum



Joined: 07 Jan 2006
Posts: 17

PostPosted: Tue Apr 04, 2006 3:25 pm    Post subject: Reply with quote

Excellent- that makes sense. Should I reget the sdk and rebuild?

For the moment, I've gotten the windows driver installed, but I'm working through the documentation to build usbhostfs_pc.

So far so good. Everything has been well explained in the docs.

GenericBum
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue Apr 04, 2006 3:38 pm    Post subject: Reply with quote

Well it should still work using the usermode power driver but it is probably recommended to rebuild the sdk and then rebuild psplink. For future use if you find psplink suddenly stops building due to missing libraries it will almost certainly be me messing with pspsdk :)
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Wed Apr 05, 2006 6:37 pm    Post subject: Reply with quote

Hi TyRaNiD,

More props for the updates!

I don't use usb because going through this thread, nullp01nter showed a pic of some hardware for a usb device. I assumed you needed this, so just forgot about it. I assume now that I don't, so I'll have a go with the usb tonight (RTFM peoperly huh!).

I also have the kit delivered for the SIO<->RS232 so I will get soldering over the weekend.

I have noticed one thing though - and I assume it's my fault. When my app exits through the home key, I end up needing to reset the PSP by holding the power switch up. I can't work out why, as it exits fine when run directly from the main shell. It's ok, as I just reset, but it'd be nice if I could fix it. I just noticed the entry in the FAQ that looks like what I have, so I'll give that a go tonight.

oobles - You will have PM in a moment.

Thanks again!
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Apr 06, 2006 1:55 am    Post subject: Reply with quote

white_rabbit, yes for USB mode you only need a normal mini-b to a USB cable, not the complete serial device. As for your app not exiting, I assume you mean to the Sony shell? psplink traps sceKernelExitGame, it can either reset psplink (back to itself) or not do anything at all, you can then do the reset yourself using the shell. That is configurable in the config file. Of course if it is just completely locking the system up then that is more of a problem. If you want to go back to Sony's shell then you use the exit command in psplink.
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
Goto page Previous  1, 2, 3, 4, 5 ... 9, 10, 11  Next
Page 4 of 11

 
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