Hi,
I’m writing some application which uses driver in order to map physical
memory( Application uses MMIO of some PCI device, driver maps the MMIO
region into virtual memory and passes it to application ).
I need to run this software on x64 Windows( driver is already ported to
x64). I’m getting some problem, which is possibley related to following:
-Driver maps physical memory to 64 bit pointer.
-Driver passes the pointer to application.
-Application is 32 bit so it cuts the pointer to 32 bits.
-Access to resulted pointer causes the exception.
How can I resolve the issue?
-Is it possible to instruct x64 driver to produce 32 bit virtual memory?
-Is it possible for 32 bit application to use 64 bit pointers if WOW64
process?
-any other solution?
Porting of whole software to 64 bit is currently unavailable.
Thanks,
Lev Zlotin
Expose the set of IOCTLs from the driver and move all hardware access
there, so that the app will call IOCTLs instead of touching the hardware
directly.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Zlotin, Lev”
To: “Windows System Software Devs Interest List”
Sent: Monday, July 03, 2006 6:05 PM
Subject: [ntdev] Memory mapping for 32 bit application under x64 Windows
Hi,
I’m writing some application which uses driver in order to map physical
memory( Application uses MMIO of some PCI device, driver maps the MMIO
region into virtual memory and passes it to application ).
I need to run this software on x64 Windows( driver is already ported to
x64). I’m getting some problem, which is possibley related to following:
-Driver maps physical memory to 64 bit pointer.
-Driver passes the pointer to application.
-Application is 32 bit so it cuts the pointer to 32 bits.
-Access to resulted pointer causes the exception.
How can I resolve the issue?
-Is it possible to instruct x64 driver to produce 32 bit virtual memory?
-Is it possible for 32 bit application to use 64 bit pointers if WOW64
process?
-any other solution?
Porting of whole software to 64 bit is currently unavailable.
Thanks,
Lev Zlotin
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
This will hardly affect the performance and application will become
unusable.
Lev Zlotin
xxxxx@Intel.com
iNet: 8-465-6740
tel: 972-4-865-6740
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Monday, July 03, 2006 10:28 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Memory mapping for 32 bit application under x64
Windows
Expose the set of IOCTLs from the driver and move all hardware
access
there, so that the app will call IOCTLs instead of touching the hardware
directly.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Zlotin, Lev”
To: “Windows System Software Devs Interest List”
Sent: Monday, July 03, 2006 6:05 PM
Subject: [ntdev] Memory mapping for 32 bit application under x64 Windows
Hi,
I’m writing some application which uses driver in order to map physical
memory( Application uses MMIO of some PCI device, driver maps the MMIO
region into virtual memory and passes it to application ).
I need to run this software on x64 Windows( driver is already ported to
x64). I’m getting some problem, which is possibley related to following:
-Driver maps physical memory to 64 bit pointer.
-Driver passes the pointer to application.
-Application is 32 bit so it cuts the pointer to 32 bits.
-Access to resulted pointer causes the exception.
How can I resolve the issue?
-Is it possible to instruct x64 driver to produce 32 bit virtual memory?
-Is it possible for 32 bit application to use 64 bit pointers if WOW64
process?
-any other solution?
Porting of whole software to 64 bit is currently unavailable.
Thanks,
Lev Zlotin
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Lev,
Have you tried MmMapLockedPagesSpecifyCache() with non-NULL values for
BaseAddress parameter?
I guess it could help you…
Best regards,
Valeriy Glushkov
----- ??? ??? -----
??: “Zlotin, Lev”
???: “Windows System Software Devs Interest List”
???: 4 ??? 2006 ?. 8:03
???: RE: [ntdev] Memory mapping for 32 bit application under x64 Windows
This will hardly affect the performance and application will become
unusable.
Lev Zlotin
xxxxx@Intel.com
iNet: 8-465-6740
tel: 972-4-865-6740
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Monday, July 03, 2006 10:28 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Memory mapping for 32 bit application under x64
Windows
Expose the set of IOCTLs from the driver and move all hardware
access
there, so that the app will call IOCTLs instead of touching the hardware
directly.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Zlotin, Lev”
To: “Windows System Software Devs Interest List”
Sent: Monday, July 03, 2006 6:05 PM
Subject: [ntdev] Memory mapping for 32 bit application under x64 Windows
Hi,
I’m writing some application which uses driver in order to map physical
memory( Application uses MMIO of some PCI device, driver maps the MMIO
region into virtual memory and passes it to application ).
I need to run this software on x64 Windows( driver is already ported to
x64). I’m getting some problem, which is possibley related to following:
-Driver maps physical memory to 64 bit pointer.
-Driver passes the pointer to application.
-Application is 32 bit so it cuts the pointer to 32 bits.
-Access to resulted pointer causes the exception.
How can I resolve the issue?
-Is it possible to instruct x64 driver to produce 32 bit virtual memory?
-Is it possible for 32 bit application to use 64 bit pointers if WOW64
process?
-any other solution?
Porting of whole software to 64 bit is currently unavailable.
Thanks,
Lev Zlotin
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Lev,
Reading of the following thriad from the NTDEV archive should answer your
questions:
http://www.osronline.com/showThread.cfm?link=69768
In 2 words:
- You must map the memory buffer only from your application’s process
context.
- MmMapLockedPagesSpecifyCache( pMdl, UserMode,…) should return a valid
usermode 32-bit pointer if the caller is a 32-bit process.
I hope this helps.
Best regards,
Valeriy Glushkov
----- ??? ??? -----
??: “Zlotin, Lev”
???: “Windows System Software Devs Interest List”
???: 3 ??? 2006 ?. 17:05
???: [ntdev] Memory mapping for 32 bit application under x64 Windows
Hi,
I’m writing some application which uses driver in order to map physical
memory( Application uses MMIO of some PCI device, driver maps the MMIO
region into virtual memory and passes it to application ).
I need to run this software on x64 Windows( driver is already ported to
x64). I’m getting some problem, which is possibley related to following:
-Driver maps physical memory to 64 bit pointer.
-Driver passes the pointer to application.
-Application is 32 bit so it cuts the pointer to 32 bits.
-Access to resulted pointer causes the exception.
How can I resolve the issue?
-Is it possible to instruct x64 driver to produce 32 bit virtual memory?
-Is it possible for 32 bit application to use 64 bit pointers if WOW64
process?
-any other solution?
Porting of whole software to 64 bit is currently unavailable.
Thanks,
Lev Zlotin
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Thanks
Lev Zlotin
xxxxx@Intel.com
iNet: 8-465-6740
tel: 972-4-865-6740
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Valeriy Glushkov
Sent: Tuesday, July 04, 2006 4:55 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Memory mapping for 32 bit application under x64
Windows
Lev,
Reading of the following thriad from the NTDEV archive should answer
your
questions:
http://www.osronline.com/showThread.cfm?link=69768
In 2 words:
- You must map the memory buffer only from your application’s process
context.
- MmMapLockedPagesSpecifyCache( pMdl, UserMode,…) should return a
valid
usermode 32-bit pointer if the caller is a 32-bit process.
I hope this helps.
Best regards,
Valeriy Glushkov
----- ??? ??? -----
??: “Zlotin, Lev”
???: “Windows System Software Devs Interest List”
???: 3 ??? 2006 ?. 17:05
???: [ntdev] Memory mapping for 32 bit application under x64 Windows
Hi,
I’m writing some application which uses driver in order to map physical
memory( Application uses MMIO of some PCI device, driver maps the MMIO
region into virtual memory and passes it to application ).
I need to run this software on x64 Windows( driver is already ported to
x64). I’m getting some problem, which is possibley related to following:
-Driver maps physical memory to 64 bit pointer.
-Driver passes the pointer to application.
-Application is 32 bit so it cuts the pointer to 32 bits.
-Access to resulted pointer causes the exception.
How can I resolve the issue?
-Is it possible to instruct x64 driver to produce 32 bit virtual memory?
-Is it possible for 32 bit application to use 64 bit pointers if WOW64
process?
-any other solution?
Porting of whole software to 64 bit is currently unavailable.
Thanks,
Lev Zlotin
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Zlotin, Lev wrote:
This will hardly affect the performance and application will become
unusable.
The first part of your sentence is probably correct, although I don’t
really think you said what you meant. “This will hardly affect the
performance” means “This will have a very minor impact on performance”.
Unless you are making tens of thousands of references over a period of a
few seconds, using ioctls to write your registers will not affect your
performance noticeably. If you ARE making tens of thousands of
references, then it’s likely that you are writing big blocks of
registers, and you can improve the performance by creating a “write
block” ioctl.
There is a strong tendency to believe that the ioctl solution MUST be
horribly slow. That belief is almost always wrong.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.