PSPLINK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

cdevine wrote:I've been trying to make a PRX module to catch exceptions generated from the shell:
If you want to debug vsh, you can just fire up psplink and load it. See scripts/loadvsh.sh in the psplink dir.
cdevine
Posts: 6
Joined: Sat Dec 30, 2006 1:54 am

Post by cdevine »

jimparis wrote:
cdevine wrote:I've been trying to make a PRX module to catch exceptions generated from the shell:
If you want to debug vsh, you can just fire up psplink and load it. See scripts/loadvsh.sh in the psplink dir.
Wow, I had no idea ^^ At least I learned a couple things about the coding of kernel modules :)

EDIT: currently running in a couple issues

It seems to prx cannot be loaded by psplink:

Failed to Load/Start module 'flash0:/vsh/module/common_gui.prx' Error: 0x80020001
Failed to Load/Start module 'flash0:/vsh/module/common_util.prx' Error: 0x80020001

However the XMB loads fine, but pcterm will not respond to any command. Then after running the tiff exploit the vsh freezes, but psplink does not catch the exception. Any idea?
cdevine
Posts: 6
Joined: Sat Dec 30, 2006 1:54 am

Post by cdevine »

cdevine wrote:However the XMB loads fine, but pcterm will not respond to any command. Then after running the tiff exploit the vsh freezes, but psplink does not catch the exception. Any idea?
Ok, this appears to be an issue with 2.71 SE-C, I downgraded to plain 1.50 and psplink is now working just fine.

TyRaNiD: do you think you could make psplink work with the VSH from newer firmware? this would be a great deal useful. Or open-source it and thus enable the community to add features :)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

cdevine wrote:Or open-source it and thus enable the community to add features :)
It is open source, look in pspdev svn.
cdevine
Posts: 6
Joined: Sat Dec 30, 2006 1:54 am

Post by cdevine »

jimparis wrote:
cdevine wrote:Or open-source it and thus enable the community to add features :)
It is open source, look in pspdev svn.
Indeed, thanks a lot. I'll see if I can fix this VSH problem.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well I assume you are probably running the old psplink using 1.5 mode on SE-C ? It stands little chance of working in that sort of mode I would guess. The load_vsh script is kinda deprecated anyway. The _proper_ way to do it on 1.5 at least is to do 'reset vsh' then 'ld flash0:/vsh/module/vshmain.prx'. The 2.71 port of psplink (which is part of the new psplinkusb under the svn branches) however doesn't support rebooting to a different operating mode, and even if it did you need to use a new function to load vshmain which psplink doesn't strictly support (although you could probably hack it to do so).
torakak
Posts: 4
Joined: Fri Dec 29, 2006 9:47 pm

Post by torakak »

Newbie alert! :)

I'm following the PDF example of use with the gu/sprite demo, and I'm getting a 0x80020001 error with sprite.elf. If I reset vsh before, then I get a 0x800200d9 error.

I'm on a 1.50 and using 2.0 final. Any idea/advice ?

TIA!
cdevine
Posts: 6
Joined: Sat Dec 30, 2006 1:54 am

Post by cdevine »

torakak wrote:I'm following the PDF example of use with the gu/sprite demo, and I'm getting a 0x80020001 error with sprite.elf. If I reset vsh before, then I get a 0x800200d9 error.

I'm on a 1.50 and using 2.0 final. Any idea/advice ?
Not 100% sure, but 0x80020001 could be SCE_ERROR_ERROR, which isn't helpful ;-) Also, 0x800200D9 = SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED. Perhaps your elf file is corrupted?
torakak
Posts: 4
Joined: Fri Dec 29, 2006 9:47 pm

Post by torakak »

cdevine wrote:
Not 100% sure, but 0x80020001 could be SCE_ERROR_ERROR, which isn't helpful ;-) Also, 0x800200D9 = SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED. Perhaps your elf file is corrupted?
No idea, I just compiled that elf from the gu/sprite sources. I'll try to find a working elf (tested on another psplink) on Friday when I get my psp back :)
onne
Posts: 24
Joined: Tue Aug 29, 2006 11:54 pm

Post by onne »

