I am trying to export function from kernel and import it on user mode prx, but make that work. It doesnt work when I am trying to export function from user and import it on kernel mode too. So is it possible to do that at all?
I guess it is users and kernels memory issues, because when I export from kernel and import on kernel everything work...
How could I solve this?
Export from kernel import on user
Export from kernel import on user
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
yeah it works i got it to work here is a working sample i use for my games i'm gonna post it soon somewhere but for now its on sendspace http://www.sendspace.com/file/dadsbe
You can export from kernel to user (via a syscall) with an exports file like this:
PSP_EXPORT_START(kubridge, 0, 0x4001)
PSP_EXPORT_FUNC(some_kernel_to_user_function)
PSP_EXPORT_END
Then import it with 0x40090000 in stubs file:
STUB_START "kubridge",0x40090000,0x00010005
STUB_FUNC 0x12345678,some_kernel_to_user_function
For user to kernel, export the function normally from using the exports file. Then in your kernel module declare a prototype for the function. Then you have to find the address of the function at runtime using sctrlHENFindFunction (or using apihook if you don't want to import SystemCtrl from M33DSK) and assign it to the prototype. Before you call the function, you need to remove kernel-user memory protection using setDDRMemoryProtection or something.
PSP_EXPORT_START(kubridge, 0, 0x4001)
PSP_EXPORT_FUNC(some_kernel_to_user_function)
PSP_EXPORT_END
Then import it with 0x40090000 in stubs file:
STUB_START "kubridge",0x40090000,0x00010005
STUB_FUNC 0x12345678,some_kernel_to_user_function
For user to kernel, export the function normally from using the exports file. Then in your kernel module declare a prototype for the function. Then you have to find the address of the function at runtime using sctrlHENFindFunction (or using apihook if you don't want to import SystemCtrl from M33DSK) and assign it to the prototype. Before you call the function, you need to remove kernel-user memory protection using setDDRMemoryProtection or something.