Please help me on device configuration

Hi all,

Please help me on this problem: I created a win2k filter driver attached to the upper part of disk.sys. During reception of IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS then send it to the lower stack. My problem is, during successful return, when I try to get the resource descriptor address I always get NULL. I do not know why NULL is always returned. I checked the address of IRP’s parameter field before and after the sending to the next stack, and both are NULL. BTW, I am trying to get the Interrupt and Port resources from the PNP manager.

We need to filter some ATA commands sent to a disk and then send it directly to the storage device using the resources sent by PNP manager without passing the lower layer of the stack.

Thanks in advance
Khryss


Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now

You are filtering too high in the device tree. The disk itself itself doesn’t own any of the resources, the controller which enumerated the disk is the one you want to filter. Now, let’s say you are filtering the correct controller and you see the resource lists. This doesn’t mean you are allowed to access the hardware resources in your filter driver. How are you going to coordinate your access to the registers/interrupt with the controller who is also using them? For instance, there is no way for you to get the PKINTERRUPT so that you can synchronize against the ISR (which you don’t own either).

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
Sent: Monday, January 24, 2005 7:43 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Please help me on device configuration

Hi all,
?
Please help me on this problem: I created a win2k filter driver attached to the upper part of disk.sys. During reception of IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS then send it to the lower stack. My problem is,?during successful return,?when?I?try to get the resource descriptor address?I always get NULL. I do not know why NULL is always returned. I checked the address of IRP’s parameter field before and after the sending to the next stack, and both are NULL. BTW, I am trying to get the Interrupt and Port resources from the PNP manager.
?
We need to filter some ATA commands sent to a disk and then send it directly?to the storage device using the resources sent by PNP manager without passing the lower layer of the stack.
?
Thanks in advance
Khryss


Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank email to xxxxx@lists.osr.com

you won’t be able to do this.

The port driver owns the controller and (rightly) expects to have
exclusive access to it. You can’t synchronize with the port driver’s
register access (and i don’t want to start a big discussion about how a
good OS would let you do this, or about odd hacks to get around it) you
cannot access the ATA registers yourself.

If you explain what you’re trying to accomplish by doing this someone
here may be able to suggest an alternative.

-p


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Christopher
Flordeliza
Sent: Monday, January 24, 2005 7:43 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Please help me on device configuration

Hi all,

Please help me on this problem: I created a win2k filter driver
attached to the upper part of disk.sys. During reception of
IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS then
send it to the lower stack. My problem is, during successful return,
when I try to get the resource descriptor address I always get NULL. I
do not know why NULL is always returned. I checked the address of IRP’s
parameter field before and after the sending to the next stack, and both
are NULL. BTW, I am trying to get the Interrupt and Port resources from
the PNP manager.

We need to filter some ATA commands sent to a disk and then send
it directly to the storage device using the resources sent by PNP
manager without passing the lower layer of the stack.

Thanks in advance
Khryss


Yahoo! Messenger
http:o.com> - Communicate instantly…“Ping” your friends today! Download
Messenger Now
http:o.com/download/index.html> — Questions? First check the Kernel Driver
FAQ at http://www.osronline.com/article.cfm?id=256 You are currently
subscribed to ntdev as: xxxxx@windows.microsoft.com To unsubscribe
send a blank email to xxxxx@lists.osr.com</http:></http:>

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a storage device for testing. Our application used DeviceIoControl(Passthrough IOCTL) in sending these commands but some functions does not work specially write commands. Because of this we decided to create a filter driver that will make sure that these commands will be sent to the device. What we did is we connected this filter driver to edisk.sys. And then if everything went correct during initialization the commands will be sent using WRITE_PORT… But unfortunately it does not… So now we are trying to solve this problem… This is the first time we coded a device driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
you won’t be able to do this.

The port driver owns the controller and (rightly) expects to have exclusive access to it. You can’t synchronize with the port driver’s register access (and i don’t want to start a big discussion about how a good OS would let you do this, or about odd hacks to get around it) you cannot access the ATA registers yourself.

If you explain what you’re trying to accomplish by doing this someone here may be able to suggest an alternative.

-p

---------------------------------
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
Sent: Monday, January 24, 2005 7:43 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Please help me on device configuration

Hi all,

Please help me on this problem: I created a win2k filter driver attached to the upper part of disk.sys. During reception of IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS then send it to the lower stack. My problem is, during successful return, when I try to get the resource descriptor address I always get NULL. I do not know why NULL is always returned. I checked the address of IRP’s parameter field before and after the sending to the next stack, and both are NULL. BTW, I am trying to get the Interrupt and Port resources from the PNP manager.

We need to filter some ATA commands sent to a disk and then send it directly to the storage device using the resources sent by PNP manager without passing the lower layer of the stack.

Thanks in advance
Khryss

---------------------------------
Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank email to xxxxx@lists.osr.com—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now

If this is for testing your own devices, rather than selling to customers
for testing the customers hard driver, I think the following solution is
suitable.