hi... I seem to be in the same situation now... :(

Previously I had everything working nicely with the devkitpro, and I could run my programs with usbhostFS and psplink 2.0. (fw 2.71 SE-B)

But for some weird reason when I installed cygwin and build the newest pspsdk from svn (to be able to debug with eclipse...) from the source, everything got messed up. The same software that worked nicely with psplink, now gives me the fore-mentioned
"Failed to Load/Start module 'host0:/myApp.elf' Error: 0x80020001"... The weird thing is that if I transfer the eboot to psp, it works normally.

I even tried the sprite example to make sure it was not my software that was giving the problem, but it gave the same result.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

I've got psplink 2.0 running on 3.03oe-B. It's installed in GAME150. Now I'm trying to debug PMP VLC now built as user mode prx ("host0:/> ./PMPVLC009Rev4_JockyW.prx").

The problem is that I'm not able to open and read the PMP config file using fopen/fgets/fclose. This has never before been a problem with psplink. The file "host0:/pmp.ini" isn't found though it is stored in the same directory as the prx. I also tried "ms0:/pmp.ini" (it *is* in the memstick root) with no luck either.

Code: Select all

    if ((ini=fopen(ininame, "r"))==NULL) {
        return NULL ;
    }
Why does this not work anymore?

One more thing, is it possible in Psplink to load and debug a user mode prx which uses Wlan with WPA? I tried with a modified version of PspPet's Wifi 0.3 demo. When I run it straight under 3.03oe-B ït works perfect with WPA. If I execute it in Psplink it returns with a driver load error and if I add the net drivers in psplink.ini it can not run with WPA but only with WEP.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

jockyw2001 wrote:I've got psplink 2.0 running on 3.03oe-B. It's installed in GAME150.
How did you set this up? Did you have to copy some of the prx's to seplugins?
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

J.F.: I did like this

Code: Select all

make clean; make release
cd release/pc/pcterm; make; cp pcterm.exe /usr/local/pspdev/bin
cd ../usbhostfs_pc; cp ../windows/lib/* .; make; cp usbhostfs_pc.exe /usr/local/pspdev/bin
Copy either release/v1.5 or release/v1.5_nocorrupt dirs to PSP/GAME150
Copy psplink.ini.usb over psplink.ini

When debugging I open two cygwin shells and in both I change to the dir where my executables are. Then in one shell I start usbhostfs_pc and in the other pcterm.

Works fine for 1.50 elfs, but for 3.03oe prxs I have problems as described in my prev post.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Okay... good. I think I'm doing everything right then. Just wanted to double-check. I've got a TA-082 with 3.03 OE-B, and if you've seen threads elsewhere, the idStorage for TA-082 is "corrupted" and prevents USBHOSTFS_PC from working correctly. I can tell you, it doesn't work.

They are supposed to release an EBOOT on thursday that allows you to view/backup/fix your idStorage keys. I'll be trying this again once I've fixed the keys in my PSP. I've got my PSP set for dev work, but I'd really like to be able to use usbgdb for debugging. I've gotten by before on just printf statements, but nothing beats being able to step through a buggy routine.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well you can get around the idstorage "bug" by modifying usbhostfs_pc to reflect the "fucked" vendor id and it will then connect quite happily. Also it is worth pointing out that it is possible to actually run under 3.03/2 OE (or in fact 2.71) using the psplinkusb in the subversion trunk.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Wow! I never looked in svn psp/branches before. What a nice surprise.

In the Makefile there is prolly a small error. After a make release:

Code: Select all

cp usbgdb/usbgdb.prx release_oe/psplink
cp boot271/EBOOT.PBP release_oe/psplink
cp: cannot stat `boot271/EBOOT.PBP': No such file or directory
make[1]: *** [release] Error 1
I realised that I have first to run make release in boot271 and then run make release in the top dir.

Also an error in the Makefile of pspsh. Line 4 should be:

Code: Select all

CFLAGS=-Wall -g -D_PCTERM -I../../../psplink
Unfortunately PSP crashes shortly after I start usbhostfs_pc.exe (release_oe/pc/usbhostfs_pc), there is no connect message either

Is there something wrong with my set up?

PS: The 1.50 version works fine except for the same probs as described above in: http://forums.ps2dev.org/viewtopic.php?p=50196#50196
Last edited by jockyw2001 on Wed Jan 24, 2007 9:59 am, edited 3 times in total.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

TyRaNiD wrote:Well you can get around the idstorage "bug" by modifying usbhostfs_pc to reflect the "fucked" vendor id and it will then connect quite happily. Also it is worth pointing out that it is possible to actually run under 3.03/2 OE (or in fact 2.71) using the psplinkusb in the subversion trunk.
I tried changing the vendor ID to what I got from /sbin/lsusb, but I don't get the "device connected" message. When I run PSPLink, I don't get anything for the PSP showing when I do /sbin/lsusb like when I have the PSP in USB mode. That's why I asked how jockyw2001 installed it on his PSP. I wasn't sure if the PSP not showing was because of the keys, or because PSPLink wasn't running correctly.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD: I tried psplinkusb on windows xp and couldn't get it to work. There is no connect and PSP shuts down after a short while. Can you suggest anything or should I just wait for a new revision.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Urm there is no reason that psplinkusb should crash your psp, I am not sure what to suggest.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

The psplinkusb 1.50 version which I copied to GAME150 works fine. The release_oe version I copied to GAME303 unfortunately doesn't work. I had a few build problems which you can find 4 posts up. Can it be because of that?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Hmm seems there is a strange problem, ill try and track it down. However it is related to modload.ini. If you create an empty modload.ini file in your 303 version of psplink it seems to not crash, how very odd.
onne
Posts: 24
Joined: Tue Aug 29, 2006 11:54 pm

compilation problem

Post by onne »

I'm trying to compile the PSPLINK from the source(svn), but I have a problem I don't understand. I have just got new cygwin, and even pspsdk(with the newest toolchain script form svn)...

This is what I get as error after executing 'make release':

Code: Select all

...
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -f
no-builtin-printf -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/link
file.prx -mno-crt0 -nostartfiles -nodefaultlibs  main.o shell.o config.o bitmap.o sio.o tty.o disasm.o decodeaddr.o memo
ryUID.o kmode.o exception.o parse_args.o psplinkcnf.o util.o script.o debug.o symbols.o libs.o apihook.o thctx.o stdio.o
 exports.o -lpspusb_driver -lpspusbstor -lpspumd -lpspdebug -lpspdisplay_driver -lpspctrl_driver -lpspsdk  -lpspkernel -
lpsphprm_driver -lpsppower_driver -lpspdisplay_driver -o psplink.elf
sio.o: In function `sioInit':
sio.c:(.text+0x138): undefined reference to `sceSyscon_driver_44439604'
collect2: ld returned 1 exit status
make[1]: *** [psplink.elf] Error 1
rm exports.c
make[1]: Leaving directory `/home/username/projects/psplink/psplink'
make: *** [all] Error 2
I guess I could edit the source since I mainly use USB anyway, but I'm not sure what the problem is related to.


EDIT: Ok... I just commented out the "sceSyscon_driver_44439604" definition and call from sio.c, and everything compiled fine. I have no idea of the side-effects though.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD wrote:Hmm seems there is a strange problem, ill try and track it down. However it is related to modload.ini. If you create an empty modload.ini file in your 303 version of psplink it seems to not crash, how very odd.
I got it to work by copying release_oe/psplink to GAME150. I can now load and debug PMPVLC009Rev4_JockyW.prx :)

My mistake was that I thought the release_oe version had to be copied to GAME303. Sorry for the trouble ...

But already I'm running into a new problem. The addr2line trace function seems not to work anymore. But why?

Code: Select all

Exception - Bus error (data)
Thread ID - 0x0463096B
Th Name   - net_thread
Module ID - 0x0463E34D
Mod Name  - PMP VLC Player 0.0.9
EPC       - 0x088244FC
Cause     - 0x1000001C
BadVAddr  - 0x00000000
Status    - 0x20008613
zr:0x00000000 at:0x0008FF00 v0:0x00000000 v1:0x8804FDC0
a0:0x00000001 a1:0x88050000 a2:0x88233020 a3:0x00000001
t0:0x00000030 t1:0x00000000 t2:0x0000001C t3:0x00000007
t4:0x09FFE678 t5:0x00000E00 t6:0x088244FC t7:0x00008600
s0:0x00144001 s1:0x00000007 s2:0xFFFFFFFF s3:0x00144001
s4:0x08B30000 s5:0xDEADBEEF s6:0xDEADBEEF s7:0xDEADBEEF
t8:0x00000001 t9:0x880107E0 k0:0x09FFEF00 k1:0x00000000
gp:0x08B4DE50 sp:0x09FFE678 fp:0x09FFEEC0 ra:0x088244FC

$ addr2line -f -e PMPVLC009Rev4_JockyW.prx 0x088244FC
??
??:0
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I noticed an issue with the PSP that might be related to my trouble getting PSPLink going in linux. When I run PMPMod(AVC) on the PSP, when it's connected to Windows, the PSP shows as a USB device much like when running in USB Mode from the XMB. When connected to linux, it says "USB Status: Disconnected". Any suggestions?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Okay fixed the modload problem, 303oe has a garbage value in its putchar function so when you enable it it crashes if you try to kprintf, now set it explicitly to NULL.

For the sio stuff I chanced upon the real name of the power function for the remote control so changed it in the sdk, I then changed it in psplinkusb stuff but not in the old psplink, so done that.

And as for why addr2line doesn't work, it is cause you are now using prxes which are relocatable. And there is no debug information in the prx, it is in the original elf (I might see about changing that sooner or later) and because it is relocatable then the EPC address is not thte same as the one in the file. You need to subtract the load address from EPC.

You can find out the file address by doing something like (in pspsh) 'calc \$epc-@PMP VLC Player 0.0.9@'
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hum same here i'v never looked in the svn branches. I was debugging the 3.03 ftpd prx server with some sceIoWrite function ... tyranid your THE man.
Thanks again and again ...
tomson2000
Posts: 4
Joined: Sun Jan 22, 2006 1:14 pm

Re: compilation problem

Post by tomson2000 »

onne wrote:I'm trying to compile the PSPLINK from the source(svn), but I have a problem I don't understand. I have just got new cygwin, and even pspsdk(with the newest toolchain script form svn)...

Code: Select all

...
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -f
no-builtin-printf -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/link
file.prx -mno-crt0 -nostartfiles -nodefaultlibs  main.o shell.o config.o bitmap.o sio.o tty.o disasm.o decodeaddr.o memo
ryUID.o kmode.o exception.o parse_args.o psplinkcnf.o util.o script.o debug.o symbols.o libs.o apihook.o thctx.o stdio.o
 exports.o -lpspusb_driver -lpspusbstor -lpspumd -lpspdebug -lpspdisplay_driver -lpspctrl_driver -lpspsdk  -lpspkernel -
lpsphprm_driver -lpsppower_driver -lpspdisplay_driver -o psplink.elf
sio.o: In function `sioInit':
sio.c:(.text+0x138): undefined reference to `sceSyscon_driver_44439604'
collect2: ld returned 1 exit status
make[1]: *** [psplink.elf] Error 1
rm exports.c
make[1]: Leaving directory `/home/username/projects/psplink/psplink'
make: *** [all] Error 2
I have same problem when I try to compile the PSPLINK from the source(svn). I build pspsdk with the newest toolchain script form svn, which enable gcc 4.1.0 and newlib 1.14

Code: Select all

...
sio.o: In function 'sioInit':
sio.c:(.text+0x203): undefined reference to `sceSyscon_driver_44439604'
collect2: ld returned 1 exit status
make[1]: *** [psplink.elf] Error 1
make[1]: Leaving directory `/home/tomson/projects/svn_psp_trunk/trunk/psplink/psplink'
make: *** [all] Error 2
I find no sceSyscon_driver_44439604 function in the newest psp sdk library, but the old library libpspdebug.a and libpspkernel.a have it.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Either some people in this thread are running really damn old linux, or they're really glossing over what a pain PSPLink is to get working in linux.

First, all modern linux distros use HALD/UDev for hotplug devices and removeable media. The hald profile for the PSP is normally

Code: Select all

      <!-- Sony PSP &#40;Playstation Portable&#41; -->
      <match key="@block.storage_device&#58;storage.vendor" string="Sony">
        <match key="@block.storage_device&#58;storage.model" string="PSP">
          <append key="info.capabilities" type="strlist">portable_audio_player</append>
          <merge key="portable_audio_player.access_method" type="string">storage</merge>
          <merge key="portable_audio_player.type" type="string">psp</merge>
          <merge key="portable_audio_player.storage_device" type="copy_property">info.udi</merge>
          <append key="portable_audio_player.output_formats" type="strlist">audio/mpeg</append>
          <append key="portable_audio_player.output_formats" type="strlist">audio/vnd.sony.atrac3</append>
          <merge key="storage.drive_type" type="string">memory_stick</merge>
        </match>
      </match>
This mounts the PSP on the desktop as a storage device, allowing you to read/write the memory stick. However, if you try to use USBHOSTFS, the storage driver will fail to init and linux will refuse to access the USB device, going so far as to not even include the device in the USB list. /sbin/lsusb will reveal no trace of the PSP.

To get past hald/udev, you have to change the profile (in /usr/share/hal/fdi/information/10freedesktop/10-usb-music-players.fdi) to this

Code: Select all

      <!-- Sony -->
      <match key="@storage.physical_device&#58;usb.vendor_id" int="0x54c">
        <!-- Sony PSP &#40;XMB vshell&#41; -->
        <match key="@storage.physical_device&#58;usb.product_id" int="0x1c8">
          <append key="info.capabilities" type="strlist">portable_audio_player</append>
          <merge key="portable_audio_player.access_method" type="string">storage</merge>
          <merge key="portable_audio_player.type" type="string">psp</merge>
          <merge key="portable_audio_player.storage_device" type="copy_property">info.udi</merge>
          <append key="portable_audio_player.output_formats" type="strlist">audio/mpeg</append>
          <append key="portable_audio_player.output_formats" type="strlist">audio/vnd.sony.atrac3</append>
          <merge key="storage.drive_type" type="string">memory_stick</merge>
        </match>
        <!-- Sony PSP &#40;USBHOSTFS&#41; -->
        <match key="@storage.physical_device&#58;usb.product_id" int="0x1c9">
          <append key="info.capabilities" type="strlist">portable_audio_player</append>
          <merge key="portable_audio_player.access_method" type="string">user</merge>
          <merge key="portable_audio_player.type" type="string">generic</merge>
          <merge key="portable_audio_player.storage_device" type="copy_property">info.udi</merge>
          <append key="portable_audio_player.output_formats" type="strlist">audio/mpeg</append>
          <append key="portable_audio_player.output_formats" type="strlist">audio/vnd.sony.atrac3</append>
        </match>
      </match>
That tells linux that when USBHOSTFS connects, it's a generic audio player that is accessed via a user library. Linux will now let the USB device exist in the system lists. /sbin/lsusb will now show device 054c:01c9. Once you've done this, usbhostfs_pc will now connect to the device.

That's as far as I've managed to get so far... even though I'm now connected, I still can't get it to do anything through telnet. "telnet localhost 10000" refuses to connect, but "telnet 127.0.0.1 10000" will connect, but doesn't seem to be communicating with PSPLink.

EDIT: since usbhostfs_pc has to be run in root mode, so does telnet. Once you do, THEN you can access the PSP. So I've finally gotten to the point I can access the PSP across USB via PSPLink in Fedora Core 6 with 2.6.19.
Istari
Posts: 10
Joined: Fri Sep 30, 2005 2:34 am

Post by Istari »

I have no such proplems in Ubuntu 6.10 using the psplinkusb branch, and I don't have to run pspsh as root to access the terminal.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Yah only usbhostfs_pc has to be run as root and for most modern distros you dont even have to do that with an appropriate rules file (think there is on in the psplinkusb archive). And it looks like fedora 6 is just crap and tarred all Sony PSP devices with the same brush. I would just use a better distro ;)
Post Reply