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 

access user mode memory from kernel mode

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



Joined: 20 Oct 2007
Posts: 30

PostPosted: Tue Dec 22, 2009 6:45 am    Post subject: access user mode memory from kernel mode Reply with quote

Hi,

I'm using the htmlviewer (from the pspsdk sample dir) and hook some sceIO-functions to intercept file-queries to serve websites to it (the goal is a simple offline wiki-reader). However, I seem to have problems in the kernel module with allocating memory from the user mode memory block (kernel memory isn't enough):
Code:
int memid = sceKernelAllocPartitionMemory(2, "mybuffer", 0, size, NULL);
char* ptr  = sceKernelGetBlockHeadAddr(memid);
returns a valid address, but after using the memory the htmlviewer hangs while shuting down. Could this be related to an improper memory allocation? How is it done properly? (FYI: htmlviewer uses sceKernelCreateVpl and sceKernelAllocateVpl to allocate memory).

Any thoughts?

Cheers, BenHur
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Wed Dec 23, 2009 5:55 am    Post subject: Reply with quote

I have no idea, but are you allocating the memory first and then finally loading the htmlviewer? If not maybe it has some problem with fragmentation :S

Try creating a heap at the beginning and allocating from that instead of raw allocation from the partition repeatedly.
Back to top
View user's profile Send private message
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