It sounds like what you need here is a specific test-driver, that is
replacing the driver for that particula IDE interface.

This will of course only work if you have more than one IDE controller
(more than two IDE ports) in the same machine.

So, you need to write a driver that supports your own IOCTL calls. It’s not
necessarily needed to support the standard operations of a hard disk, as
you’re not intending to use this hard disk for proper file systems, I
presume.

You can program IOCTL calls to do whatever you like to do, so there’s no
reason why you should have any limitation on what function you want
performed. Of course, it will give a much easier future updating service if
all you have in the driver is pretty simple functionality, and all the
compex stuff (like reading back and comparing a written buffer) is done in
the user-mode application.

I’m not sure how you install such a driver (i.e. how you convince Windows
that your driver should replace the current IDE driver with your driver),
but I’m pretty sure there is someone on this list that can give advice on
this.

If you’re planning on doing a product for the purpose of “customers testing
their hard-disk”, then I have no direct suggestions.


Mats

xxxxx@lists.osr.com wrote on 01/26/2005 08:40:46 AM:

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a
storage device for testing. Our application used
DeviceIoControl(Passthrough IOCTL) in sending these commands but
some functions does not work specially write commands. Because of
this we decided to create a filter driver that will make sure that
these commands will be sent to the device. What we did is we
connected this filter driver to edisk.sys. And then if everything
went correct during initialization the commands will be sent using
WRITE_PORT… But unfortunately it does not… So now we are trying
to solve this problem… This is the first time we coded a device
driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@3dlabs.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT0000B9EA

Yet another developer who needs a working ATA_PASS_THROUGH.

Khryss,

Call Microsoft with your real name and company, open a support ticket, and
ask them to fix the ATA_PASS_THROUGH in Windows XP SP2, and back-port it
to whatever other OS you require. Make sure you are armed with the cost
(to you and to your customers) of leaving it in its current broken state.
Make sure that your customers agree with your assessment of how much the
current state of things costs them, and are willing to tell Microsoft the
same thing.

If you go to all that trouble, maybe Microsoft will fix the broken
interface known as ATA_PASS_THROUGH.

Phil

Philip D. Barila
Seagate Technology LLC
(720) 684-1842

xxxxx@lists.osr.com wrote on 01/26/2005 01:40:46 AM:

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a
storage device for testing. Our application used
DeviceIoControl(Passthrough IOCTL) in sending these commands but
some functions does not work specially write commands. Because of
this we decided to create a filter driver that will make sure that
these commands will be sent to the device. What we did is we
connected this filter driver to edisk.sys. And then if everything
went correct during initialization the commands will be sent using
WRITE_PORT… But unfortunately it does not… So now we are trying
to solve this problem… This is the first time we coded a device
driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@seagate.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com

Guys, thanks for all the replies :slight_smile:

xxxxx@seagate.com wrote:

Yet another developer who needs a working ATA_PASS_THROUGH.

Khryss,

Call Microsoft with your real name and company, open a support ticket, and ask them to fix the ATA_PASS_THROUGH in Windows XP SP2, and back-port it to whatever other OS you require. Make sure you are armed with the cost (to you and to your customers) of leaving it in its current broken state. Make sure that your customers agree with your assessment of how much the current state of things costs them, and are willing to tell Microsoft the same thing.

If you go to all that trouble, maybe Microsoft will fix the broken interface known as ATA_PASS_THROUGH.

Phil

Philip D. Barila
Seagate Technology LLC
(720) 684-1842

xxxxx@lists.osr.com wrote on 01/26/2005 01:40:46 AM:

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a
storage device for testing. Our application used
DeviceIoControl(Passthrough IOCTL) in sending these commands but
some functions does not work specially write commands. Because of
this we decided to create a filter driver that will make sure that
these commands will be sent to the device. What we did is we
connected this filter driver to edisk.sys. And then if everything
went correct during initialization the commands will be sent using
WRITE_PORT… But unfortunately it does not… So now we are trying
to solve this problem… This is the first time we coded a device
driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@seagate.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@yahoo.com To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now

So I agree with Phil’s response of requesting MS to fix their ATA pass
through ioctl, but if you are really interested in your own driver I
would suggest developing a SCSI Miniport as this is a documented
interface for the production NT-based OS’s. First off, note that this
is not trivial, and will suck all avaialble time for many man-months.
But here is my take, given I’ve done this I hope my experience is
typical of others that have done this.

The install is the least of your problems. You can take an INF for
various port-level drivers and replicate most of what they have. Using
the device manager, you can do a “Have Disk” update of the ATA
controller. Make sure you have a “ExcludeFromSelect” in the
[ControlFlags] block for your device so it won’t try to override your
driver with the native OS driver. The device identification string must
minimally include the vendor id, device id and class code identifiers.
StartType must be “SERVICE_BOOT_START” and LoadOrderGroup must be “SCSI
Miniport”. The DDK inf descriptions are adequate, but you will need to
spend plenty of time to familiarize yourself with it.

