[ros-dev] Memory Manager Patch to allow mapping of device memory into UserMode - please review.

Hartmut Birr hartmut.birr at gmx.de
Mon Feb 7 21:38:32 CET 2005


Gregor Anich schrieb:

> Hi!
>
> I have changed the memory manager to allow mapping of sections from 
> \Device\PhysicalMemory which are outside of RAM - this gets NVIDIA 
> OpenGL working.
> I hope my changes are correct (according to Hartmuts suggestions in 
> this mail: 
> http://reactos.com:8080/archives/public/ros-kernel/2004-August/004444.html) 
>
>
> I changed MmProbeAndLockPages to set MDL_IO_SPACE in the MdlFlags of 
> the Mdl if one of the Pfns described in the MDL is outside of the RAM 
> (>= MmPageArraySize) which is then used in 
> MmMapLockedPagesSpecifyCache to decide wether to call 
> MmCreateVirtualMapping or MmCreateVirtualMappingUnsafe (in order to 
> prevent bugchecks in mm/freelist.c when Pfns are checked against 
> MmPageArraySize)
>
> - blight
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Ros-dev mailing list
>Ros-dev at reactos.com
>http://reactos.com:8080/mailman/listinfo/ros-dev
>
Hi,

I think that your patch isn't complete.

- Mapping of physical memory for \Device\PhysicalMemory in section.c:
We should use MmCreateVirtualMappingForKernel instead of 
MmCreateVirtualMappingUnsafe because MmCreateVirtualMappingUnsafe marks 
the pages as mapped in the pfn array. If MmCreateVirtualMappingForKernel 
is used for mapping the pages, the delete functions like 
MmUnmapViewOfxxx and MmFreeMemoryArea must also use other functions.

- Lock the pages with MmProbeAndLockPages in mdl.c:
MmProbeAndLockPages may crash ros in some situations. On error there is 
no check which unmap/unlock function must be use. Possible we must check 
the type of the memory area for eache address and page.

- Hartmut




More information about the Ros-dev mailing list