PSPLINK
Okay finally another binary release, contains various fixups as usual, also has the USB HOSTFS, USB shell, USB GDB support. Also contributed by Rasmus B is a simple console shell to access some features of the shell from the PSPs pad.
Update: Released 0.9d which has fixed for the PC side of USB so it seems to work correctly on Windows. Again slight caveat, seems usbhostfs_pc doesn't always respond to ctrl+c, seems to clear it you have to hit ctrl+c, close and reopen pcterm and then it shuts down. Don't ask me why ;)
http://ps2dev.org/psp/Tools/PSPLINK_0.9d
Report any bugs if anyone bothers to give it a go ;)
Update: Released 0.9d which has fixed for the PC side of USB so it seems to work correctly on Windows. Again slight caveat, seems usbhostfs_pc doesn't always respond to ctrl+c, seems to clear it you have to hit ctrl+c, close and reopen pcterm and then it shuts down. Don't ask me why ;)
http://ps2dev.org/psp/Tools/PSPLINK_0.9d
Report any bugs if anyone bothers to give it a go ;)
Wow, I've tried to use the 0.9c and I can get the wifi shell working perfectly. This is an incredible piece of debugging software and I found it easy to use. BTW, the download link above for 0.9d doesn't work. I had to download the source code from SVN depositry and generated the binary. I can get the usbshell working on Linux, but I can't compile the usbhostfs_pc for Windows under cygwin. I got many errors in missing include files, such as "pshpack1.h", "poppack.h", etc. I think the problem is with my cygwin installation. Is it possible to generate the Windows version of usbhostfs_pc from a native Linux box, instead of cygwin? Or is it possible for you to host the Windows version usbhostfs_pc binary for download? Again, thanks so much for making such a wonderful debugging tool.
-
- Site Admin
- Posts: 347
- Joined: Sat Jan 17, 2004 9:49 am
- Location: Melbourne, Australia
- Contact:
I downloaded v0.9d from the site today. Installed and got the usbhostfs_pc compiled on cygwin first time. For anyone trying to set this up, follow the instructions at the end of the manual.
I also had a go at using the eclipse IDE for PSP debugging. It was really quite simple. Create a new Debug project, select the GDB Server debug method and enter psp-gdb as the gdb executable. Start up the program using psplink debug command then run the debug in eclipse. I had Eclipse show me a breakpoint at the start of the program first time! I attempted some single stepping and running the program, but didn't get very far. I'm not sure what went wrong, but was impressed it got that far on the first run.
I did this on the train on the way home from work. Notebook on the lap, and PSP in my jacket pocket. Fun way to debug. :)
Nice work TyRaNiD!
David aka Oobles.
http://www.livemedia.com.au/Blog
I also had a go at using the eclipse IDE for PSP debugging. It was really quite simple. Create a new Debug project, select the GDB Server debug method and enter psp-gdb as the gdb executable. Start up the program using psplink debug command then run the debug in eclipse. I had Eclipse show me a breakpoint at the start of the program first time! I attempted some single stepping and running the program, but didn't get very far. I'm not sure what went wrong, but was impressed it got that far on the first run.
I did this on the train on the way home from work. Notebook on the lap, and PSP in my jacket pocket. Fun way to debug. :)
Nice work TyRaNiD!
David aka Oobles.
http://www.livemedia.com.au/Blog
i had the same problem but i used directly psp-gdb from cygwin.
I'm using it trougth usb so i do debug elf command and then i load gdb and connect to port 10001. it connect and shows the first breakpoint but if i press c it just hangs. the shell is still working but gdb and the application i'm trying to debug just stop working at all.
anyway great tool and thanks for it :D
I'm using it trougth usb so i do debug elf command and then i load gdb and connect to port 10001. it connect and shows the first breakpoint but if i press c it just hangs. the shell is still working but gdb and the application i'm trying to debug just stop working at all.
anyway great tool and thanks for it :D
Yup - I tried it with eclipse last night as well ( under linux and usbhostfs ). The only additonal change I had to make was change the debug port to 10001 ( took me a few minutes to figure out why it wasn't working :). It seems to be able to hit several breakpoints before it stops responding. I'm able to single step and set new breakpoints which works fine for a few minutes. Anyways, great addition to the tool set!
Phantom8, you need to install the w32api package in cygwin, that should fix the include errors.
As for the gdb problems I don't know what would be causing that. What have you people been testing under gdb ?
At least with the samples I can run it seemingly for as long as I feel like, however I guess depending what you do the gdb thread might stall as it might need a priority boost. But that should only be an issue if you really do not yield the CPU at all.
As for the gdb problems I don't know what would be causing that. What have you people been testing under gdb ?
At least with the samples I can run it seemingly for as long as I feel like, however I guess depending what you do the gdb thread might stall as it might need a priority boost. But that should only be an issue if you really do not yield the CPU at all.
-
- Site Admin
- Posts: 347
- Joined: Sat Jan 17, 2004 9:49 am
- Location: Melbourne, Australia
- Contact:
I've been playing around with usbgdb today. Trying it out with eclipse and stand alone. Discovered a few things. First thing I did was add in some lines of code in usbhostfs_pc to echo the commands sent to/from gdb. Turns out ethereal doesn't capture from localhost. I was thinking of adding these with a command line option.
In do_async:
and in async_thread:
While running eclipse I found a few stub commands that weren't implemented that it expects. I followed the following document while implemetning...
http://sources.redhat.com/gdb/current/o ... db_33.html
In handle_query to get the current thread id:
In gdbHandleException to set the thread id for other commands.
Should I commit these as I go? I didn't want to commit unless you wanted me to. I write crappy C code. :) I'm still finishing a command to return if a thread is still running.
David. aka Oobles.
http://www.livemedia.com.au/Blog
In do_async:
Code: Select all
data[ readlen - sizeof( struct AsyncCommand ) ] = 0;
fprintf( stderr, "->(%i) %s\n", readlen-sizeof(struct AsyncCommand), data );
Code: Select all
gdbdata[readbytes]=0;
fprintf( stderr, "<-(%i) %s\n", readbytes, gdbdata);
http://sources.redhat.com/gdb/current/o ... db_33.html
In handle_query to get the current thread id:
Code: Select all
case 'C':
thread_id = sceKernelGetThreadId();
output[0] = 'Q';
output[1] = 'C';
mem2hex( (unsigned char *) &thread_id, &output[2], 4 );
break;
Code: Select all
case 'H':
ptr = &input[0];
if ( *ptr = 'c' ) {
cThreadTarget = atoi( ptr++ );
strcpy(output,"OK");
} else if ( *ptr = 'g' ) {
gThreadTarget = atoi( ptr++ );
strcpy(output,"OK");
}
break;
David. aka Oobles.
http://www.livemedia.com.au/Blog
Well I updated pspsdk's use of gdb to 6.4 and now I don't seem to have any issues with gdb debugging under eclipse. After setting/disabling breakpoints everywhere, stepping over/into code, and modifying variable values for over 10mins, I didn't have any crashes - so I'll stick with this version for the time being.
Oobles, does eclipse actually need those commands to work, or is it just that the gdb stub is rejecting them? There are a number of commands which are not implemented atm, threading stuff being one of them cause there is no real thread support yet. I might change that tonight. However in the general case if it isn't supported gdb should just ignore it.
Oh and a small point, calling sceKernelGetThreadId() isn't a good idea in that case as that will get the thread id of the gdb thread and not the thread which has errors. Will sort that out as well in the threading stuff. Good work on it though :)
And ginka, what version of gdb were you using before? Didn't think I had done anything but gdb 6.4, or were you using the insight debugger?
Oh and a small point, calling sceKernelGetThreadId() isn't a good idea in that case as that will get the thread id of the gdb thread and not the thread which has errors. Will sort that out as well in the threading stuff. Good work on it though :)
And ginka, what version of gdb were you using before? Didn't think I had done anything but gdb 6.4, or were you using the insight debugger?
Took the gdb 6.3 patch file and fixed up all the rejects against 6.4. I haven't used insight before - I did try emerging it with gentoo once but the make failed, so just stuck with eclipse and psp-gdb/tui. 6.4 does seem more stable though then 6.3.TyRaNiD wrote:And ginka, what version of gdb were you using before? Didn't think I had done anything but gdb 6.4, or were you using the insight debugger?
Great tool, thankyou!
I also need some help. I'm trying to load an elf which uses the network modules. I've setup the psplink.ini file so that it loads the inet modules:
modload=flash0:/kd/ifhandle.prx
modload=flash0:/kd/pspnet.prx
modload=flash0:/kd/pspnet_inet.prx
modload=flash0:/kd/pspnet_apctl.prx
modload=flash0:/kd/pspnet_resolver.prx
However, when I load my elf, it fails to run properly as it fails on the call to pspSdkLoadInetModules()
I get an error code back but it looks incorrect :- -2147352263
Any idea what I'm doing wrong?
Thanks!
I also need some help. I'm trying to load an elf which uses the network modules. I've setup the psplink.ini file so that it loads the inet modules:
modload=flash0:/kd/ifhandle.prx
modload=flash0:/kd/pspnet.prx
modload=flash0:/kd/pspnet_inet.prx
modload=flash0:/kd/pspnet_apctl.prx
modload=flash0:/kd/pspnet_resolver.prx
However, when I load my elf, it fails to run properly as it fails on the call to pspSdkLoadInetModules()
I get an error code back but it looks incorrect :- -2147352263
Any idea what I'm doing wrong?
Thanks!
Well the you are getting an EXCLUSIVE_LOAD error, you shouldn't be calling pspSdkLoadInetModules at all if they are already loaded for I am sure the obvious reasons :)
Also ensure that your application is a pure user mode application and not a kernel mode application otherwise it will fail to link in the correct libraries. See the net prx samples in pspsdk.
You will still need to call pspSdkInetInit() though.
Also ensure that your application is a pure user mode application and not a kernel mode application otherwise it will fail to link in the correct libraries. See the net prx samples in pspsdk.
You will still need to call pspSdkInetInit() though.
-
- Posts: 4
- Joined: Sun Jan 22, 2006 1:14 pm
I'm having some problem with the USB Shell. I tried to use both telnet & pcterm to port 10000, but the USB Shell is only half working. I can only see the output and cannot give commands to the shell. It seems whatever I typed, it only echoed back but didn't do anything. If I issue command via a wifi shell, I can see all the output display on both the USB shell and wifi shell. Any idea on the problem. TIA!
I get the following error any time I try to run one of the examples compiled as a .elf:
Things works fine if I compile and run the .prx version. The problem I have with the .prx is that GDB doesn't seem to be able to find any symbols... (The sprite example behaves exactly the same way as well.)
Also, besided modifying the common sdk makefile is there a way to skip the psp-strip step?
Code: Select all
host0:/gu/cube/> ./cube.elf
Failed to Load/Start module 'host0:/gu/cube/cube.elf' Error: 0x800200D9
Also, besided modifying the common sdk makefile is there a way to skip the psp-strip step?
-
- Site Admin
- Posts: 347
- Joined: Sat Jan 17, 2004 9:49 am
- Location: Melbourne, Australia
- Contact:
If you want to debug a PRX the best thing to do is run debug xxxx.prx on the psp, then run gdb using xxxx.elf. I assume this is what you are trying to do?
David. aka Oobles.
http://www.livemedia.com.au/Blog
David. aka Oobles.
http://www.livemedia.com.au/Blog
You will have to be abit more specific regarding the problem, are you running it on windows or *nix, what are you actualyl trying to take a screenshot of etc?
One thing the shell does not do with the screenshot is actually validate the frame pointer (I really should do ;P) I have tested it on a number of different things, sdk gu samples, kill everything that moves 0.9 both running off host as well as a couple of games and they all seem to work without crashing.
One thing the shell does not do with the screenshot is actually validate the frame pointer (I really should do ;P) I have tested it on a number of different things, sdk gu samples, kill everything that moves 0.9 both running off host as well as a couple of games and they all seem to work without crashing.
well i'm using windows and i'm loading the usbhostfs from the cygwin shell.
i tried two programs
1-a mine game (i'm using the lua player graphic library compiled as a lib to display graphic)
2-nesterj 1.10
and it just crashes all the times i try to save on host but if i save on ms it goes fine so i don't think it's a framepointer problem
edit: I forgot that it creates a 0 byte file
i tried two programs
1-a mine game (i'm using the lua player graphic library compiled as a lib to display graphic)
2-nesterj 1.10
and it just crashes all the times i try to save on host but if i save on ms it goes fine so i don't think it's a framepointer problem
edit: I forgot that it creates a 0 byte file
Well I tried nesterj on both my linux box and a windows xp machine with cygwin and they both seemed to work oki, the emu is abit funny, sometimes it wont reset correctly, this is most likely down to thread priority issues though as I would expect once the emu is running it is not waiting on vblank (unless you told it to), it works if you suspend the thread first.
Strange though that it works to ms and not to host, but again it could be some strange priority issue but you would think that would affect all systems not just cygwin.
In short no real idea what the problem is :( Can you do screenshots to ms and then while it is running use the cp command to copy it to host or does this not work either ?
Strange though that it works to ms and not to host, but again it could be some strange priority issue but you would think that would affect all systems not just cygwin.
In short no real idea what the problem is :( Can you do screenshots to ms and then while it is running use the cp command to copy it to host or does this not work either ?
for me it doesn't work maybe I've something wrong on my pc...?
this is what happens with any file
host:/> cp ./sexypsf.elf ms0:/sho.elf
cp host:/sexypsf.elf -> ms0:/sho.elf ->this works fine
host:/> cp ms0:/sho.elf host:/abc
cp ms0:/sho.elf -> host:/abc
(here it stops responding)
and this is what i can see from usbhostfs_pc on cygwin:
Administrator@pc1 ~/usbhostfs_pc
$ ./usbhostfs_pc.exe
USBHostFS (c) TyRaNiD 2k6
found 5 busses
Connected to device
Accepting shell connection from 127.0.0.1
Error reading write data cmd->extralen 2048, ret -116 -> this happens when crash occours
Error in write command
found 5 busses
found 5 busses
found 5 busses
found 5 busses
found 5 busses
with 0.9c i couldn't even load files from host but with d loading from host worked.
this is what happens with any file
host:/> cp ./sexypsf.elf ms0:/sho.elf
cp host:/sexypsf.elf -> ms0:/sho.elf ->this works fine
host:/> cp ms0:/sho.elf host:/abc
cp ms0:/sho.elf -> host:/abc
(here it stops responding)
and this is what i can see from usbhostfs_pc on cygwin:
Administrator@pc1 ~/usbhostfs_pc
$ ./usbhostfs_pc.exe
USBHostFS (c) TyRaNiD 2k6
found 5 busses
Connected to device
Accepting shell connection from 127.0.0.1
Error reading write data cmd->extralen 2048, ret -116 -> this happens when crash occours
Error in write command
found 5 busses
found 5 busses
found 5 busses
found 5 busses
found 5 busses
with 0.9c i couldn't even load files from host but with d loading from host worked.