Hi kedar!
The following code should run in kernel mode for allocation . You get
userbuffer locked to logical buffer.
VirtualBuffer =
HalAllocateCommonBuffer(DmaAdapter,0x1000,&PhysicalBuffer,FALSE);
MemMDL =
IoAllocateMdl(VirtualBuffer,0x1000,FALSE,FALSE,NULL);
MmBuildMdlForNonPagedPool(MemMDL);
UserBuffer = MmMapLockedPages(MemMDL,UserMode);
So user get this address.
The following code should be used to deallocate buffer.
MmUnmapLockedPages(UserBuffer, MemMDL);
IoFreeMdl(MemMDL);
HalFreeCommonBuffer(DmaAdapter,0x1000,PhysicalBuffer,VirtualBuffer,FALSE);
You need to write an application which has ioctl calls to call these
routines
Vysyaraju Dali Raju
Vysyaraju Daliraju, / Systems Software Engineer
SBS Technologies, 8371C Central Ave. / Newark, CA 94560
Phone: 510-742-2570 / Fax: -2501 / EMail: xxxxx@sbs.com
mailto:xxxxx
-----Original Message-----
From: kedar [mailto:xxxxx@hotmail.com]
Sent: Friday, October 11, 2002 8:25 AM
To: NT Developers Interest List
Subject: [ntdev] Mapping a physical memory to linear address
Hai All,
I want to access the physical memory address of RAM in the system from a
User Mode Application. Is there any way to do this?
Are there funtions available to map the physical address to linear address
in the user mode.
Is it neccessary for me to write a kernel module to achieve this.
Any information is greatly helpful.
Thanks in advance,
kedar.
—
You are currently subscribed to ntdev as: xxxxx@sbs.com
To unsubscribe send a blank email to %%email.unsub%%</mailto:xxxxx>