PSPLINK

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
nullp01nter
Posts: 26
Joined: Wed Jan 04, 2006 7:40 am
Location: Saxony/Germany

Post by nullp01nter »

I like it. If you were to use something like the FT232R, you could get rid of a bunch of components and have true 2.5v logic output. I think I'll go cancel my order for a bunch of max3319s and make cables like this instead. :)
Wow! That's it! This is what I need to have :)
This chip is rather new, so I did not come across yet. But I'll try to order a few immediately and then hack together a modified (and "minified") layout. I think I'm a bit excited about that now *g*

Thoralt
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Damn that looks great, might have to build one myself. Few questions though, is the audio passed straight through (I assume it is)? And is it actually bus powered, i.e. would we even need to init the power from the SIO port to use it, if not that would cut 2 seconds off psplink reboot times ;)

Nice work.
User avatar
nullp01nter
Posts: 26
Joined: Wed Jan 04, 2006 7:40 am
Location: Saxony/Germany

Post by nullp01nter »

Damn that looks great, might have to build one myself. Few questions though, is the audio passed straight through (I assume it is)? And is it actually bus powered, i.e. would we even need to init the power from the SIO port to use it, if not that would cut 2 seconds off psplink reboot times ;)
If you have a look at the schematic (http://www.thoralt.de/projects/SIO2USB/SIO2USB.html) you see, that every line except the PSP's RXD is straight through. So headphones and (if needed) the remote is working as usual. and yes, the device is bus powered. so there's no need of the power supply from the PSP (which still seems to be somehow mystic from the sources I read through).

As suggested by jimparis I will include a different USB chip into the design and thus getting rid of almost all additional components, making the device even smaller :) I then also will update the article on my homepage to be a bit more explanative.

Thoralt
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Have you actually tried to use psplink with the power init removed? If you edit sio.c in pspsdk and remove the last two function calls from pspDebugSioInit does it still work? If it does I'll be even more interested ;P

edit: Oh and what is driver support like for the usb chip? Need anything special?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

TyRaNiD wrote:edit: Oh and what is driver support like for the usb chip? Need anything special?
Might need to download FTDI's driver for Win or Mac. The ftdi_sio module is standard on Linux, as is uftdi on *BSD.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

I just made something similar out of a cell phone data cable from Radio Shack. It uses a Prolific PL2303 and outputs 3.3V on the TX line, seems to work fine with no pulldown. The same cable also works for SIO with a PS2. BTW, the remote connector is ~5 PCI pins wide :).
xflash
Posts: 2
Joined: Sun Jan 15, 2006 9:09 pm

Post by xflash »

Hello,

A really great thanks for your job! PSPlink is indeed a "must have" for anyone who wants to test/debug those productions.
I'm Wifi powered. (My soldering skills are .... too old :) ), I met some problems with an SDL app I wrote. It's freezing, when I launch it with psplink, but works fine from Vsh.
No traces to give, SDL redirects them, and stdout.txt and stderr.txt are empty ?!?
Any idea?


xFlash
bulb
Posts: 50
Joined: Thu Jan 19, 2006 10:59 pm

Post by bulb »

I have two issues with PSPLink.

1. Sometimes I can't exec ELF module that I have just copied. Usually I have to disable and reenable USB. Problems with buffer flushing?

2. Problems with file I/O that happen all the time. Whenever I write the file (from ELF module), it occupies size on the stick, but is nowhere to be found.
NoHexPleaseI'mBritish
Posts: 1
Joined: Sat Jan 28, 2006 2:24 am

Post by NoHexPleaseI'mBritish »

Great piece of software, I can really see this speeding my development times up. The fact I can now actually see my printf statements alone is a major time-saver.

I have a couple of issues though, that could be me not doing something right, or maybe its just how PSPLink is.

Firstly, i'm using WiFi mode.

When I copy my .ELF over to the PSP, then type exec myapp.elf, it starts up on the PSP just fine.