The driver you develop gets linked to scsi port library, which there is
a library for this in the ddk to link to. I started with the NT4 DDK
sample, but you have to add all the DMA engine code and any special
support for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver, but by the sound of your task you
probably don’t need any of this. Developing this sort of driver takes
time if you don’t have something to start with, and I mean “way more”
than a week or two! Your mileage may vary depending on s/w experience.

The only device out there with any available documentation on how the
hardware works is the Intel Parallel and Serial ATA engines, and you can
find the ICH Programmers Reference Manual for each at the following
URL’s: http://www.intel.com/design/chipsets/manuals/298600.htm
http://www.intel.com/technology/serialata/ahci.htm.

So, yes, you can write your own driver to take ownership of the ATA
ports, if you have the internal fortitude to attack the problem. Maybe
Peter Wieland will pipe-up on this topic.

No matter what avenue you choose, good luck to you.
MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Wednesday, January 26, 2005 6:54 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

If this is for testing your own devices, rather than selling to
customers
for testing the customers hard driver, I think the following solution is
suitable.

It sounds like what you need here is a specific test-driver, that is
replacing the driver for that particula IDE interface.

This will of course only work if you have more than one IDE controller
(more than two IDE ports) in the same machine.

So, you need to write a driver that supports your own IOCTL calls. It’s
not
necessarily needed to support the standard operations of a hard disk, as
you’re not intending to use this hard disk for proper file systems, I
presume.

You can program IOCTL calls to do whatever you like to do, so there’s no
reason why you should have any limitation on what function you want
performed. Of course, it will give a much easier future updating service
if
all you have in the driver is pretty simple functionality, and all the
compex stuff (like reading back and comparing a written buffer) is done
in
the user-mode application.

I’m not sure how you install such a driver (i.e. how you convince
Windows
that your driver should replace the current IDE driver with your
driver),
but I’m pretty sure there is someone on this list that can give advice
on
this.

If you’re planning on doing a product for the purpose of “customers
testing
their hard-disk”, then I have no direct suggestions.


Mats

xxxxx@lists.osr.com wrote on 01/26/2005 08:40:46 AM:

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a
storage device for testing. Our application used
DeviceIoControl(Passthrough IOCTL) in sending these commands but
some functions does not work specially write commands. Because of
this we decided to create a filter driver that will make sure that
these commands will be sent to the device. What we did is we
connected this filter driver to edisk.sys. And then if everything
went correct during initialization the commands will be sent using
WRITE_PORT… But unfortunately it does not… So now we are trying
to solve this problem… This is the first time we coded a device
driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@3dlabs.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT0000B9EA


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Of course you can write your own driver to take ownership of the ata
ports, but then once you do that, you must implement the entire ataport
driver and its functionality b/c you own these resources outright. What
you propose is a model to implement an entire controller driver in a
limited environment. This is a bit like killing a fly with boulder.
Possible, but not entirely worth your time for such a limited goal.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Eschmann, Michael
K
Sent: Wednesday, January 26, 2005 3:46 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

So I agree with Phil’s response of requesting MS to fix their ATA pass
through ioctl, but if you are really interested in your own driver I
would suggest developing a SCSI Miniport as this is a documented
interface for the production NT-based OS’s. First off, note that this
is not trivial, and will suck all avaialble time for many man-months.
But here is my take, given I’ve done this I hope my experience is
typical of others that have done this.

The install is the least of your problems. You can take an INF for
various port-level drivers and replicate most of what they have. Using
the device manager, you can do a “Have Disk” update of the ATA
controller. Make sure you have a “ExcludeFromSelect” in the
[ControlFlags] block for your device so it won’t try to override your
driver with the native OS driver. The device identification string must
minimally include the vendor id, device id and class code identifiers.
StartType must be “SERVICE_BOOT_START” and LoadOrderGroup must be “SCSI
Miniport”. The DDK inf descriptions are adequate, but you will need to
spend plenty of time to familiarize yourself with it.

The driver you develop gets linked to scsi port library, which there is
a library for this in the ddk to link to. I started with the NT4 DDK
sample, but you have to add all the DMA engine code and any special
support for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver, but by the sound of your task you
probably don’t need any of this. Developing this sort of driver takes
time if you don’t have something to start with, and I mean “way more”
than a week or two! Your mileage may vary depending on s/w experience.

The only device out there with any available documentation on how the
hardware works is the Intel Parallel and Serial ATA engines, and you can
find the ICH Programmers Reference Manual for each at the following
URL’s: http://www.intel.com/design/chipsets/manuals/298600.htm
http://www.intel.com/technology/serialata/ahci.htm.

So, yes, you can write your own driver to take ownership of the ATA
ports, if you have the internal fortitude to attack the problem. Maybe
Peter Wieland will pipe-up on this topic.

No matter what avenue you choose, good luck to you.
MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Wednesday, January 26, 2005 6:54 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

If this is for testing your own devices, rather than selling to
customers
for testing the customers hard driver, I think the following solution is
suitable.

