Re: Physical memory access from C# in WinCE 6.0
- From: Bradley Remedios <bremedios@xxxxxxxxx>
- Date: Wed, 12 Nov 2008 14:08:30 -0800 (PST)
On Nov 12, 9:24 am, Albert_Knosos
<AlbertKno...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I am using Windows CE 6.0, Compact Framework 2.0, and I want to access
physical memory from C#.
I have a driver and I can call it from C#, because it is loaded in boot time.
I have tried an IoControl, that does the following:
case IOCTL_FPGA_MAPPING:
PHYSICAL_ADDRESS FPGA_addr;
FPGA_addr.HighPart = 0;
FPGA_addr.LowPart = 0x110;
PVOID pFPGA;
pFPGA = MmMapIoSpace(FPGA_addr,0xA6,FALSE);
if (pFPGA == NULL) {
DEBUGMSG(ZONE_INIT,(L"MMA: MmMap Malament\r\n"));
} else {
DEBUGMSG(ZONE_INIT,(L"MMA: MmMap OK\r\n"));
}
pBufOut = (PBYTE)
VirtualAllocCopyEx((HANDLE)GetDirectCallerProcessId(),GetCurrentProcess(),pFPGA,0xA6,PAGE_READWRITE);
break;
What I pretend to do here is to map from 0x110 to 0x1B5, for the C#
application to use them.
I use the MmMapIoSpace to have a virtual address, and then I do a
VirtualAllocCopyEx to copy the virtual address pointer (pFPGA) to the out
pointer of the IoControl (pBufOut).
Could it work?
Thanks in advance, I am new to drivers in Windows in general and I feel
quite lost...
I don't know if that is still possible at all via Windows CE 6.0
(perhaps someone can comment as to whether it is feasible) but I
wouldn't suggest doing that myself even if it is.
My recommendation is always to have a driver (kernel or user) do the
work on behalf of a user-space library / application. In this case
(without really knowing your system / requirements) I would likely
write a Stream-Driver that would interact with the FPGA on behalf of
the C# Application.
Although this doesn't really answer your question of whether it is
possible, I hope this helps,
Brad.
.
- Follow-Ups:
- Re: Physical memory access from C# in WinCE 6.0
- From: Albert_Knosos
- Re: Physical memory access from C# in WinCE 6.0
- References:
- Physical memory access from C# in WinCE 6.0
- From: Albert_Knosos
- Physical memory access from C# in WinCE 6.0
- Prev by Date: InterruptInitialize fails
- Next by Date: Re: InterruptInitialize fails
- Previous by thread: Physical memory access from C# in WinCE 6.0
- Next by thread: Re: Physical memory access from C# in WinCE 6.0
- Index(es):
Relevant Pages
|