Solved

How map IO Adress into Userspace in a NT driver

Posted on 1998-09-22
5
455 Views
Last Modified: 2012-06-27
For faster access of an IO address ( parallel port in my case) i need to map the address into the user address space,
thus avoiding NT-Security checks.
How can I do this in a NT4.0 driver, using the MS DDK ?
0
Comment
Question by:um3814
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1252961
Simple answer: You _cannot_ map an IO address into user space (even kernel mode drivers access IO ports trough HAL).
The only acceptable way would be to pass a user mode buffer to the driver in the MdlAddress of an DeviceIoControl IRP (similar to using an METHOD_OUT_DIRECT Device Object)
and using 'MmGetSystemAddressForMdl()' to access it directly when your driver handles the communication ... and don't forget to synchronize using a shared event ...
0
 

Author Comment

by:um3814
ID: 1252962
in the moment i use DeviceIoControl in order to send the data to the driver, then i use WRITE_PORT_UCHAR without any HAL . The DeviceIoControl call slows down the transfer rate 60 times.
I know, that memory addresses can be mapped into user address space. I think, its possible for a port adress too.

0
 
LVL 86

Expert Comment

by:jkr
ID: 1252963
Have fun carrying on ! I assure you can't map a port address into user space (would be against the design principles of NT).
0
 
LVL 4

Accepted Solution

by:
agreen earned 200 total points
ID: 1252964
As jkr said you CAN'T map the I/O space into user mode address space. But you can disable the I/O trapping for your user mode application. Just use the GIVEIO.SYS driver by Dale Roberts (http://www.ddj.com/ftp/1996/1996.05/directio.zip) or use the NTIOSUPP.DLL by Andy Green that allows you to load and start the GIVEIO.SYS driver by one simple function call. (http://www.warmcat.com/ntiosupp.zip)
0
 

Author Comment

by:um3814
ID: 1252965
Thanks a lot !  The directio  driver showed me the solution of my problem. But i wonder why there were 2 different methods used
in the Sources in the zip file : one with MS-Function calls, and one with assembler near c-code. Which is better ?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question