It sounds like what you need here is a specific test-driver, that is
replacing the driver for that particula IDE interface.

This will of course only work if you have more than one IDE controller
(more than two IDE ports) in the same machine.

So, you need to write a driver that supports your own IOCTL calls. It’s
not
necessarily needed to support the standard operations of a hard disk, as
you’re not intending to use this hard disk for proper file systems, I
presume.

You can program IOCTL calls to do whatever you like to do, so there’s no
reason why you should have any limitation on what function you want
performed. Of course, it will give a much easier future updating service
if
all you have in the driver is pretty simple functionality, and all the
compex stuff (like reading back and comparing a written buffer) is done
in
the user-mode application.

I’m not sure how you install such a driver (i.e. how you convince
Windows
that your driver should replace the current IDE driver with your
driver),
but I’m pretty sure there is someone on this list that can give advice
on
this.

If you’re planning on doing a product for the purpose of “customers
testing
their hard-disk”, then I have no direct suggestions.


Mats

xxxxx@lists.osr.com wrote on 01/26/2005 08:40:46 AM:

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a
storage device for testing. Our application used
DeviceIoControl(Passthrough IOCTL) in sending these commands but
some functions does not work specially write commands. Because of
this we decided to create a filter driver that will make sure that
these commands will be sent to the device. What we did is we
connected this filter driver to edisk.sys. And then if everything
went correct during initialization the commands will be sent using
WRITE_PORT… But unfortunately it does not… So now we are trying
to solve this problem… This is the first time we coded a device
driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@3dlabs.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT0000B9EA


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

You are absolutely right. I was answering MATS question regarding what
it would take to do it.
MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, January 26, 2005 3:52 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

Of course you can write your own driver to take ownership of the ata
ports, but then once you do that, you must implement the entire ataport
driver and its functionality b/c you own these resources outright. What
you propose is a model to implement an entire controller driver in a
limited environment. This is a bit like killing a fly with boulder.
Possible, but not entirely worth your time for such a limited goal.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Eschmann, Michael
K
Sent: Wednesday, January 26, 2005 3:46 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

So I agree with Phil’s response of requesting MS to fix their ATA pass
through ioctl, but if you are really interested in your own driver I
would suggest developing a SCSI Miniport as this is a documented
interface for the production NT-based OS’s. First off, note that this
is not trivial, and will suck all avaialble time for many man-months.
But here is my take, given I’ve done this I hope my experience is
typical of others that have done this.

The install is the least of your problems. You can take an INF for
various port-level drivers and replicate most of what they have. Using
the device manager, you can do a “Have Disk” update of the ATA
controller. Make sure you have a “ExcludeFromSelect” in the
[ControlFlags] block for your device so it won’t try to override your
driver with the native OS driver. The device identification string must
minimally include the vendor id, device id and class code identifiers.
StartType must be “SERVICE_BOOT_START” and LoadOrderGroup must be “SCSI
Miniport”. The DDK inf descriptions are adequate, but you will need to
spend plenty of time to familiarize yourself with it.

The driver you develop gets linked to scsi port library, which there is
a library for this in the ddk to link to. I started with the NT4 DDK
sample, but you have to add all the DMA engine code and any special
support for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver, but by the sound of your task you
probably don’t need any of this. Developing this sort of driver takes
time if you don’t have something to start with, and I mean “way more”
than a week or two! Your mileage may vary depending on s/w experience.

The only device out there with any available documentation on how the
hardware works is the Intel Parallel and Serial ATA engines, and you can
find the ICH Programmers Reference Manual for each at the following
URL’s: http://www.intel.com/design/chipsets/manuals/298600.htm
http://www.intel.com/technology/serialata/ahci.htm.

So, yes, you can write your own driver to take ownership of the ATA
ports, if you have the internal fortitude to attack the problem. Maybe
Peter Wieland will pipe-up on this topic.

No matter what avenue you choose, good luck to you.
MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Wednesday, January 26, 2005 6:54 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

If this is for testing your own devices, rather than selling to
customers
for testing the customers hard driver, I think the following solution is
suitable.

It sounds like what you need here is a specific test-driver, that is
replacing the driver for that particula IDE interface.

This will of course only work if you have more than one IDE controller
(more than two IDE ports) in the same machine.

So, you need to write a driver that supports your own IOCTL calls. It’s
not
necessarily needed to support the standard operations of a hard disk, as
you’re not intending to use this hard disk for proper file systems, I
presume.

You can program IOCTL calls to do whatever you like to do, so there’s no
reason why you should have any limitation on what function you want
performed. Of course, it will give a much easier future updating service
if
all you have in the driver is pretty simple functionality, and all the
compex stuff (like reading back and comparing a written buffer) is done
in
the user-mode application.

I’m not sure how you install such a driver (i.e. how you convince
Windows
that your driver should replace the current IDE driver with your
driver),
but I’m pretty sure there is someone on this list that can give advice
on
this.

