who dominates the I/O port is "direct" or "buffered"

My card :PCI(9052)has two I/O port , I make a driver for it with the Driver Studio.

I puzzled that during the Driver Studio’s wizard ,when choosing the hardware resource, these two I/O ports were selected “direct” type automaticly by the Driver Studio’s . why ? Is this determined by hardware ?

xxxxx@gmail.com wrote:

My card :PCI(9052)has two I/O port , I make a driver for it with the Driver Studio.

I puzzled that during the Driver Studio’s wizard ,when choosing the hardware resource, these two I/O ports were selected “direct” type automaticly by the Driver Studio’s . why ? Is this determined by hardware ?

You said yourself that the board has two I/O ports. There are two types
of resources in PCI: memory regions and I/O ports. The two are
completely separate, and it takes different CPU instructions to access
them. Your driver is told about this in its Start routine.

I don’t know what Driver Studio means by “direct”.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim Roberts wrote:

xxxxx@gmail.com wrote:

> My card :PCI(9052)has two I/O port , I make a driver for it with the Driver Studio.
>
> I puzzled that during the Driver Studio’s wizard ,when choosing the hardware resource, these two I/O ports were selected “direct” type automaticly by the Driver Studio’s . why ? Is this determined by hardware ?
>

You said yourself that the board has two I/O ports. There are two types
of resources in PCI: memory regions and I/O ports. The two are
completely separate, and it takes different CPU instructions to access
them. Your driver is told about this in its Start routine.

I don’t know what Driver Studio means by “direct”.

I suspect now that I misunderstood your question, or rather that you
asked about two unrelated things.

“Direct” and “buffered” refer to the way I/O requests are sent to your
driver. They have nothing to do with I/O ports. Perhaps if you asked
your question again, we could give a more sensible answer.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim ,and sorry for my opaque .

I know there are two ways for the APP and the drivers exchange data------the “directed” and the “buffered”. So when I am making the driver for my PCI card, as it has two I/O port , I wanted to try these two type on it------I want make one prot directed ,and another is buffered. But when it let you determine your hardware resource during the Driver Studio’s wizard , the type is unselectable------- the Driver Studio’s made them all “directed” .

I puzzled , Is this due to the hardware?How the hardware designed for this ?

I think you have two issues confused. The app and drivers communicate via
create, close, read, write and IoCtls. This has nothing to do with the
access to the hardware. Hardware uses IO ports that are accessed via IN &
OUT cpu instructions. This is the old way and not generally desirable. The
other method is memory mapped IO where the various MOV instructions get the
data to and from the device as if it was a piece of memory. What size MOV
instructions and what addresses are used are a part of the hardware design.
The WDK has specific macros that must be used for the various types as you
don’t really code the CPU instructions directly. These rules are to improve
portability and ensure coherency of data transfer.

You need to do two things. Take a course in how to write drivers. Then,
dump DriverStudio as it is obosolete and no longer supported. The code was
not all that good. Use KMDF or UMDF, if possible. What stack will your
device participate in? Provide some useful information so someone can
provide an answer. You have MSDN support incidents where someone can
provide assistance and if you don’t have a paid MSDN subscription you will
never succeed. Make sure you have at least two computers during the coding
phase and you will need Server 2003 running on another when running DTM.

wrote in message news:xxxxx@ntdev…
> Thanks Tim ,and sorry for my opaque .
>
> I know there are two ways for the APP and the drivers exchange
> data------the “directed” and the “buffered”. So when I am making the
> driver for my PCI card, as it has two I/O port , I wanted to try these
> two type on it------I want make one prot directed ,and another is
> buffered. But when it let you determine your hardware resource during the
> Driver Studio’s wizard , the type is unselectable------- the Driver
> Studio’s made them all “directed” .
>
> I puzzled , Is this due to the hardware?How the hardware designed for
> this ?
>
>

Thanks David .

I know the “create, close, read, write and IoCtls” , but how the “read, write and IoCtls” exchange data between the APP and Drivers if the they communication by “read, write and IoCtls” through a I/O port ? The MSDN told me the way have two type -------“directed” or “buffered”(maybe three , another is “Neither”).

So ,I want to konw------- the I/O port is ''directed" or “buffered” is determined by what? Who control this ? The hardware or the driver? Why the DriverStudio treat my I/O port only ''directed" .

You have two concepts confused. Why are you using the phrase “I/O port”?

You really need a course in writing drivers. How the things in the next
paragraph are specified depends upon the stack involved. There are rules
and guidelines that must be obeyed. Neither IO is almost never advisible
and definitely not workable for an amateur.

There are different ways to specify how buffers in apps are seen when
received by the driver. The driver has one of three - buffered, direct, or
neither specified for ALL reads and writes. Each IoCtl contains the
specification as to whether the buffers are buffered, direct, or neither.

Until you are ready to provide more information about the problem’s big
picture, I will not respond again. This is too much like a dog chasing its
tail - when you succeed you still have nothing more than you had before.

wrote in message news:xxxxx@ntdev…
> Thanks David .
>
> I know the “create, close, read, write and IoCtls” , but how the “read,
> write and IoCtls” exchange data between the APP and Drivers if the they
> communication by “read, write and IoCtls” through a I/O port ? The MSDN
> told me the way have two type -------“directed” or “buffered”(maybe three
> , another is “Neither”).
>
> So ,I want to konw------- the I/O port is ''directed" or “buffered” is
> determined by what? Who control this ? The hardware or the driver? Why
> the DriverStudio treat my I/O port only ''directed" .
>

xxxxx@gmail.com wrote:

Thanks David .

I know the “create, close, read, write and IoCtls” , but how the “read, write and IoCtls” exchange data between the APP and Drivers if the they communication by “read, write and IoCtls” through a I/O port ?

They DON’T communicate through I/O ports. An application uses
CreateFile, ReadFile, WriteFile, DeviceIoControl, and CloseHandle to
talk to a driver. When an application does that, the operating system
creates an IRP (I/O request packet). An IRP has nothing to do with an
I/O port.

The MSDN told me the way have two type -------“directed” or “buffered”(maybe three , another is “Neither”).

So ,I want to konw------- the I/O port is ''directed" or “buffered” is determined by what? Who control this ? The hardware or the driver? Why the DriverStudio treat my I/O port only ''directed" .

Open and close requests do not have any memory, so “direct” and
“buffered” do not apply.

For read and write requests, your driver sets Flags in the device object
that tells the system how you want the memory transferred. You use
either DO_DIRECT_IO or DO_BUFFERED_IO. For ioctl requests, the bottom
two bits of the ioctl number tell the system how the memory should be
transferred.

DriverStudio probably has a menu item somewhere that lets you choose
“direct” or “buffered” for read/write requests. For ioctls, it depends
on the ioctl code number.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.