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

Home NTDEV

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/


Before Posting...

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

Bus Driver: clarification needed

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hello,

Although the DDK has no explicit mention, my understanding is that
a Bus Driver would not have the following:

-Interrupt Service Routine
-DPC routine
-StartIO Routine
-Any driver-specific IRP-queueing mechanism

Is this correct ? If not, could you please explain ?

Thank you in advance!

Puja

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    This is incorrect. A bus driver can also have a role as a function driver,
    therefore requiring all the routines you mention.

    An example is Atapi.sys (in Win2000). It acts as a bus driver by
    enumerating the Ide drives on the system, then as a function driver via its
    StartIo->ISR->DPC path.

    Daniel

    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Monday, April 24, 2000 11:57 AM
    To: NT Developers Interest List
    Subject: [ntdev] Bus Driver: clarification needed


    Hello,

    Although the DDK has no explicit mention, my understanding is that
    a Bus Driver would not have the following:

    -Interrupt Service Routine
    -DPC routine
    -StartIO Routine
    -Any driver-specific IRP-queueing mechanism

    Is this correct ? If not, could you please explain ?

    Thank you in advance!

    Puja

    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    >Although the DDK has no explicit mention, my understanding is that
    >a Bus Driver would not have the following:
    >
    >-Interrupt Service Routine
    >-DPC routine
    >-StartIO Routine
    >-Any driver-specific IRP-queueing mechanism
    >
    >Is this correct ? If not, could you please explain ?

    I view bus drivers as virtual interfaces to some lower level. For example,
    I'm currently working on a function driver for a memory like PCMCIA (now
    PCCard) device. Typically, there will be a PCCard controller bus driver
    that talks to a PCCard controller (possibly through some lower level bus
    driver, like for the PCI bus). You can also buy PCCard controllers that
    interface through USB, parallel, or scsi busses, and would expect a
    correctly written bus driver for one of these to present an interface to my
    function driver that's identical to a directly attached PCCard controller
    bus driver. There are IRP definitions to read/write memory, with a
    parameter controlling which address space (attribute or common for PCCard
    busses). So in theory, my function driver can talk to my device by issuing
    read/write IRP's down the stack, and if those requests have to get
    transported across a USB or SCSI bus, that's the responsibility of the
    lower level bus driver (it certainly works for local PCCard controller bus
    drivers). My guess is this will turn out to be a little optimistic (a
    couple of USB PCCard devices are on order, any driver writers out there who
    can tell me one that get's this right?).

    (lots of Microsoft driver architecture bashing deleted here)

    - Jan
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > Although the DDK has no explicit mention, my understanding is that
    > a Bus Driver would not have the following:
    >
    > -Interrupt Service Routine
    > -DPC routine
    > -StartIO Routine
    > -Any driver-specific IRP-queueing mechanism

    Usually yes. Bus driver usually responds to PnP IRPs only and to hardware
    events (device arrival/removal) on the underlying bus.
    Though nothing prevents you from having a bus driver which will have some
    other semantics on PDOs - like reads, writes or IOCTLs.

    Max
  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,480
    Well I completely disagree.

    Take the case of a SCSI port bus driver or a USB bus driver. These drivers
    have ISRs, DPCs, may or may not (hopefully not) have startio routines, may
    very well queue irps, and are deeply involved in IO processing of IRPs. They
    are also both Function drivers on standard busses such as PCI. This dual
    role requires all the standard IO processing of a lowest leve driver in
    addition to bus management activity.

    Mark Roddy
    Windows 2000/NT Consultant
    Hollis Technology Solutions
    www.hollistech.com

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Maxim S. Shatskih
    Sent: Thursday, May 04, 2000 2:03 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Bus Driver: clarification needed


    > Although the DDK has no explicit mention, my understanding is that
    > a Bus Driver would not have the following:
    >
    > -Interrupt Service Routine
    > -DPC routine
    > -StartIO Routine
    > -Any driver-specific IRP-queueing mechanism

    Usually yes. Bus driver usually responds to PnP IRPs only and to hardware
    events (device arrival/removal) on the underlying bus.
    Though nothing prevents you from having a bus driver which will have some
    other semantics on PDOs - like reads, writes or IOCTLs.

    Max


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Mark is correct. I'm currently writing a bus driver that has all of above
    (below).

    Basically it comes down the this: If your bus driver ONLY needs to
    enumerate devices it won't have an StartIo/ISR/DPC. If it needs to take the
    role of a function driver (like ScsiPort does) it will.

    Daniel Nemiroff
    System Software Engineering
    Intel Corp.


    -----Original Message-----
    From: Mark Roddy [mailto:[email protected]]
    Sent: Friday, May 05, 2000 5:37 AM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Bus Driver: clarification needed


    Well I completely disagree.

    Take the case of a SCSI port bus driver or a USB bus driver. These drivers
    have ISRs, DPCs, may or may not (hopefully not) have startio routines, may
    very well queue irps, and are deeply involved in IO processing of IRPs. They
    are also both Function drivers on standard busses such as PCI. This dual
    role requires all the standard IO processing of a lowest leve driver in
    addition to bus management activity.

    Mark Roddy
    Windows 2000/NT Consultant
    Hollis Technology Solutions
    www.hollistech.com

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Maxim S. Shatskih
    Sent: Thursday, May 04, 2000 2:03 PM
    To: NT Developers Interest List
    Subject: [ntdev] Re: Bus Driver: clarification needed


    > Although the DDK has no explicit mention, my understanding is that
    > a Bus Driver would not have the following:
    >
    > -Interrupt Service Routine
    > -DPC routine
    > -StartIO Routine
    > -Any driver-specific IRP-queueing mechanism

    Usually yes. Bus driver usually responds to PnP IRPs only and to hardware
    events (device arrival/removal) on the underlying bus.
    Though nothing prevents you from having a bus driver which will have some
    other semantics on PDOs - like reads, writes or IOCTLs.

    Max


    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')



    ---
    You are currently subscribed to ntdev as: [email protected]
    To unsubscribe send a blank email to $subst('Email.Unsub')
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!
Writing WDF Drivers 24 January 2022 Live, Online
Internals & Software Drivers 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online
Developing Minifilters 23 May 2022 Live, Online