If you’re planning on doing a product for the purpose of “customers
testing
their hard-disk”, then I have no direct suggestions.


Mats

xxxxx@lists.osr.com wrote on 01/26/2005 08:40:46 AM:

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a
storage device for testing. Our application used
DeviceIoControl(Passthrough IOCTL) in sending these commands but
some functions does not work specially write commands. Because of
this we decided to create a filter driver that will make sure that
these commands will be sent to the device. What we did is we
connected this filter driver to edisk.sys. And then if everything
went correct during initialization the commands will be sent using
WRITE_PORT… But unfortunately it does not… So now we are trying
to solve this problem… This is the first time we coded a device
driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@3dlabs.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT0000B9EA


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Yes but …

Phil and I have been pointing out the problems with the current ATA support
in Windows for over a year now. We have even functioned as guinea pigs for
fixes that have come out of PSG (???) as they were released to a limited
beta, and we did indeed see fixes made as we reported them. However,
ATAPI.SYS is still sick for many of the operations possible when one
considers the wealth of things possible in the ATA command set, and pass
through in win2k does not work at all. So the industry sits here and
patiently waits for SP5 of Win2K which has been promised “Real Soon Now” for
a year.

Using boulders to swat fly’s may not be worth our time, but Microsoft really
does not give us many alternatives.

Case in point … there are command set extensions being proposed to T-10
and T-13 even as I write this. Were those committees to approve them TODAY,
how long will it take for those new commands to be implemented by both the
ATA and SCSI boys and girls at Microsoft? Actually, the real question is how
long will it take Microsoft’s pointy hired folks to get off their duffs and
make the decisions that will direct the engineer boys and girls to make the
changes so that we do not have to use pass through which is still broken in
ATA and has limitations in SCSI. Personally, I predict that the first
release of Longhorn will not see those changes … and we NEED them TODAY!!!

Sometimes fly swatting with nuclear weapons is more preferable than waiting
on corporate bureaucracy.


The personal opinion of
Gary G. Little

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Of course you can write your own driver to take ownership of the ata
ports, but then once you do that, you must implement the entire ataport
driver and its functionality b/c you own these resources outright. What
you propose is a model to implement an entire controller driver in a
limited environment. This is a bit like killing a fly with boulder.
Possible, but not entirely worth your time for such a limited goal.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Eschmann, Michael
K
Sent: Wednesday, January 26, 2005 3:46 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

So I agree with Phil’s response of requesting MS to fix their ATA pass
through ioctl, but if you are really interested in your own driver I
would suggest developing a SCSI Miniport as this is a documented
interface for the production NT-based OS’s. First off, note that this
is not trivial, and will suck all avaialble time for many man-months.
But here is my take, given I’ve done this I hope my experience is
typical of others that have done this.

The install is the least of your problems. You can take an INF for
various port-level drivers and replicate most of what they have. Using
the device manager, you can do a “Have Disk” update of the ATA
controller. Make sure you have a “ExcludeFromSelect” in the
[ControlFlags] block for your device so it won’t try to override your
driver with the native OS driver. The device identification string must
minimally include the vendor id, device id and class code identifiers.
StartType must be “SERVICE_BOOT_START” and LoadOrderGroup must be “SCSI
Miniport”. The DDK inf descriptions are adequate, but you will need to
spend plenty of time to familiarize yourself with it.

The driver you develop gets linked to scsi port library, which there is
a library for this in the ddk to link to. I started with the NT4 DDK
sample, but you have to add all the DMA engine code and any special
support for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver, but by the sound of your task you
probably don’t need any of this. Developing this sort of driver takes
time if you don’t have something to start with, and I mean “way more”
than a week or two! Your mileage may vary depending on s/w experience.

The only device out there with any available documentation on how the
hardware works is the Intel Parallel and Serial ATA engines, and you can
find the ICH Programmers Reference Manual for each at the following
URL’s: http://www.intel.com/design/chipsets/manuals/298600.htm
http://www.intel.com/technology/serialata/ahci.htm.

So, yes, you can write your own driver to take ownership of the ATA
ports, if you have the internal fortitude to attack the problem. Maybe
Peter Wieland will pipe-up on this topic.

No matter what avenue you choose, good luck to you.
MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Wednesday, January 26, 2005 6:54 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

If this is for testing your own devices, rather than selling to
customers
for testing the customers hard driver, I think the following solution is
suitable.

It sounds like what you need here is a specific test-driver, that is
replacing the driver for that particula IDE interface.

This will of course only work if you have more than one IDE controller
(more than two IDE ports) in the same machine.

So, you need to write a driver that supports your own IOCTL calls. It’s
not
necessarily needed to support the standard operations of a hard disk, as
you’re not intending to use this hard disk for proper file systems, I
presume.

You can program IOCTL calls to do whatever you like to do, so there’s no
reason why you should have any limitation on what function you want
performed. Of course, it will give a much easier future updating service
if
all you have in the driver is pretty simple functionality, and all the
compex stuff (like reading back and comparing a written buffer) is done
in
the user-mode application.

