Re: Allocating and accessing physically contiguous memory in user mode in WinCE 6.0 Beta



Hi,

Very interresting but where is the function "GetContiguousPages" in CE 6?
I did not find what LIB to include.
Also by the way, in CE 5 I was able to use some SC_functions like:
SC_GetProcAddressW
LoadOneLibraryW
FreeOneLibrary
SC_CreateFileW
SC_CloseHandle
SC_ReadFile
SC_WriteFileWithSeek
SC_GetLastError
SC_DeviceIoControl

etc...

I use them in OALIoCtlHalGetHiveCleanFlag or OALIoCtlHalInitRTC to do some
special jobs.

Where and how to access those functions now?

Regards



<seehwan.yoo@xxxxxxxxx> wrote in message
news:1161936392.146411.13960@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear,

I think, you cannot do that easily.

Because of the new VM architecture, CE6 kernel works much like a modern
operating system, and cannot access kernel address space in user mode.

In the kernel mode, you can get free contiguous pages from the function
call "GetContiguousPages".

At first, prepare a system call which gets pointer to map a user mode
virtual address space to a physical address space, or you just can get
the pointer from the call.

Now, inside the kernel system call function, you should map the address
with a given pointer value, to a physically contiguous pages.

If the pointer value is not specified by the user, kernel can specify
by observing the VM address space of the process.

You can get the contiguous pages by callling the "GetContiguousPages"
and

map in the page table which is specified by the ppdir pointer.

I am not sure this is what you want..

The pointer that user has given should be valid, and the boundary
should be always correct.

After the mapping, you can access the memory without any constraints,
but before that you should check the VM specification which is
specified in vmlayout.h

Best regards.

somraj wrote:
Hi,

I'm currently working in 6.0 Beta.

I want to allocate a physically contiguous memory chunk for my
application. Earlier in 5.0, I could easily do it through
AllocPhysMem()/MmMapIoSpace() calls. But now in 6.0, these calls don't
work in User mode.

One approach I tried was by developing a Kernel mode memory allocator
driver which allocates the contiguous chunk. But the virtual address I
get through that is valid in Kernel space only and I'm unable to use it
in the application space. I have tried
SetProcPermissions()/ReadProcessMemory() type of calls but to no avail
!

If anyone has faced this issue before and know the solution, would be
great if he can share that.

thanks and regards,
Somraj Mani



.



Relevant Pages


Loading