If I type exec to re-execute the same file or exec anotherapp.elf then it restarts PSPlink, killing the wifi connection and USB. Then it starts the app while the wifi in PSPLink is still init'ing. In my PSPGL app this means nothing is visible and the psp buttons don't work, but I can still hear my background music playing. Also if I type reset then it goes to a black screen and freezes for about 20 seconds and then the PSP powers off.

I thought it might have been something in my app, so I tried with Hello World and get the same results.

Am I building my ELF's wrong or something?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

bulb, there are issues with the use of usb and ms at the same time, there is no real way around that, that is just how the psp's drivers work. You are best to umount the usb drive and reset psplink (it will close usb on exit anyway) then rerun.

NoHexPleaseI'mBritish, I rarely use the exec command these days, I almost always use ld myfile.elf when I want to run a different executable once the shell comes up, exec works oki on sio but isn't so good on wifi as you have found out, if you need to pass complex arguments each time then either using pcterm (for a decent history) or create a script will suffice. As for the reset causing the psp to shut down I have seen this error before, it seems to be releated to having a kernel thread still running in user space. Absolutely no idea why it does this, it seems most likely to be a bug in the psp kernel somewhere, it gets itself stuck when resetting the system which then eventually kicks the watchdog off ;( Ensure your applications you are running are user mode only and that will fix the issue (but I know if you are running other apps this isn't always possible).
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

I have now added a version of GDB which runs over WIFI to PSPLINK. At the moment unfortunately it doesn't play nice with the WIFI shell for what ever reason so it is for SIO users only atm :( You will need to update newlib and pspsdk in order to use it (as usual :P)

With previous work from lovely2 the wifi GDB should be far better than previous versions, it is now a separate prx file which loads the debugee for you so you no longer need to use the inbuilt stub or for that matter kernel mode at all. It operates in a similar fashion to gdbserver does on *nix machines, you set it going with the "debug program.elf [args]" command in the shell then connect to it in GDB using the target remote command on port 6999.

Other improvements is it can now debug both ELF and PRX files and will handle the relocations as appropriate. I am going to try and implement threading support as well so you can manage the entire application from the PC which will be nice.

Anyway if you get a chance to test it obvisouly post any bug reports (and I am sure there will be some).
optixx00
Posts: 11
Joined: Mon Jul 18, 2005 1:40 am

Post by optixx00 »

Just got my SIO Cable working, but i can't start an elf. Any ideas.

Code: Select all

ms0:/apps/>  e p.elf
Exec 'ms0:/apps/p.elf'
modulemgr.c:ReadFile:sceIoRead(0xf000) failed: 0x8001001c
modulemgr.c:exe_thread:LoadModule failed: 0x8001001c
modulemgr.c:sceKernelLoadModuleWithApitype:sceKernelLoadModule failed 0x8001001c
lsm: Error loading module ms0:/apps/p.elf 8001001C
Failed to Load/Start module 'ms0:/apps/p.elf' Error: 0x8001001C
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

I have seen this before and it is down to buffering issues between the USB mass storage and the ms driver. Whenever you copy across a new app unmount or disconnect the usb drive and reset PSPLINK. Then it should run fine.
optixx00
Posts: 11
Joined: Mon Jul 18, 2005 1:40 am

Post by optixx00 »

Thx, the reset did it. Oh man wonderful tool. This makes psp dev work like charm. Quick turn around times and give practical debugging support. Great !

Is there a trick to reinit the SIO connection on psp side , as i lost the connection e.g. after plugging the sio cable off. At the moment iam forced to do an hard reset, holding power button for seconds.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Unfortunately not, I haven't got around to doing some more reversing of the hprm driver to allow the SIO to reinit. Maybe sometime :)
raf
Posts: 57
Joined: Thu Oct 13, 2005 7:38 am

Post by raf »

TyRaNiD wrote:Unfortunately not, I haven't got around to doing some more reversing of the hprm driver to allow the SIO to reinit. Maybe sometime :)
Thanks so much, TRaNiD, for such a wonderful tool!
I'm ashamed to say that I just discovered it; and it's already making my life so much easier..
Will have to make/get a sio cable now so I can use gdb!

Great job!

Raf
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

TyRaNiD, there seems to be problems with compiling psplink against the lastest sdk ? You've made changes to the prototypes in pspusb.h, which requires sceUsbDeactivate to take the product ID for the default USB driver as an argument, like for sceUsbActivate. This causes psplink to give compiler errors.

Works fine when passing 0x168 as in the call to sceUsbActivate.
Br, Sandberg
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

I tried with eboot loader 9 and wifi hack for 2.0 firmware and psplink don't work :/
should I get back to 1.5 firmware ?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

psplink relies on kernel mode access so it only works on 1.0 and 1.5 firmware, sorry.
Debug
Posts: 16
Joined: Thu Oct 06, 2005 4:16 am

Post by Debug »

When I try to compile PSPLINK I get what seems like a pretty bad error:

Code: Select all

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -fno-builtin-print
f -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -fno-builtin-printf   -c
 -o kmode.o kmode.S
kmode.S: Assembler messages:
kmode.S:9: Error: illegal operands `move $v0,$k1'
kmode.S:11: Error: illegal operands `move $k1,$a0'
kmode.S:19: Error: illegal operands `mfc0 $v0,$0'
kmode.S:20: Error: illegal operands `sw $v0,0($a0)'
kmode.S:21: Error: illegal operands `mfc0 $v0,$1'
kmode.S:22: Error: illegal operands `sw $v0,4($a0)'
kmode.S:23: Error: illegal operands `mfc0 $v0,$2'
kmode.S:24: Error: illegal operands `sw $v0,8($a0)'
kmode.S:25: Error: illegal operands `mfc0 $v0,$3'
kmode.S:26: Error: illegal operands `sw $v0,12($a0)'
kmode.S:27: Error: illegal operands `mfc0 $v0,$4'
kmode.S:28: Error: illegal operands `sw $v0,16($a0)'
kmode.S:29: Error: illegal operands `mfc0 $v0,$5'
kmode.S:30: Error: illegal operands `sw $v0,20($a0)'
kmode.S:31: Error: illegal operands `mfc0 $v0,$6'
kmode.S:32: Error: illegal operands `sw $v0,24($a0)'
kmode.S:33: Error: illegal operands `mfc0 $v0,$7'
kmode.S:34: Error: illegal operands `sw $v0,28($a0)'
kmode.S:35: Error: illegal operands `mfc0 $v0,$8'
kmode.S:36: Error: illegal operands `sw $v0,32($a0)'
kmode.S:37: Error: illegal operands `mfc0 $v0,$9'
kmode.S:38: Error: illegal operands `sw $v0,36($a0)'
kmode.S:39: Error: illegal operands `mfc0 $v0,$10'
kmode.S:40: Error: illegal operands `sw $v0,40($a0)'
kmode.S:41: Error: illegal operands `mfc0 $v0,$11'
kmode.S:42: Error: illegal operands `sw $v0,44($a0)'
kmode.S:43: Error: illegal operands `mfc0 $v0,$12'
kmode.S:44: Error: illegal operands `sw $v0,48($a0)'
kmode.S:45: Error: illegal operands `mfc0 $v0,$13'
kmode.S:46: Error: illegal operands `sw $v0,52($a0)'
kmode.S:47: Error: illegal operands `mfc0 $v0,$14'
kmode.S:48: Error: illegal operands `sw $v0,56($a0)'
kmode.S:49: Error: illegal operands `mfc0 $v0,$15'
kmode.S:50: Error: illegal operands `sw $v0,60($a0)'
kmode.S:51: Error: illegal operands `mfc0 $v0,$16'
kmode.S:52: Error: illegal operands `sw $v0,64($a0)'
kmode.S:53: Error: illegal operands `mfc0 $v0,$17'
kmode.S:54: Error: illegal operands `sw $v0,68($a0)'
kmode.S:55: Error: illegal operands `mfc0 $v0,$18'
kmode.S:56: Error: illegal operands `sw $v0,72($a0)'
kmode.S:57: Error: illegal operands `mfc0 $v0,$19'
kmode.S:58: Error: illegal operands `sw $v0,76($a0)'
kmode.S:59: Error: illegal operands `mfc0 $v0,$20'
kmode.S:60: Error: illegal operands `sw $v0,80($a0)'
kmode.S:61: Error: illegal operands `mfc0 $v0,$21'
kmode.S:62: Error: illegal operands `sw $v0,84($a0)'
kmode.S:63: Error: illegal operands `mfc0 $v0,$22'
kmode.S:64: Error: illegal operands `sw $v0,88($a0)'
kmode.S:65: Error: illegal operands `mfc0 $v0,$23'
kmode.S:66: Error: illegal operands `sw $v0,92($a0)'
kmode.S:67: Error: illegal operands `mfc0 $v0,$24'
kmode.S:68: Error: illegal operands `sw $v0,96($a0)'
kmode.S:69: Error: illegal operands `mfc0 $v0,$25'
kmode.S:70: Error: illegal operands `sw $v0,100($a0)'
kmode.S:71: Error: illegal operands `mfc0 $v0,$26'
kmode.S:72: Error: illegal operands `sw $v0,104($a0)'
kmode.S:73: Error: illegal operands `mfc0 $v0,$27'
kmode.S:74: Error: illegal operands `sw $v0,108($a0)'
kmode.S:75: Error: illegal operands `mfc0 $v0,$28'
kmode.S:76: Error: illegal operands `sw $v0,112($a0)'
kmode.S:77: Error: illegal operands `mfc0 $v0,$29'
kmode.S:78: Error: illegal operands `sw $v0,116($a0)'
kmode.S:79: Error: illegal operands `mfc0 $v0,$30'
kmode.S:80: Error: illegal operands `sw $v0,120($a0)'
kmode.S:81: Error: illegal operands `mfc0 $v0,$31'
kmode.S:82: Error: illegal operands `sw $v0,124($a0)'
kmode.S:83: Error: illegal operands `addiu $a0,$a0,128'
kmode.S:84: Error: illegal operands `cfc0 $v0,$0'
kmode.S:85: Error: illegal operands `sw $v0,0($a0)'
kmode.S:86: Error: illegal operands `cfc0 $v0,$1'
kmode.S:87: Error: illegal operands `sw $v0,4($a0)'
kmode.S:88: Error: illegal operands `cfc0 $v0,$2'
kmode.S:89: Error: illegal operands `sw $v0,8($a0)'
kmode.S:90: Error: illegal operands `cfc0 $v0,$3'
kmode.S:91: Error: illegal operands `sw $v0,12($a0)'
kmode.S:92: Error: illegal operands `cfc0 $v0,$4'
kmode.S:93: Error: illegal operands `sw $v0,16($a0)'
kmode.S:94: Error: illegal operands `cfc0 $v0,$5'
kmode.S:95: Error: illegal operands `sw $v0,20($a0)'
kmode.S:96: Error: illegal operands `cfc0 $v0,$6'
kmode.S:97: Error: illegal operands `sw $v0,24($a0)'
kmode.S:98: Error: illegal operands `cfc0 $v0,$7'
kmode.S:99: Error: illegal operands `sw $v0,28($a0)'
kmode.S:100: Error: illegal operands `cfc0 $v0,$8'
kmode.S:101: Error: illegal operands `sw $v0,32($a0)'
kmode.S:102: Error: illegal operands `cfc0 $v0,$9'
kmode.S:103: Error: illegal operands `sw $v0,36($a0)'
kmode.S:104: Error: illegal operands `cfc0 $v0,$10'
kmode.S:105: Error: illegal operands `sw $v0,40($a0)'
kmode.S:106: Error: illegal operands `cfc0 $v0,$11'
kmode.S:107: Error: illegal operands `sw $v0,44($a0)'
kmode.S:108: Error: illegal operands `cfc0 $v0,$12'
kmode.S:109: Error: illegal operands `sw $v0,48($a0)'
kmode.S:110: Error: illegal operands `cfc0 $v0,$13'
kmode.S:111: Error: illegal operands `sw $v0,52($a0)'
kmode.S:112: Error: illegal operands `cfc0 $v0,$14'
kmode.S:113: Error: illegal operands `sw $v0,56($a0)'
kmode.S:114: Error: illegal operands `cfc0 $v0,$15'
kmode.S:115: Error: illegal operands `sw $v0,60($a0)'
kmode.S:116: Error: illegal operands `cfc0 $v0,$16'
kmode.S:117: Error: illegal operands `sw $v0,64($a0)'
kmode.S:118: Error: illegal operands `cfc0 $v0,$17'
kmode.S:119: Error: illegal operands `sw $v0,68($a0)'
kmode.S:120: Error: illegal operands `cfc0 $v0,$18'
kmode.S:121: Error: illegal operands `sw $v0,72($a0)'
kmode.S:122: Error: illegal operands `cfc0 $v0,$19'
kmode.S:123: Error: illegal operands `sw $v0,76($a0)'
kmode.S:124: Error: illegal operands `cfc0 $v0,$20'
kmode.S:125: Error: illegal operands `sw $v0,80($a0)'
kmode.S:126: Error: illegal operands `cfc0 $v0,$21'
kmode.S:127: Error: illegal operands `sw $v0,84($a0)'
kmode.S:128: Error: illegal operands `cfc0 $v0,$22'
kmode.S:129: Error: illegal operands `sw $v0,88($a0)'
kmode.S:130: Error: illegal operands `cfc0 $v0,$23'
kmode.S:131: Error: illegal operands `sw $v0,92($a0)'
kmode.S:132: Error: illegal operands `cfc0 $v0,$24'
kmode.S:133: Error: illegal operands `sw $v0,96($a0)'
kmode.S:134: Error: illegal operands `cfc0 $v0,$25'
kmode.S:135: Error: illegal operands `sw $v0,100($a0)'
kmode.S:136: Error: illegal operands `cfc0 $v0,$26'
kmode.S:137: Error: illegal operands `sw $v0,104($a0)'
kmode.S:138: Error: illegal operands `cfc0 $v0,$27'
kmode.S:139: Error: illegal operands `sw $v0,108($a0)'
kmode.S:140: Error: illegal operands `cfc0 $v0,$28'
kmode.S:141: Error: illegal operands `sw $v0,112($a0)'
kmode.S:142: Error: illegal operands `cfc0 $v0,$29'
kmode.S:143: Error: illegal operands `sw $v0,116($a0)'
kmode.S:144: Error: illegal operands `cfc0 $v0,$30'
kmode.S:145: Error: illegal operands `sw $v0,120($a0)'
kmode.S:146: Error: illegal operands `cfc0 $v0,$31'
kmode.S:147: Error: illegal operands `sw $v0,124($a0)'
kmode.S:161: Error: illegal operands `sw $a0,4($sp)'
kmode.S:162: Error: illegal operands `sw $a1,8($sp)'
kmode.S:163: Error: illegal operands `sw $a2,12($sp)'
kmode.S:164: Error: illegal operands `sw $a3,16($sp)'
kmode.S:165: Error: illegal operands `sw $t0,20($sp)'
kmode.S:166: Error: illegal operands `sw $t1,24($sp)'
kmode.S:167: Error: illegal operands `move $a0,$v0'
kmode.S:169: Error: illegal operands `addiu $a1,$sp,4'
kmode.S:172: Error: illegal operands `lw $a0,4($sp)'
kmode.S:173: Error: illegal operands `lw $a1,8($sp)'
kmode.S:174: Error: illegal operands `lw $a2,12($sp)'
kmode.S:175: Error: illegal operands `lw $a3,16($sp)'
kmode.S:176: Error: illegal operands `lw $t0,20($sp)'
kmode.S:177: Error: illegal operands `lw $t1,24($sp)'
kmode.S:179: Error: illegal operands `beq $v0,$0,1f'
kmode.S:181: Error: illegal operands `jr $v0'
kmode.S:186: Error: illegal operands `move $v0,$0'
kmode.S:193: Error: illegal operands `li $v0,0'
kmode.S:200: Error: illegal operands `li $v0,1'
kmode.S:207: Error: illegal operands `li $v0,2'
kmode.S:214: Error: illegal operands `li $v0,3'
kmode.S:221: Error: illegal operands `li $v0,4'
kmode.S:228: Error: illegal operands `li $v0,5'
kmode.S:235: Error: illegal operands `li $v0,6'
kmode.S:242: Error: illegal operands `li $v0,7'
kmode.S:249: Error: illegal operands `li $v0,8'
kmode.S:256: Error: illegal operands `li $v0,9'
kmode.S:263: Error: illegal operands `li $v0,10'
kmode.S:270: Error: illegal operands `li $v0,11'
kmode.S:277: Error: illegal operands `li $v0,12'
kmode.S:284: Error: illegal operands `li $v0,13'
kmode.S:291: Error: illegal operands `li $v0,14'
kmode.S:298: Error: illegal operands `li $v0,15'
make: *** [kmode.o] Error 1
Anyone know why this happens?

Code: Select all

catch(IOException e){
//oh crap
}
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

you have got an old old toolchain build, you will need to update it to get it to build correctly.
Debug
Posts: 16
Joined: Thu Oct 06, 2005 4:16 am

Post by Debug »

I see, thanks. Unfortunately, I updated the toolchain from svn to make sure, then I ran ./toolchian.sh -p. It was going fine until here:

Code: Select all

/cygdrive/f/DOCUME~1/Allen/LOCALS~1/Temp/ccNqBoly.s: Assembler messages:
/cygdrive/f/DOCUME~1/Allen/LOCALS~1/Temp/ccNqBoly.s:53: Error: illegal operands
`vmidt.q M300'
/cygdrive/f/DOCUME~1/Allen/LOCALS~1/Temp/ccNqBoly.s:90: Error: illegal operands
`vmidt.q M300'
make[3]: *** [sceGumLoadIdentity_vfpu.o] Error 1
make[3]: Leaving directory `/tmp/pspdev/pspsdk/src/gum'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/pspdev/pspsdk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/pspdev/pspsdk'
make: *** [all] Error 2
ERROR BUILDING PSPSDK
Should I run the entire toolchain or is that something else?

Code: Select all

catch(IOException e){
//oh crap
}
Oobles
Site Admin
Posts: 347
Joined: Sat Jan 17, 2004 9:49 am
Location: Melbourne, Australia
Contact:

Post by Oobles »

Yes, you need to run the full toolchain script, not just the SDK. The operands are now part of GCC, so you need to rebuild it.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Okay this is going to need testing. I have added a USB based host filing system to PSPLINK, it uses libusb to communicate with the PSP from user mode, it claims to work on most *nix like systems though I have had issues with it before so this is a good time for people to try it ;) For info I run x86 linux on a 2.6 kernel, and it works fine for me. There is a libusb port for windows but lacking an easily accessible windows machine with dev tools on it I haven't yet tested it on that.

Brief description of how it works, you enable hostfs on the PSP by setting usbhost=1 in the psplink.ini file, you then run up a tool on your PC which uses libusb to communicate with the PSP and serve file data. It supports mapping upto 8 directories (and more if you change the PC side code define) so you can access different directories under host0 or host5 for example. All commands are supported, though devctl and ioctl have not been fully implemented yet, got some plans for those.

It wont like you blocking on the PC side read so no blocking sockets yet but for the most part it should do what people need in a host filing system.

I have tested with USB 1.1 and 2.0 and they both seem to work fine, 1.1 gets around 1Mb/s and 2 around 10Mb/s, so best plug it into a 2.0 host port ;)

Oh and final thing, if you are building on a big-endian machine (i.e. a mac) then make the PC side tool with 'make BUILD_BIGENDIAN=1', that will ensure all integer values are swapped around correctly, however I haven't tested it so YMMV.

Report any bugs to /dev/null, thx.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Update: I decided to try my hand at getting the hostfs to work on a windows box and I suceeded, so I thought I might as well post the info. You will need to build in cygwin as there are too many unixism for it to build correctly on vanilla win32 or mingw.

Download the latest snapshot of the libusb-win32 driver (not the filter driver) from libusb-win32.sourceforge.net. Extract to a directory.

Start up psplink with the hostfs driver enabled, Windows should try and install a driver, just ignore that for now. In the bin directory of libusb run inf-wizard, follow the instructions, select the PSP Type-B device, and choose the bin directory as your output. This should have produced a *.inf and *.cat file. Complete the windows driver installation but tell it you will specify the directory, point it at the bin directory and it should pick it up and install the driver.

Now copy include/usb.h and lib/gcc/libusb.a from the extracted directory and copy them into the usbhostfs_pc directory in cygwin.

Open up cygwin and navigate to the usbhostfs_pc directory, you will now need to edit a few bits.
Edit Makefile, add -I. to CFLAGS and then add the line LDFLAGS=-L.
Edit main.c, on line 1669 change the final parameter of euid_usb_bulk_read from 0 to INFINITE.
Type make and it should build. Then run as normal.

There is of course a caveat, seems that on linux bulk reads fail with a 0 byte read when the USB device is disconnected, but on Windows it doesn't seem to do anything at all, i can probably get around it by implementing a goodbye command from the USB device to tell the PC side it should shutdown, but then again that'll teach you for using Windows ;) the fix is obviously to shutdown the hostfs app once the psp has rebooted and rerun it.
pspkrazy
Posts: 49
Joined: Mon Jul 04, 2005 1:31 am

wow

Post by pspkrazy »

Amazing job.

Everyone can now use your debug tool with ease and power.

Great.

PS : Are you planning to make an usb shell ? It will be great for poeple like me who don't have a SIO cable (cause wifi sucks a little).
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Probably, I have left in what I think I need to support a shell in the current driver, my main issue is really with implementing on the PC side, libusb doesn't seem the best thing for actually doing what I need it to do. Will look into it later.
psx-frogger
Posts: 5
Joined: Mon Jan 16, 2006 7:27 pm

Post by psx-frogger »

Hi Tyranid,

Thanks for this great tool.

I saw on the svn that the Pdf documentation is talking abouit version 0.9b.

Have you released the 0.9b version ?

Regards

Psx-frogger
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Technically the subversion code is 0.9b, will probably not release a 0.9b until I have a USB shell and that will probably be 0.9c, or more depending what I feel like. For now just use the subversion version.
johnmph
Posts: 119
Joined: Sat Jul 23, 2005 11:48 pm

Post by johnmph »

Hello TyRaNiD, beautiful tool ;-)

In your find_syscall_addr function (apihook.c), you use a u32 pointer to access syscall table (u32 *syscalls) :

Code: Select all

void *find_syscall_addr(u32 addr)
{
	struct SyscallHeader *head;
	u32 *syscalls;
	void **ptr;
	int size;
	int i;

	asm(
			"cfc0 %0, $12\n"
			: "=r"(ptr)
	   );

	if(!ptr)
	{
		return NULL;
	}

	head = (struct SyscallHeader *) *ptr;
	syscalls = (u32*) (*ptr + 0x10);
	size = (head->size - 0x10);

	for&#40;i = 0; i < size; i++&#41;
	&#123;
		if&#40;syscalls&#91;i&#93; == addr&#41;
		&#123;
			return &syscalls&#91;i&#93;;
		&#125;
	&#125;

	return NULL;
&#125;
and you calculate size with : head->size - 0x10

but this size is in bytes, and you use this with a u32 pointer, the size should not be rather :

size = (head->size - 0x10) / sizeof(u32);

(Sorry for my ultra bad english) ;-)
Post Reply