I’m not sure how you install such a driver (i.e. how you convince
Windows
that your driver should replace the current IDE driver with your
driver),
but I’m pretty sure there is someone on this list that can give advice
on
this.

If you’re planning on doing a product for the purpose of “customers
testing
their hard-disk”, then I have no direct suggestions.


Mats

xxxxx@lists.osr.com wrote on 01/26/2005 08:40:46 AM:

> Hi,
>
> Thanks for your answer.
>
> Here is the complete history of our problem:
>
> We are trying to send vendor specific and standard ATA commands to a
> storage device for testing. Our application used
> DeviceIoControl(Passthrough IOCTL) in sending these commands but
> some functions does not work specially write commands. Because of
> this we decided to create a filter driver that will make sure that
> these commands will be sent to the device. What we did is we
> connected this filter driver to edisk.sys. And then if everything
> went correct during initialization the commands will be sent using
> WRITE_PORT… But unfortunately it does not… So now we are trying
> to solve this problem… This is the first time we coded a device
> driver… and it is completely different from user mode programming…
>
> Thanks again,
> Khryss
>
>
> Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@3dlabs.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT0000B9EA


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

The fact that the OS is behind current spec by months or years is not
particular to ATA or SCSI, it is a general engineering problem mixed
with OS release schedules. I understand your pain, but it is a slippery
slope to go down, that’s all :slight_smile:

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Thursday, January 27, 2005 9:15 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Please help me on device configuration

Yes but …

Phil and I have been pointing out the problems with the current ATA
support
in Windows for over a year now. We have even functioned as guinea pigs
for
fixes that have come out of PSG (???) as they were released to a
limited
beta, and we did indeed see fixes made as we reported them. However,
ATAPI.SYS is still sick for many of the operations possible when one
considers the wealth of things possible in the ATA command set, and pass
through in win2k does not work at all. So the industry sits here and
patiently waits for SP5 of Win2K which has been promised “Real Soon Now”
for
a year.

Using boulders to swat fly’s may not be worth our time, but Microsoft
really
does not give us many alternatives.

Case in point … there are command set extensions being proposed to
T-10
and T-13 even as I write this. Were those committees to approve them
TODAY,
how long will it take for those new commands to be implemented by both
the
ATA and SCSI boys and girls at Microsoft? Actually, the real question is
how
long will it take Microsoft’s pointy hired folks to get off their duffs
and
make the decisions that will direct the engineer boys and girls to make
the
changes so that we do not have to use pass through which is still broken
in
ATA and has limitations in SCSI. Personally, I predict that the first
release of Longhorn will not see those changes … and we NEED them
TODAY!!!

Sometimes fly swatting with nuclear weapons is more preferable than
waiting
on corporate bureaucracy.


The personal opinion of
Gary G. Little

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Of course you can write your own driver to take ownership of the ata
ports, but then once you do that, you must implement the entire ataport
driver and its functionality b/c you own these resources outright. What
you propose is a model to implement an entire controller driver in a
limited environment. This is a bit like killing a fly with boulder.
Possible, but not entirely worth your time for such a limited goal.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Eschmann, Michael
K
Sent: Wednesday, January 26, 2005 3:46 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

So I agree with Phil’s response of requesting MS to fix their ATA pass
through ioctl, but if you are really interested in your own driver I
would suggest developing a SCSI Miniport as this is a documented
interface for the production NT-based OS’s. First off, note that this
is not trivial, and will suck all avaialble time for many man-months.
But here is my take, given I’ve done this I hope my experience is
typical of others that have done this.

The install is the least of your problems. You can take an INF for
various port-level drivers and replicate most of what they have. Using
the device manager, you can do a “Have Disk” update of the ATA
controller. Make sure you have a “ExcludeFromSelect” in the
[ControlFlags] block for your device so it won’t try to override your
driver with the native OS driver. The device identification string must
minimally include the vendor id, device id and class code identifiers.
StartType must be “SERVICE_BOOT_START” and LoadOrderGroup must be “SCSI
Miniport”. The DDK inf descriptions are adequate, but you will need to
spend plenty of time to familiarize yourself with it.

The driver you develop gets linked to scsi port library, which there is
a library for this in the ddk to link to. I started with the NT4 DDK
sample, but you have to add all the DMA engine code and any special
support for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver, but by the sound of your task you
probably don’t need any of this. Developing this sort of driver takes
time if you don’t have something to start with, and I mean “way more”
than a week or two! Your mileage may vary depending on s/w experience.

The only device out there with any available documentation on how the
hardware works is the Intel Parallel and Serial ATA engines, and you can
find the ICH Programmers Reference Manual for each at the following
URL’s: http://www.intel.com/design/chipsets/manuals/298600.htm
http://www.intel.com/technology/serialata/ahci.htm.

So, yes, you can write your own driver to take ownership of the ATA
ports, if you have the internal fortitude to attack the problem. Maybe
Peter Wieland will pipe-up on this topic.

