[ros-kernel] PCI device memory mapping into usermode - Page at
address 0xXxx not usable
James Tabor
jimtabor at adsl-64-217-116-74.dsl.hstntx.swbell.net
Wed Aug 18 06:36:22 CEST 2004
Hi,
Royce Mitchell III wrote:
> This question seems to have gone unanswered. Does anybody have any ideas
> to share with Gregor?
>
> Gregor Anich wrote:
>
>> Hi!
>>
>> From time to time I am working to get the NVIDIA OpenGL driver running
>> a bit... It is trying to map it's framebuffer into user-mode using
>> VideoPortMapMemory() (reactos/drivers/video/videoprt/resource.c) which
>> does not handle usermode at the moment, but I am trying to fix it.
>> People told me to map a view of \Device\PhysicalMemory into usermode.
>> If I do this (given the physical address from
>> HalTranslateBusAddress()) all the calls succeed and I return a
>> user-mode pointer. On the first access to this area a not-present
>> fault happens and the mm is trying to create the mapping now. It fails
>> in ntoskrnl/mm/i386/page.c, line 1212 (MmCreateVirtualMapping()) -
>> Page at address 0xf0043000 not usable - bugcheck. This happens because
>> the physical address is only checked against physical ram by
>> MmIsUsablePage() I guess.
>> In windows 2k on my machine when I look at the memory ranges of my GF2
>> GTS there is one which covers 0xf0000000-0xf7ffffff so I think
>> 0xf0043000 should be usable and MmIsUsablePage() is wrong.
>>
>> When looking at MmIsUsablePage() (ntoskrnl/mm/freelist.c, line 746) I
>> wonder why it doesn't check if the calculated Start is >=
>> MmPageArraySize - isnt that a bug for any physical address checked >=
>> MmPageArraySize * PAGE_SIZE?
>>
>> When I uncomment the call to MmIsUsablePage() and the following
>> bugcheck the NVIDIA driver does neither crash nor display any kind of
>> output.
>>
>> Thanks,
>> blight
I'm having the same problem with map view. I can map a region to view and
try to access it through read virtual, I get a exception fault and sometimes
a page fault. We need to map I/O memory as Kernel mode user can read only or
map it to user mode r/w once the PCI device is id with memory I/O.
We need to implement memory boundary checking with the virtual kernel
functions.
James
More information about the Ros-kernel
mailing list