Closed DavisDev closed 7 years ago
I don't know exactly but here are a few examples of a user application loading a kernel module
https://github.com/xerpi/hidmouse/tree/master/skprx
https://github.com/TheOfficialFloW/VitaShell/search?utf8=%E2%9C%93&q=startusb&type=Code
Hello, I had already tried and reviewed both samples, The difference is that they do not export in the prx, and import in the application. I suppose, some of that is the cause in my particular situation.
Importing happens at launch. If the module is not loaded then, the import stubs are not filled.
Any idea how to fix it? Maybe get the functions dynamically?
Is there a way to know that a prx kernel was previously loaded? I have a plan, check that the prx kernel is not loaded, load it, reboot eboot.bin, and check that the prx kernel is loaded, and continue.
Well one solution is to make a wrapper suprx that imports functions from skprx. Then use the weak import of the suprx. So for example, userprx
imports from kernelprx
and has wrapper functions to kernelprx
eboot.bin
load kernelprx.skprx
userprx.suprx
export wrapper calls to kernelprx.suprx
eboot.bin
load userprx.suprx
userprx.suprx
wrapper functionsThe problem is that kernel modules cannot export weak symbols (that's a Sony limitation I guess) but user modules can.
Thank you very much @yifanlu ! It works great, yes, it's a bit more work, but, in the end, what's important is that it works. Thanks again yifan, I proceed to mark this case as solved.
I am loading a kernel module from an application in user mode, Using the API taihen, as follows:
SceUID modkernel = taiLoadStartKernelModule("ux0:/mylib.skprx", 0, NULL, 0);
Always the first time I run the application after having installed henkaku, it crashes, the second no longer gives the crash, and works great! It should be mentioned that the user application, it imports prx functions, In the module_start, no action is performed, Could someone help me solve this problem?
Any help will be appreciated.