forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Export from kernel import on user

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Thu Mar 05, 2009 4:52 am    Post subject: Export from kernel import on user Reply with quote

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?
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Thu Mar 05, 2009 6:01 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Thu Mar 05, 2009 7:48 am    Post subject: Reply with quote

Thx very much, this sample helped me.
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Thu Mar 05, 2009 1:04 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
coolkehon



Joined: 20 Oct 2008
Posts: 355

PostPosted: Fri Mar 06, 2009 2:10 am    Post subject: Reply with quote

hotter wrote:
Thx very much, this sample helped me.


finally i helped someone no problem
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group