No matter what avenue you choose, good luck to you.
MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Wednesday, January 26, 2005 6:54 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Please help me on device configuration

If this is for testing your own devices, rather than selling to
customers
for testing the customers hard driver, I think the following solution is
suitable.

It sounds like what you need here is a specific test-driver, that is
replacing the driver for that particula IDE interface.

This will of course only work if you have more than one IDE controller
(more than two IDE ports) in the same machine.

So, you need to write a driver that supports your own IOCTL calls. It’s
not
necessarily needed to support the standard operations of a hard disk, as
you’re not intending to use this hard disk for proper file systems, I
presume.

You can program IOCTL calls to do whatever you like to do, so there’s no
reason why you should have any limitation on what function you want
performed. Of course, it will give a much easier future updating service
if
all you have in the driver is pretty simple functionality, and all the
compex stuff (like reading back and comparing a written buffer) is done
in
the user-mode application.

I’m not sure how you install such a driver (i.e. how you convince
Windows
that your driver should replace the current IDE driver with your
driver),
but I’m pretty sure there is someone on this list that can give advice
on
this.

If you’re planning on doing a product for the purpose of “customers
testing
their hard-disk”, then I have no direct suggestions.


Mats

xxxxx@lists.osr.com wrote on 01/26/2005 08:40:46 AM:

> Hi,
>
> Thanks for your answer.
>
> Here is the complete history of our problem:
>
> We are trying to send vendor specific and standard ATA commands to a
> storage device for testing. Our application used
> DeviceIoControl(Passthrough IOCTL) in sending these commands but
> some functions does not work specially write commands. Because of
> this we decided to create a filter driver that will make sure that
> these commands will be sent to the device. What we did is we
> connected this filter driver to edisk.sys. And then if everything
> went correct during initialization the commands will be sent using
> WRITE_PORT… But unfortunately it does not… So now we are trying
> to solve this problem… This is the first time we coded a device
> driver… and it is completely different from user mode programming…
>
> Thanks again,
> Khryss
>
>
> Peter Wieland wrote:
> you won’t be able to do this.
>
> The port driver owns the controller and (rightly) expects to have
> exclusive access to it. You can’t synchronize with the port
> driver’s register access (and i don’t want to start a big discussion
> about how a good OS would let you do this, or about odd hacks to get
> around it) you cannot access the ATA registers yourself.
>
> If you explain what you’re trying to accomplish by doing this
> someone here may be able to suggest an alternative.
>
> -p
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
> Sent: Monday, January 24, 2005 7:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Please help me on device configuration

> Hi all,
>
> Please help me on this problem: I created a win2k filter driver
> attached to the upper part of disk.sys. During reception of
> IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS
> then send it to the lower stack. My problem is, during successful
> return, when I try to get the resource descriptor address I always
> get NULL. I do not know why NULL is always returned. I checked the
> address of IRP’s parameter field before and after the sending to the
> next stack, and both are NULL. BTW, I am trying to get the Interrupt
> and Port resources from the PNP manager.
>
> We need to filter some ATA commands sent to a disk and then send it
> directly to the storage device using the resources sent by PNP
> manager without passing the lower layer of the stack.
>
> Thanks in advance
> Khryss
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@windows.microsoft.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> Yahoo! Messenger - Communicate instantly…“Ping” your friends today!
> Download Messenger Now — Questions? First check the Kernel Driver
FAQ
at
> http://www.osronline.com/article.cfm?id=256 You are currently
> subscribed to ntdev as: xxxxx@3dlabs.com To unsubscribe
> send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT0000B9EA


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

This is because Window’s support in sending the vendor-defined ATA commands to a drive is nearly absent and full of bugs. Looks like MS considers that the drives will spin OK even without such commands to them :slight_smile:

Other parts of Windows are seriously made and thus good.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Christopher Flordeliza
To: Windows System Software Devs Interest List
Sent: Wednesday, January 26, 2005 11:40 AM
Subject: RE: [ntdev] Please help me on device configuration

Hi,

Thanks for your answer.

Here is the complete history of our problem:

We are trying to send vendor specific and standard ATA commands to a storage device for testing. Our application used DeviceIoControl(Passthrough IOCTL) in sending these commands but some functions does not work specially write commands. Because of this we decided to create a filter driver that will make sure that these commands will be sent to the device. What we did is we connected this filter driver to edisk.sys. And then if everything went correct during initialization the commands will be sent using WRITE_PORT… But unfortunately it does not… So now we are trying to solve this problem… This is the first time we coded a device driver… and it is completely different from user mode programming…

Thanks again,
Khryss

Peter Wieland wrote:
you won’t be able to do this.

The port driver owns the controller and (rightly) expects to have exclusive access to it. You can’t synchronize with the port driver’s register access (and i don’t want to start a big discussion about how a good OS would let you do this, or about odd hacks to get around it) you cannot access the ATA registers yourself.

If you explain what you’re trying to accomplish by doing this someone here may be able to suggest an alternative.

