USB in user mode?

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

Moderators: cheriff, TyRaNiD

Post Reply
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

USB in user mode?

Post by Brunni »

Sorry if my question is dumb or has already been answered, but can someone tell me if it's possible to enable USB trough USER mode please? I heard something about this some time ago, but I can't find it anymore...
The method I currently use is the one from PSPSDK SVN samples (load usb driver, etc.), and it needs KERNEL mode to run... :-(
Thanks in advance for your help :-)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

You theoretically can, but the trouble is you cannot load the USB drivers to begin with. The actual code to startup the USb driver is accessible from user mode.
Fanjita
Posts: 217
Joined: Wed Sep 28, 2005 9:31 am

Post by Fanjita »

As a side note, the USB drivers appear to all be already loaded appropriately in VSH mode, so if you're running your app via the v2.0 TIFF exploit, then you can have basic USB support in user mode :).

On the topic of kernel mode being required to load kernel modules - has anyone done any digging into how UMD games load their network support? I had a poke around on GTA to try to see how it does it, but all I can see are sceKernelLoadModuleById() calls being called on file descriptors to fairly boring modules (libatrac3, IIRC). No mention whatsoever of the network libs, yet I'm sure that they're loaded dynamically because they're not present in memory dumps taken from the game save exploit.

I aim to take a look at some other apps (e.g. Wipeout) to see if I can see what they're doing to enable infrastructure support, but maybe someone is way ahead of me on this already?
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

The kernel permits certain device to be used as a target for LoadModule et al. UMD being the obvious case. Unfortunately flash isn't one of them, nor is MS. There is the LoadModuleMS call but from the testing I did a while back that would only load encrypted kernel modules, not user modules which would be necessary for loading the network libraries.

You could theoretically load the network modules straight off the UMD in GTA I would expect using sceKernelLoadModule or sceKernelLoadModuleId unless Sony have changed things around (I doubt it very much).
Fanjita
Posts: 217
Joined: Wed Sep 28, 2005 9:31 am

Post by Fanjita »

That's the thing, I'm sure that games using the network must be loading their modules from the UMD.

But for the life of me I can't see how GTA is doing it - LoadModuleById() is the only relevant function it imports from ModuleMgr, but that is only called by a small number of code paths, none of which seem related to the network. Plus, the filename for the network modules never appears in BOOT.BIN (whereas the ATRAC3 module does).

Incidentally, vshLoadModule is able to load some modules (I haven't fully explored the exhaustive list) from flash, but not the MS, if you happen to have VSH privileges (and library) available.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Unfortunately I do not have GTA so cannot really help you there but as you say it must be doing it somewhere.

And yesy vsh stuff can load different modules, it needs to be able to do so. I would assume you could also load modules into a ram buffer and call vshLoadModuleBuffer on them but yet to actually try that in practice.
hubevolution
Posts: 32
Joined: Wed Mar 17, 2004 6:59 pm

Post by hubevolution »

Fanjita wrote:Incidentally, vshLoadModule is able to load some modules (I haven't fully explored the exhaustive list) from flash, but not the MS, if you happen to have VSH privileges (and library) available.
well in any case GTA does not run in VSH mode am I right ? so it cannot call the vshLoadModule.
Post Reply