Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


IDE Driver Design (Choosing the Driver Architecture)

OSR_Community_UserOSR_Community_User Member Posts: 110,217
> Hi All,
>
> Background info: //Platform Windows NT/2K/9x
> We are having a driver (normal KMD) for sending specific commands
> (from our application) to the IDE device (a removable Storage HardDisk)
> we want to control. This driver directly manipulates the IDE controller
> registers. We chk the err/sts registers and then read/write to the
> controller regs. We are not making use of any synchronization objects
> while accessing the regs. We chk the busy sts and go ...
The device may get into a busy state (or the drive may spin down)
from which it takes some considerable amount of time to return. So if we are
chking the busy sts before accessing the IDE controller regs, the wait may
fail.

> [We were initially disabling the interrupts while doing some operations
> and that resulted in system crashes when some other applications tried to
> access the dev. Now the itr: disabling is not thre.]
>
The device will behave as a normal HDD for the user. ie other drivers may
also work on it. The problem is that our access to the device is not
serialized with the other access. This results in random failures while
reading/writing data.
>
> In 9x, we may make use of the services from IOS for accessing the IDE
> Controller regs. Is thre such services available for NT which we can avail
> from the KMD?
What are the possible options we have?
(1?)Make our KMD to be a SCSI Miniport driver, making use of SCSI Port
driver functions to access the registers.

(2?)Filter Driver
----
> Can a Filter Driver solve this problem? We are hoping that if we can
> route the dev requests thru an FD, the device access may get serialized
> ..ie one access at a time and hence all the problems may go away.
---
> What inputs do you have on this? Whre shall i begin/end?
>
> Thanks in advance
> balan
>
> ----------------------------------------------
> "What lies behind us and what lies before us are tiny matters compared to
> what lies within us." ---Emerson
>
>

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hi,
    Itz documented that scsi miniport drivers are for newer Host Bus
    Adapters. And SCSI filter drivers (over class driver)are supposed to allow
    us sending vendor unique commands.

    So is filter driver, the only option?

    For normal commands we can directly call the lower class driver for
    performing the task. How to perform device level access from the filter
    driver? Surely we need to make use of the services of lower KMDs.

    Say for performing one device specific operation, i need to read from one of
    the registers of the IDE controller and write some value back to another
    register. But this sequence is unknown to the lower KMD.
    i may have to issue multiple IO Read/Write request to the
    lower class driver by sending IRPs. can thre be a performance issue?

    //Hey..Have i lost the way completely?

    TIA
    balan

    --->>
    We are having a driver (normal KMD) for sending specific commands (from our
    application) to the IDE device (a removable Storage HardDisk)we want to
    control

    ...[snip]

    What are the possible options we have?
    (1?)Make our KMD to be a SCSI Miniport driver, making use of SCSI Port
    driver functions to access the registers.

    (2?)Filter Driver

    <<---



    ----------------------------------------------
    "What lies behind us and what lies before us are tiny matters compared to
    what lies within us." ---Emerson
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online