-p

--------------------------------------------------------------------------
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Christopher Flordeliza
Sent: Monday, January 24, 2005 7:43 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Please help me on device configuration

Hi all,

Please help me on this problem: I created a win2k filter driver attached to the upper part of disk.sys. During reception of IRP_MN_START_DEVICE I set the status of my IRP to STATUS_SUCCESS then send it to the lower stack. My problem is, during successful return, when I try to get the resource descriptor address I always get NULL. I do not know why NULL is always returned. I checked the address of IRP’s parameter field before and after the sending to the next stack, and both are NULL. BTW, I am trying to get the Interrupt and Port resources from the PNP manager.

We need to filter some ATA commands sent to a disk and then send it directly to the storage device using the resources sent by PNP manager without passing the lower layer of the stack.

Thanks in advance
Khryss

--------------------------------------------------------------------------
Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

------------------------------------------------------------------------------
Yahoo! Messenger - Communicate instantly…“Ping” your friends today! Download Messenger Now — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@storagecraft.com To unsubscribe send a blank email to xxxxx@lists.osr.com

>interface for the production NT-based OS’s. First off, note that this

is not trivial, and will suck all avaialble time for many man-months.

For IDE controller? Trivial. The simplest possible NT driver. There was also a
sample in NT4 DDK (without DMA support though).

port for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver,

They do. Just SCSIPORT does all of this for them. They have the sleep/awaken
callbacks though.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

>limited environment. This is a bit like killing a fly with boulder.

Lots of companies (including HighPoint) provide SCSIPORT’s miniports for their
IDE hardware. It’s just simpler.

So, if they desperately need the undebugged and broken ATA passthru, this is
their only way. They should start with reading the NT4 DDK ATAPI sample to
this - the SCSIPORT’s miniport for standard PC IDE controller (no DMA).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Trivial, eh?! So you’d be open to putting one together for them over
the weekend that has all the necessary features for them. :wink:

If you only need PIO, then using the NT4 DDK ATAPI example would be
quite easy. Making it work DMA on any given ATA controller requires
access to documentation to decode how the controller of choice works,
specifically access to the necessary timing setup decoder rings are not
typically available. So if they’re adding SMART commands that pass data
via PIO this is easy, but a full-featured driver is another thing.

My point about PNP & PM is that I don’t recall the NT4 ATAPI source
having any of the necessary handlers in the MPD. Sure, the ScsiPort DLL
must have support or it won’t work on newer MS OS’s. It’s the 3rd party
MPD that I’m talking about here.

MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Thursday, January 27, 2005 10:49 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Please help me on device configuration

interface for the production NT-based OS’s. First off, note that this
is not trivial, and will suck all avaialble time for many man-months.

For IDE controller? Trivial. The simplest possible NT driver. There was
also a
sample in NT4 DDK (without DMA support though).

port for your device. Scsi Miniport’s don’t have all the PNP and PM
support of a full-port driver,

They do. Just SCSIPORT does all of this for them. They have the
sleep/awaken
callbacks though.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

>My point about PNP & PM is that I don’t recall the NT4 ATAPI source

having any of the necessary handlers in the MPD. Sure, the ScsiPort DLL

No need in any PnP handlers, and, as about PM - it’s a single routine which is
called on sleep/awaken. SCSIPORT does all of the rest things.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Actually the PNP handler of ScsiPort.sys calls the miniport HwInitialize
handler, so from my point of view there really is a related call in the
MPD that’s called during PNP enumeration.

As for PM, there is no “single” routine that handles PM, but rather the
HwStartIo handler must handle the SCSIOP_START_STOP_UNIT case of the
SRB’s CDB[0] when it handles the Srb->Function SRB_FUNCTION_EXECUTE_SCSI
request; one big-old catch-all for executing commands.

MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Thursday, January 27, 2005 12:43 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Please help me on device configuration

My point about PNP & PM is that I don’t recall the NT4 ATAPI source
having any of the necessary handlers in the MPD. Sure, the ScsiPort
DLL

No need in any PnP handlers, and, as about PM - it’s a single routine
which is
called on sleep/awaken. SCSIPORT does all of the rest things.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

>As for PM, there is no “single” routine that handles PM, but rather the

HwStartIo handler must handle the SCSIOP_START_STOP_UNIT case of the

This is for LUNs.

For adapter itself, there is HwScsiAdapterControl or such.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Yes, you are right. I forgot about this handler. We moved to a
full-port driver with Windows 2000, and I never had to support this
handler in Win9x (handled by a higher-layered VXD) or NT4. MKE.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S.
Shatskih
Sent: Thursday, January 27, 2005 5:19 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Please help me on device configuration

As for PM, there is no “single” routine that handles PM, but rather the
HwStartIo handler must handle the SCSIOP_START_STOP_UNIT case of the

This is for LUNs.

For adapter itself, there is HwScsiAdapterControl or such.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@intel.com
To unsubscribe send a blank email to xxxxx@lists.osr.com