PSPLINK
New binary release on ps2dev.org. Mainly fixes added such as fixing the wifi code to support something other than the first configuration (oops) and endian fixed for mac (double oops). Also added a thread monitor so you can get information on the terminal when threads are created, started, exited or deleted.
-
- Posts: 339
- Joined: Thu Sep 29, 2005 4:19 pm
Ep Tyranid,
I add to modify a few stuff to get the gost drivers compiling on Mac OSX (PowerPC) :
To get PCTERM compiling I had to add <string.h> and remove the references to
but currently when psplink 0.9g is running in USB shell+host mode I've got :
I add to modify a few stuff to get the gost drivers compiling on Mac OSX (PowerPC) :
Code: Select all
#include <netdb.h>
#define SOL_TCP getprotobyname("TCP")->p_proto /* SOL_TCP and SOL_IP undefined */
Code: Select all
//rl_bind_key_in_map(META('r'), cli_reset, emacs_standard_keymap);
//rl_bind_key_in_map(META('s'), cli_step, emacs_standard_keymap);
//rl_bind_key_in_map(META('k'), cli_skip, emacs_standard_keymap);
Code: Select all
d80-170-38-246:~/Documents/PSP/pspsvn/psp/psplink/usbhostfs_pc shazz$ sudo ./usbhostfs_pc /usr/local/pspdev/psp/sdk/samples/gu/sprite/
USBHostFS (c) TyRaNiD 2k6
Connected to device
Read cancelled (remote disconnected)
Connected to device
Read cancelled (remote disconnected)
...
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
In response to the problems with usb "read cancelled (remote disconnected)", I've been trying to set things up and was having the same problems.
I haven't done enough checking to be sure, but it appears it involves either some changes or bugfixes in libusb.
Updating to at least v0.1.11 of libusb seems to fix the problem.
I've noticed a couple people mention gentoo (and I too use gentoo sadly). The version of libusb currently marked as stable for x86 is 0.1.10a, so you'll have to use the ~x86 branch.
Tyr: I know it's not as heroic as writing a driver, but telling people to update libusb seems a lot easier no? ;)
I haven't done enough checking to be sure, but it appears it involves either some changes or bugfixes in libusb.
Updating to at least v0.1.11 of libusb seems to fix the problem.
I've noticed a couple people mention gentoo (and I too use gentoo sadly). The version of libusb currently marked as stable for x86 is 0.1.10a, so you'll have to use the ~x86 branch.
Tyr: I know it's not as heroic as writing a driver, but telling people to update libusb seems a lot easier no? ;)
Shoot Pixels Not People!
Makeshift Development
Makeshift Development
I tried usbhostfs_pc on OS X 10.4 and I was getting the same "disconnected" results as Shazz.
I've tried .12, .11 and .10 versions of libusb, but with no luck. Setting USB_TIMEOUT to 10000 stopped the "disconnected" message, but as soon I telnet and send a command, I get the following:
I've tried .12, .11 and .10 versions of libusb, but with no luck. Setting USB_TIMEOUT to 10000 stopped the "disconnected" message, but as soon I telnet and send a command, I get the following:
Any ideas?USBHostFS (c) TyRaNiD 2k6
Connected to device
Accepting shell connection from 127.0.0.1
Read cancelled (remote disconnected)
Connected to device
Bus error
I've not managed to make it core dump yet - I can't try until later today. In the meantime, does the CrashReporter log provide you the necessary info? (This is using 0.1.12 of libusb btw, I can build it with previous versions if that helps)
Code: Select all
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000010
Thread 0:
0 libSystem.B.dylib 0x9000b208 mach_msg_trap + 8
1 libSystem.B.dylib 0x9000b15c mach_msg + 60
2 com.apple.framework.IOKit 0x90a6e85c io_service_close + 88
3 com.apple.framework.IOKit 0x90a6cb44 IOServiceClose + 24
4 com.apple.iokit.IOUSBLib 0x000bbba4 IOUSBDeviceClass::~IOUSBDeviceClass [unified]() + 148
5 com.apple.iokit.IOUSBLib 0x000bb58c IOUSBIUnknown::release() + 64
6 libusb-0.1.4.dylib 0x0166ad60 usb_os_find_devices + 524 (darwin.c:1061)
7 libusb-0.1.4.dylib 0x01666f84 usb_find_devices + 56 (usb.c:99)
8 usbhostfs_pc 0x00007994 wait_for_device + 48 (main.c:1822)
9 usbhostfs_pc 0x00008478 start_hostfs + 36 (main.c:2023)
10 usbhostfs_pc 0x0000a914 main + 312 (main.c:2844)
11 usbhostfs_pc 0x00001f24 _start + 348 (crt.c:272)
12 usbhostfs_pc 0x00001dc4 start + 60
Thread 1 Crashed:
0 <<00000000>> 0xffff8260 __spin_lock + 0 (cpu_capabilities.h:178)
1 com.apple.CoreFoundation 0x9078df6c CFRunLoopStop + 32
2 com.apple.framework.IOKit 0x90a6c830 IODispatchCalloutFromCFMessage + 576
3 com.apple.CoreFoundation 0x9076adb0 __CFMachPortPerform + 176
4 com.apple.CoreFoundation 0x9076acc4 __CFRunLoopDoSource1 + 152
5 com.apple.CoreFoundation 0x9075d3dc __CFRunLoopRun + 1556
6 com.apple.CoreFoundation 0x9075ca0c CFRunLoopRunSpecific + 268
7 libusb-0.1.4.dylib 0x0166a524 usb_bulk_transfer + 984 (darwin.c:841)
8 libusb-0.1.4.dylib 0x0166a70c usb_bulk_write + 72 (darwin.c:889)
9 usbhostfs_pc 0x00002ac8 euid_usb_bulk_write + 80 (main.c:183)
10 usbhostfs_pc 0x0000a5b8 async_thread + 1924 (main.c:2769)
11 libSystem.B.dylib 0x9002b200 _pthread_body + 96
Thread 1 crashed with PPC Thread State 64:
srr0: 0x00000000ffff8260 srr1: 0x000000000000d030 vrsave: 0x0000000000000000
cr: 0x44028288 xer: 0x0000000000000004 lr: 0x000000009078df6c ctr: 0x0000000090126670
r0: 0x000000009078df6c r1: 0x00000000f007f070 r2: 0x000000000166d008 r3: 0x0000000000000010
r4: 0x0000000000000000 r5: 0x0000000000000012 r6: 0x0000000000000001 r7: 0x0000000000000048
r8: 0x00000000f007f6bc r9: 0x0000000000000018 r10: 0x0000000000000069 r11: 0x00000000a073b2d8
r12: 0x0000000090126670 r13: 0x0000000000000000 r14: 0x0000000000000001 r15: 0x0000000000000001
r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x0000000000001f03 r19: 0x0000000000000000
r20: 0x0000000000000069 r21: 0x0000000090957de2 r22: 0x0000000000502b78 r23: 0x0000000000000000
r24: 0x0000000000000000 r25: 0x0000000000000008 r26: 0x00000000f007f260 r27: 0x00000000005024c0
r28: 0x0000000000502450 r29: 0x0000000000000010 r30: 0x0000000000000008 r31: 0x0000000090a6c5fc
This might be helpful too - I set the "usb_debug" var to a higher value:
The last 512 byte transfer times out after USB_TIMEOUT and the whole cycle repeats until a command is entered, causing the bus error.
Code: Select all
USBHostFS (c) TyRaNiD 2k6
usb_os_find_busses: Found 001
usb_os_find_busses: Found 002
usb_os_find_devices: Found USB device at location 0x18000000
usb_os_find_devices: Found 001-05ac-8005-09-00 on 001 at location 0x18000000
usb_os_find_devices: Found USB device at location 0x19000000
usb_os_find_devices: Found USB device at location 0x19100000
usb_os_open: 05ac:8005
usb_os_open(USBDeviceOpenSeize): another process has device opened for exclusive access
usb_control_msg: 128 6 512 0 0xbffff478 8 1000
usb_control_msg: 128 6 512 0 0x501510 27 1000
usb_os_close: 05ac:8005
usb_os_find_devices: Found USB device at location 0x18000000
usb_os_find_devices: Found USB device at location 0x19000000
usb_os_find_devices: Found 001-05ac-8005-09-00 on 002 at location 0x19000000
usb_os_find_devices: Found USB device at location 0x19100000
usb_os_find_devices: Found 003-054c-01c9-00-00 on 002 at location 0x19100000
usb_os_open: 054c:01c9
usb_control_msg: 128 6 512 0 0xbffff478 8 1000
usb_control_msg: 128 6 512 0 0x502320 39 1000
usb_os_close: 054c:01c9
usb_os_open: 05ac:8005
usb_os_open(USBDeviceOpenSeize): another process has device opened for exclusive access
usb_control_msg: 128 6 512 0 0xbffff478 8 1000
usb_control_msg: 128 6 512 0 0x5023e0 27 1000
usb_os_close: 05ac:8005
usb_os_open: 054c:01c9
usb_set_configuration: called for config 1
usb_claim_interface: called for interface 0
Interface 0 of device is 0x00001137
claim_interface: Interface 0 of device from QueryInterface is 0x502500
libusb/darwin.c get_endpoints: building table of endpoints.
get_endpoints: Pipe 1: DIR: 1 number: 1
get_endpoints: Pipe 2: DIR: 0 number: 2
get_endpoints: Pipe 3: DIR: 0 number: 3
libusb/darwin.c get_endpoints: complete.
Connected to device
libusb/darwin.c ep_to_pipeRef: Converting ep address to pipeRef.
libusb/darwin.c usb_bulk_transfer: Transfering 4 bytes of data on endpoint 0x02
io async operation completed: no error, size=4, result=0x00000000
libusb/darwin.c ep_to_pipeRef: Converting ep address to pipeRef.
libusb/darwin.c usb_bulk_transfer: Transfering 512 bytes of data on endpoint 0x81
io async operation completed: no error, size=12, result=0x00000000
usb_bulk_read: input timed out
libusb/darwin.c ep_to_pipeRef: Converting ep address to pipeRef.
libusb/darwin.c usb_bulk_transfer: Transfering 12 bytes of data on endpoint 0x02
io async operation completed: no error, size=12, result=0x00000000
libusb/darwin.c ep_to_pipeRef: Converting ep address to pipeRef.
libusb/darwin.c usb_bulk_transfer: Transfering 512 bytes of data on endpoint 0x81
io async operation completed: transaction aborted, size=0, result=0xe00002eb
usb_bulk_read: input timed out
Read cancelled (remote disconnected)
usb_os_close: 054c:01c9
If I can provide any help in testing something on the mac, Tyranid, just ask.... (debug version of usbhostfs_pc...)
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
OK, it appears that the problem is with libusb and not PSPLINK. I tried libusb versions .12 -> .8 and the included tests don't even work!
On the bright side, YAY!
I downloaded a pre-built libusb from here, http://www.ellert.se/twain-sane/, and it works! I'm not sure what the problem is, but it works with this version.
Nice app TyRaNiD! :)
On the bright side, YAY!
I downloaded a pre-built libusb from here, http://www.ellert.se/twain-sane/, and it works! I'm not sure what the problem is, but it works with this version.
Nice app TyRaNiD! :)
I'm having more problems :( and I can't be sure libusb is the cause.
My test program reads in a text file a character at a time using fread, which is then printed to the screen. After what appears to be 1024 characters, the beginning of the file starts to be printed again.
The problem first appeared when reading the file over usbhostfs. I then copied the file to the memory stick and changed the program to read from there. Starting the program from PSPLINK produced the same corrupt results.
If I run the program without using PSPLINK it works as it should. I'm assuming PSPLINK patches the IO functions somehow, but I can't work out where to test further.
My test program reads in a text file a character at a time using fread, which is then printed to the screen. After what appears to be 1024 characters, the beginning of the file starts to be printed again.
The problem first appeared when reading the file over usbhostfs. I then copied the file to the memory stick and changed the program to read from there. Starting the program from PSPLINK produced the same corrupt results.
If I run the program without using PSPLINK it works as it should. I'm assuming PSPLINK patches the IO functions somehow, but I can't work out where to test further.
So based on great urchin's discoveries and libusb distrib, I played with psplink/usbhost for a few hours...
Basically it works perfectly with some limitations :
- fread freezes after some calls, use sceIoRead instead
- impossible to load a PNG from host:
fails.... (not if the png is on ms0) (maybe it uses fread ?)
- host:/ file reading is very slow
=> so I keep my data files on ms0 and all is ok :D
Basically it works perfectly with some limitations :
- fread freezes after some calls, use sceIoRead instead
- impossible to load a PNG from host:
Code: Select all
if ( setjmp( pPngStruct->jmpbuf ) != 0 )
- host:/ file reading is very slow
=> so I keep my data files on ms0 and all is ok :D
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
a friend told me he has the same issue with the Windows version while loading png. So it is not only mac related it seems.
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
It is something I have considered but never got around to doing it. If of course you feel like writing something to do it then I dont mind integrating it into the repository :)
Oh and shazz any chance you can dig up a simple example of the png loading failing so I can look at it, unfortunately pretty much everything people have said which fails in psplink I have been unable to replicate. Having some clear examples of broken code might aid me in tracking down problems.
Oh and shazz any chance you can dig up a simple example of the png loading failing so I can look at it, unfortunately pretty much everything people have said which fails in psplink I have been unable to replicate. Having some clear examples of broken code might aid me in tracking down problems.
I'll do that asap (but basically I use the
from svn->libpng/screenshot/main.c
Code: Select all
void showImage(const char* filename)
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
TyRaNiD: that and tab completion are what I miss, Ill have a look but I cant promise alot (ie: you will probably have to be the code cleaner-upper if you really want me to add this stuff - but I'd be more than happy to do a lions share of the typing and trial/error if you dont feel like it)
The other day I decided I wanted to go with the SIO, I had been having some problems with the USB shell crashing and I had hoped SIO would solve my issues. Unfortunately, I got a whole new set of issues (and yeah, I tried wifi but it was a crashwhore too with my pci card in AP mode).
Working with the sparkfun adapter (from here) I am able to receive from the PSP at any baud, but I cant send if I set the term/psplink at anything higher than 9600bps. Its odd because I am able to bridge the rx/tx at the psp voltage and have the PC talk to itself fine, but any time I try and send to the psp from the PC both Rx and Tx light up but nothing happens (the psp does not seem to be getting the sends at all). Is anyone else seeing this type of behavior in SIO shell or has everyone moved on to USB and wifi shell?
(riden pointed me at this thread - is this still an issue with serial comms?)
The other day I decided I wanted to go with the SIO, I had been having some problems with the USB shell crashing and I had hoped SIO would solve my issues. Unfortunately, I got a whole new set of issues (and yeah, I tried wifi but it was a crashwhore too with my pci card in AP mode).
Working with the sparkfun adapter (from here) I am able to receive from the PSP at any baud, but I cant send if I set the term/psplink at anything higher than 9600bps. Its odd because I am able to bridge the rx/tx at the psp voltage and have the PC talk to itself fine, but any time I try and send to the psp from the PC both Rx and Tx light up but nothing happens (the psp does not seem to be getting the sends at all). Is anyone else seeing this type of behavior in SIO shell or has everyone moved on to USB and wifi shell?
(riden pointed me at this thread - is this still an issue with serial comms?)
Tab completion is something on the list somewhere but really I am not sure how best to implement it in the current implementation. For host stuff I could probably query the usbhostfs_pc stuff through pcterm and do it on the client and I could replicate the command list inside pcterm but that seems ugly. Ill try and add logging sometime soon :)
As for SIO stuff well using pcterm with SIO seems to be potentially unreliable due in part to the lack of flow control as pcterm fires off the entire the command in one go. Also it seems to not like being used with other shells enabled. The best mode for sioshell is to only set sioshell and set pcterm in the ini to 0. That way characters are sent as soon as they are read to the psp eliminating most of the flow control issues. But for that youll want to use something like minicom or tutty, pcterm will still operate in a line based mode.
As for SIO stuff well using pcterm with SIO seems to be potentially unreliable due in part to the lack of flow control as pcterm fires off the entire the command in one go. Also it seems to not like being used with other shells enabled. The best mode for sioshell is to only set sioshell and set pcterm in the ini to 0. That way characters are sent as soon as they are read to the psp eliminating most of the flow control issues. But for that youll want to use something like minicom or tutty, pcterm will still operate in a line based mode.
even just tab completion for the command list (instead of using help/pdf every time one wants to find a command) and basic/common paths would probably be enough for most everyone.
SIO: I considered that pcterm could be the problem, its why I have been doing all my testing on this with Tera Term. I disabled everything except SIO shell (annoying that I have to hold the power button and reboot every time since it wont accept any commands over the serial) - but basically I'm down to two things and trying to figure out which is the culprit: hardware or software. So far it is a mixed bag, as I have no real answer and it could go either way. I have a Max3232 on its way, so maybe that will help me sort it in the end.
SIO: I considered that pcterm could be the problem, its why I have been doing all my testing on this with Tera Term. I disabled everything except SIO shell (annoying that I have to hold the power button and reboot every time since it wont accept any commands over the serial) - but basically I'm down to two things and trying to figure out which is the culprit: hardware or software. So far it is a mixed bag, as I have no real answer and it could go either way. I have a Max3232 on its way, so maybe that will help me sort it in the end.
I've added basic logging to pcterm by the way, you have to log an entire session (and only output is logged) by specifying it on the command line with the -l option. Best you are going to get atm :P
Have you tried the SIO example in pspsdk with your serial cable ? Youll need to make a call to set the baud rate differently, but at least it would indicate whether it was a hardware or software problem. I guess it could be something weird like an dodgy connection on the PSPs RX pin which just about works at low baud but completly dies at higher speeds, though that seems unlikely.
Have you tried the SIO example in pspsdk with your serial cable ? Youll need to make a call to set the baud rate differently, but at least it would indicate whether it was a hardware or software problem. I guess it could be something weird like an dodgy connection on the PSPs RX pin which just about works at low baud but completly dies at higher speeds, though that seems unlikely.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
I've been using PSPLink (0.9f) for a while now, and it's a really great tool.
So i've been working on something in the PSPLink environment, and everything's working great, however if I run the same eboot in the XMB, I start getting problems. Some of my integers seem to gain random (usually high) values, which makes the app. unstable. I don't know that much about memory allocation, but it sounds like I've got something leaking into those integers and corrupting them. If I define them as static, then they act as normal, but this isn't the best solution, and I'd like to know how I can debug this problem or simulate what PSPLink does to fix this problem.
Thanks.
EDIT: I think I may have found the leak, after adding code to dRead as suggested in the related thread, it seems to have stopped the random values. I have a bad feeling that the compiler is just re-organising the RAM addresses though...
So i've been working on something in the PSPLink environment, and everything's working great, however if I run the same eboot in the XMB, I start getting problems. Some of my integers seem to gain random (usually high) values, which makes the app. unstable. I don't know that much about memory allocation, but it sounds like I've got something leaking into those integers and corrupting them. If I define them as static, then they act as normal, but this isn't the best solution, and I'd like to know how I can debug this problem or simulate what PSPLink does to fix this problem.
Thanks.
EDIT: I think I may have found the leak, after adding code to dRead as suggested in the related thread, it seems to have stopped the random values. I have a bad feeling that the compiler is just re-organising the RAM addresses though...
Last edited by AnonymousTipster on Mon May 15, 2006 6:13 am, edited 1 time in total.
GDB Problem
Hi,
i try to use gdb. Any ideas what's going wrong there ?
Usbshell:
gdb g.elf
usbhostfs_pc:
i try to use gdb. Any ideas what's going wrong there ?
Usbshell:
Code: Select all
ms0:/apps/> debug g.elf
ms0:/apps/> PSPLink GDBServer (c) 2k6 TyRaNiD/Lovely2
GDBServer: Loaded ms0:/apps/g.elf - UID 0x044B185F
Code: Select all
GNU gdb 6.4.0.20051202-cvs
(gdb) target remote :10001
Remote debugging using :10001
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
Code: Select all
Accepting gdb connection from 127.0.0.1
HOST->GDB (+$Hc-1#09)
HOST->GDB ($Hc-1#09)
HOST->GDB ($Hc-1#09)
HOST->GDB ($Hc-1#09)
HOST->GDB (-)
HOST->GDB (-)
HOST->GDB (-+$qC#b4)
HOST->GDB ($qC#b4)
HOST->GDB ($qC#b4)
HOST->GDB ($qC#b4)
HOST->GDB (-)
HOST->GDB (-)
HOST->GDB (-+$qOffsets#4b)
HOST->GDB ($qOffsets#4b)
HOST->GDB ($qOffsets#4b)
HOST->GDB ($qOffsets#4b)
HOST->GDB (-)
Read cancelled (remote disconnected)
Connected to device
optixx00, strange that you are not getting any results from the PSP side of GDB, stupid question but did you enable usbgdb in the configuration file ? Although it really shouldn't matter, if you had enabled wifi it probably would fail before it got anywhere, or at the very least have printed a different IP address (maybe).