access user mode memory from kernel mode

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

Moderators: cheriff, TyRaNiD

Post Reply
BenHur
Posts: 28
Joined: Sat Oct 20, 2007 5:26 pm

access user mode memory from kernel mode

Post by BenHur »

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: Select all

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
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
Post Reply