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 ... 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
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Mar 04, 2006 3:52 am    Post subject: Reply with quote

Yup you are probably right, will fix on the next round of commits.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue Mar 07, 2006 7:33 am    Post subject: Reply with quote

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 ;)
Back to top
View user's profile Send private message
Phantom8



Joined: 17 Jun 2005
Posts: 30

PostPosted: Wed Mar 08, 2006 4:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Oobles
Site Admin


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

PostPosted: Wed Mar 08, 2006 9:21 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Phantom8



Joined: 17 Jun 2005
Posts: 30

PostPosted: Thu Mar 09, 2006 3:15 am    Post subject: Reply with quote

Oobles, do you mind to post the usbhostfs_pc binary for cygwin? TIA.
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Thu Mar 09, 2006 4:23 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
ginka



Joined: 17 Feb 2006
Posts: 15

PostPosted: Thu Mar 09, 2006 4:32 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Thu Mar 09, 2006 5:05 am    Post subject: Reply with quote

i tried the d version and now it seems to work
Back to top
View user's profile Send private message Visit poster's website
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Mar 09, 2006 8:39 am    Post subject: Reply with quote

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.
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 09, 2006 8:07 pm    Post subject: Reply with quote

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:
Code:

data[ readlen - sizeof( struct AsyncCommand ) ] = 0;
fprintf( stderr, "->(%i) %s\n", readlen-sizeof(struct AsyncCommand), data );


and in async_thread:
Code:

gdbdata[readbytes]=0;
fprintf( stderr, "<-(%i) %s\n", readbytes, gdbdata);


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/onlinedocs/gdb_33.html

In handle_query to get the current thread id:
Code:

case 'C':
   thread_id = sceKernelGetThreadId();
   output[0] = 'Q';
   output[1] = 'C';
   mem2hex( (unsigned char *) &thread_id, &output[2], 4 );
   break;


In gdbHandleException to set the thread id for other commands.
Code:

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;


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
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
ginka



Joined: 17 Feb 2006
Posts: 15

PostPosted: Fri Mar 10, 2006 2:19 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 10, 2006 4:27 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
zilt



Joined: 21 Feb 2006
Posts: 45
Location: Ontario, Canada

PostPosted: Fri Mar 10, 2006 4:56 am    Post subject: Reply with quote

Is there a gdb 6.4 for pspsdk? toolchain.sh seems to only install 6.3.
Back to top
View user's profile Send private message Visit poster's website
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 10, 2006 5:00 am    Post subject: Reply with quote

Ah my bad, it does indeed install 6.3, although the one on my system actually shows 6.4. Perhaps it is insight's gdb. In fact it is insight's gdb. Will look at updating the one in the toolchain to vanilla 6.4.
Back to top
View user's profile Send private message
ginka



Joined: 17 Feb 2006
Posts: 15

PostPosted: Fri Mar 10, 2006 5:04 am    Post subject: Reply with quote

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?


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.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 10, 2006 5:27 am    Post subject: Reply with quote

Okay I have added 6.4 to the toolchain as well as being able to build insight separately. The patch itself was the same as insights, not that that is a massive surprise considering they are exactly the same core revision (same cvs tag etc.)
Back to top
View user's profile Send private message
optixx00



Joined: 18 Jul 2005
Posts: 11

PostPosted: Fri Mar 10, 2006 7:59 am    Post subject: Reply with quote

I had some problems with usbhostfs on linux 2.6.15-ck1, sometimes it blocked while io operations. After changing USB_TIMEOUT in usbhostfs_pc/main.c to something between 10 and 100 it works properly. Maybe other linux user experience same probs, so this could be a hint.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Mar 10, 2006 8:20 am    Post subject: Reply with quote

How strange, I might make USB_TIMEOUT something like 1000 on all systems then, if the bulk in fails with a timeout it doesn't actually seem to cause much of an issue.
Back to top
View user's profile Send private message
reakt



Joined: 06 May 2005
Posts: 22
Location: Basingstoke, UK

PostPosted: Fri Mar 10, 2006 11:32 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sat Mar 11, 2006 3:22 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
tomson2000



Joined: 22 Jan 2006
Posts: 4

PostPosted: Sat Mar 11, 2006 1:48 pm    Post subject: Reply with quote

>>> TyRaNiD

Thank you for your contribution!
Back to top
View user's profile Send private message
Phantom8



Joined: 17 Jun 2005
Posts: 30

PostPosted: Sat Mar 11, 2006 7:11 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Mon Mar 13, 2006 11:44 am    Post subject: Reply with quote

I get the following error any time I try to run one of the examples compiled as a .elf:

Code:

host0:/gu/cube/> ./cube.elf
Failed to Load/Start module 'host0:/gu/cube/cube.elf' Error: 0x800200D9


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?
Back to top
View user's profile Send private message
Oobles
Site Admin


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

PostPosted: Mon Mar 13, 2006 12:26 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Mon Mar 13, 2006 2:39 pm    Post subject: Reply with quote

Thanks for the tip! It seems to work okay. I'm still wondering why the .elf files won't run directly... Did something change in the sdk/toolchain recently that makes them incompatible with psplink?
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Mon Mar 13, 2006 9:39 pm    Post subject: Reply with quote

Maybe i've found a little problem.
i'm using usb shell and i load an application then i try ss host0:/sc.bmp but it crashes the shell that doens't respond anymore.
Back to top
View user's profile Send private message Visit poster's website
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Tue Mar 14, 2006 4:32 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Tue Mar 14, 2006 10:32 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Mar 15, 2006 5:29 am    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Wed Mar 15, 2006 7:03 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
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 ... 9, 10, 11  Next
Page 3 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