Stop/ unload vshmain "vsh_module"

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

Moderators: cheriff, TyRaNiD

Post Reply
k!rk
Posts: 11
Joined: Fri Jul 18, 2008 8:26 am

Stop/ unload vshmain "vsh_module"

Post by k!rk »

Hi there,

wondering for a while now if there is a way to unload the vsh from another vsh module?
Stop/ unload module is only working in kernel mode afaik.

Need to figure out a way to unload vshmain from a module which is working in vsh mode too.

Thanks for any hints and help. :)
Hellcat
Posts: 83
Joined: Wed Jan 24, 2007 2:52 pm

Post by Hellcat »

You can make a kernel mode module, load that and kill the VSH from there - or at least try.


And here comes a problem of my own, similar to this one:
- I am in 3.xx kernel (4.01 ATM, to be precise)
- I am in kernel mode (kernel .PRX, loaded from my VSH mode one (0x800))
- I did sceIoUnassign() flash0 to 3 (3 didn't exist anyway)
- I did pspSdkSetK1(0)
- when I now try to stop the lfatfs driver module, I get a "0x80020136" - wich is "Module can not stop"

Anyone a small hint how I can make the module to stop and unload?
It's working perfectly fine in that dead thing.... what was it called again.... right: 1.50.... but I need 3.xx+ :)
k!rk
Posts: 11
Joined: Fri Jul 18, 2008 8:26 am

Post by k!rk »

Thanks for the reply Hellcat.


I tried to load a kmode.prx from my vsh module but then the vsh could not be loaded anymore. maybe it was just my fault think i have to try again.

At the moment im testing with a 0x1000 modul running as a plugin using sceFindModuleByName- stopModule - unloadModule.

It seems the vsh is stopped but not full since i can navigate in the xmb
for some seconds, xmb stops working after some movements and the psp will shutdown.

So it looks like my prx is working but not how it should. Any ideas?
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

I'm just speculating but I don't think the VSH can be easily unloaded, as it may not have been designed to be unloaded. It may not have any cleanup routines. RAM is probably remaining occupied, the GU is initialized and functioning, etc etc. The only way it usually exits is with a kernel reboot when you launch a game/homebrew, in which case cleanup is pointless.
k!rk
Posts: 11
Joined: Fri Jul 18, 2008 8:26 am

Post by k!rk »

Exactly... thats the problem obvious.

I thought myself about it while watching the topmenu in the unloaded VSH and came to the same conclusion. Stupid me!
As you said much more stuff is loaded while running the XMB and it looks like its something which cant be done that way.

Whats the function to laod a specific module on reboot?
I cant recall right now but think ive seen something in the SDK if im right.

Will dig a little.


Thanks for your input.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

k!rk wrote: Whats the function to laod a specific module on reboot?
Theres a working example in the 4.01m33-2 update SDK.

In any case its not only about unloading vshmain.prx. Even before vshmain.prx is loaded, 21.5MB or User mode memory is ALREADY occupied by the previous modules. There is only around 2.5MB free.

On the Slim PSP nearly 34MB of User memory is used BEFORE vshmain.prx is loaded.

I think the only straight forward way is to reboot into a module using the M33 SDK example. Even if you make a custom vshmain.prx (like in Lockdown Password Protection) you will only have 2.5MB on the Phat and 22MB on the Slim.
Post Reply