Replacing USBSTOR.sys

Discussion in 'Windows Vista Drivers' started by PRANAV KANT GAUR, Apr 12, 2010.

  1. Is it possible to replace USBSTOR.sys?
    How can we start developing driver to replace USBSTOR.sys?
    What are the responsibilities of USBSTOR.sys that must be fulfilled to be
    able to replace it?
     
    PRANAV KANT GAUR, Apr 12, 2010
    #1
    1. Advertising

  2. > Is it possible to replace USBSTOR.sys?

    ImagePath registry value.

    > What are the responsibilities of USBSTOR.sys that must be fulfilled to be
    > able to replace it?


    Conversion of SCSI CDBs to USBSTOR URBs
    Enumeration of the child devnode for the storage LUN
    Supporting all IOCTLs the storage port driver should

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Apr 12, 2010
    #2
    1. Advertising

  3. "Maxim S. Shatskih" wrote:

    > > Is it possible to replace USBSTOR.sys?

    >
    > ImagePath registry value.
    >
    > > What are the responsibilities of USBSTOR.sys that must be fulfilled to be
    > > able to replace it?

    >
    > Conversion of SCSI CDBs to USBSTOR URBs
    > Enumeration of the child devnode for the storage LUN
    > Supporting all IOCTLs the storage port driver should
    >
    > --
    > Maxim S. Shatskih
    > Windows DDK MVP
    >
    > http://www.storagecraft.com
    >
    > .

    But my device manager shows that i have IDE ATA/ATAPI controllers & no
    SCSI controllers it means no SCSI interface,so should i perform the
    transformation from USBSTOR URB'S to IDE command set queries.
     
    PRANAV KANT GAUR, Apr 13, 2010
    #3
  4. "matt_sykes" wrote:

    > On 13 Apr, 08:07, PRANAV KANT GAUR
    > <> wrote:
    > > "Maxim S. Shatskih" wrote:
    > > > > Is it possible to replace USBSTOR.sys?

    > >
    > > > ImagePath registry value.

    > >
    > > > > What are the responsibilities of USBSTOR.sys that must be fulfilled to be
    > > > > able to replace it?

    > >
    > > > Conversion of SCSI CDBs to USBSTOR URBs
    > > > Enumeration of the child devnode for the storage LUN
    > > > Supporting all IOCTLs the storage port driver should

    > >
    > > > --
    > > > Maxim S. Shatskih
    > > > Windows DDK MVP
    > > >
    > > >http://www.storagecraft.com

    > >
    > > > .

    > >
    > > But my device manager shows that i have IDE ATA/ATAPI controllers & no
    > > SCSI controllers it means no SCSI interface,so should i perform the
    > > transformation from USBSTOR URB'S to IDE command set queries.- Hide quoted text -
    > >
    > > - Show quoted text -

    >
    > You asked. and one of the best guys on the forum answered. If I were
    > you I would think carefullt about what Maxim wrote, and your questiob,
    > and see if you can work out why your question is worng.
    > .

    Since ATA packet interface uses SCSI Command set,so even if i have IDE
    ATA/ATAPI interface I need to perform USBSTOR's URB to SCSI command set
    conversion.
    Please correct me if i am still interpreting anything wrongly.
     
    PRANAV KANT GAUR, Apr 13, 2010
    #4
  5. > But my device manager shows that i have IDE ATA/ATAPI controllers & no
    > SCSI controllers it means no SCSI interface,so should i perform the
    > transformation from USBSTOR URB'S to IDE command set queries.


    The upper edge of any storage port in Windows, USBSTOR and ATAPI included, is SCSI.

    USBSTOR translates SCSI commands (used internally by Windows) to URBs.

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Apr 13, 2010
    #5
  6. > Since ATA packet interface uses SCSI Command set,so even if i have IDE
    > ATA/ATAPI interface I need to perform USBSTOR's URB to SCSI command set
    > conversion.


    What is your task? how is IDE related to your task?

    Is it an external enclosure for IDE device, connected to the host by USB? In this case, the enclosure has a USB Storage -> IDE bridge chip, and the host knows nothing on IDE there, it thinks this is just an USB storage device.

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Apr 13, 2010
    #6
  7. PRANAV KANT GAUR

    Tim Roberts Guest

    PRANAV KANT GAUR <> wrote:
    >
    >Since ATA packet interface uses SCSI Command set,so even if i have IDE
    >ATA/ATAPI interface I need to perform USBSTOR's URB to SCSI command set
    >conversion.
    >Please correct me if i am still interpreting anything wrongly.


    The fact that you have IDE disks on your computer (or not) is completely
    irrelevant. The USB Mass Storage Class specification is freely available.
    You can download it (and you absolutely NEED to read it, if you plan to
    continue on this pointless adventure). The commands that are sent to a USB
    Mass Storage Class device are a subset of the SCSI command set. It's just
    that simple.
    --
    Tim Roberts,
    Providenza & Boekelheide, Inc.
     
    Tim Roberts, Apr 14, 2010
    #7
  8. > continue on this pointless adventure). The commands that are sent to a USB
    > Mass Storage Class device are a subset of the SCSI command set.


    (not to Tim who knows all of this I think, but to OP and the whole forum)

    Correct, and they are wrapped to special URBs moving via a special pipe.

    For instance, if you have an ATA DVD drive in external USB enclosure - then the only agents who interpret the SCSI commands are a) the CD/DVD burning software, who is now usually a user-mode DLL or EXE and who forms these commands b) the drive itself.

    The rest of the pipeline - CdRom.sys, storage port, USB stack and the USB-to-ATA bridge chip - do not interpret them, they only deliver them "down". These parts of the stack can only enforce the transfer size and buffer alignment requirement, but not the SCSI commands semantics.

    USBSTOR is the one who does this CDB-to-URB wrapping, and also provides the generic storage port functionality (being a PnP bus driver, enumerating a LUN PDO for the storage device, assigning correct names/symlinks to it, implementing the mandatory IOCTLs).

    About ATA in this picture. ATAPI (for CD/DVD drives) is just SCSI over IDE wires, so, nothing special. As about the usual ATA (hard disks) - then the USB-to-ATA bridge chip has the conversion logic for them, and thus supports only a very limited set of SCSI commands.

    As about the ATA hard disk without USB - ATAPI stack is the place where conversion is done. It is also limited a lot, thus there is an ATA passthrough feature.

    Too bad we have no standard-described SCSI command which should map directly to ATA vendor-specific commands. If there would be such a standard - then a) no pathetic ATA passthrough interface, powerful SCSI passthrough could be used instead and b) ability to execute vendor ATA commands on a disk in external USB/1394 enclosure.

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Apr 14, 2010
    #8
  9. "Maxim S. Shatskih" wrote:

    > > Since ATA packet interface uses SCSI Command set,so even if i have IDE
    > > ATA/ATAPI interface I need to perform USBSTOR's URB to SCSI command set
    > > conversion.

    >
    > What is your task? how is IDE related to your task?

    I have a Sandisk Cruzer Micro flash drive device & i want to replace the
    USBSTOR.sys which acts as function driver for it by the driver written by my
    own.

    > Is it an external enclosure for IDE device, connected to the host by USB? In this case, the enclosure has a USB Storage -> IDE bridge chip, and the host knows nothing on IDE there, it thinks this is just an USB storage device.
    >
    > --
    > Maxim S. Shatskih
    > Windows DDK MVP
    >
    > http://www.storagecraft.com
    >
    > .
    >
     
    PRANAV KANT GAUR, Apr 18, 2010
    #9
  10. PRANAV KANT GAUR

    Tim Roberts Guest

    PRANAV KANT GAUR <> wrote:
    >
    >I have a Sandisk Cruzer Micro flash drive device & i want to replace the
    >USBSTOR.sys which acts as function driver for it by the driver written by my
    >own.


    Then you don't have anything to do with IDE here. You need to read the USB
    Mass Storage Class spec and understand the commands in there, which are a
    subset of the SCSI command set.
    --
    Tim Roberts,
    Providenza & Boekelheide, Inc.
     
    Tim Roberts, Apr 18, 2010
    #10
  11. > I have a Sandisk Cruzer Micro flash drive device & i want to replace the
    > USBSTOR.sys which acts as function driver for it by the driver written by my
    > own.


    And how is IDE related to this?

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Apr 18, 2010
    #11
  12. "Maxim S. Shatskih" wrote:

    > > I have a Sandisk Cruzer Micro flash drive device & i want to replace the
    > > USBSTOR.sys which acts as function driver for it by the driver written by my
    > > own.

    >
    > And how is IDE related to this?

    Sorry,It is not related.

    I was not aware of the fact that "ATAPI is just SCSI over IDE wires" as you
    told due to which i was thinking that since i have IDE ATA/ATAPI interface so
    i need to perform IDE-command set to URB conversion.

    Please sir,give me your advice over following:
    I am an engineering student,willing to learn how interaction between system
    entities & devices takes place,i found driver development to be as best way
    to learn it.
    But i concluded wrongly that client driver is the one that we can implement
    which is responsible for implementing device specific functionality,now i
    came to know that for USB mass storage devices Windows already have a class
    driver:USBSTOR.sys ,it means to implement function driver i have to replace
    USBSTOR.sys & client drivers have no role to play in typical USB mass
    storage devices(like flash drives).
    There seems to be no scope for developing replacement for USBSTOR.sys in
    WDF,is it possible through any other model(please tell me from where i can
    start working ?) -I want to submit it as my major project.



    > --
    > Maxim S. Shatskih
    > Windows DDK MVP
    >
    > http://www.storagecraft.com
    >
    > .
    >
     
    PRANAV KANT GAUR, Apr 19, 2010
    #12
  13. > I was not aware of the fact that "ATAPI is just SCSI over IDE wires" as you
    > told due to which i was thinking that since i have IDE ATA/ATAPI interface so
    > i need to perform IDE-command set to URB conversion.


    No.

    USB storage driver must convert from Windows internal command set to URB command set. And yes, Windows internal command set is SCSI.

    > came to know that for USB mass storage devices Windows already have a class
    > driver:USBSTOR.sys


    Yes, and this suits most needs, even CD/DVD burning/ripping works over it (at least post-w2k).

    > There seems to be no scope for developing replacement for USBSTOR.sys in
    > WDF


    Correct.

    Sorry, I don't know what are the scope requirementes for student lab project.

    --
    Maxim S. Shatskih
    Windows DDK MVP

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Apr 19, 2010
    #13
  14. PRANAV KANT GAUR

    Tim Roberts Guest

    PRANAV KANT GAUR <> wrote:
    >
    >Please sir,give me your advice over following:
    >I am an engineering student,willing to learn how interaction between system
    >entities & devices takes place,i found driver development to be as best way
    >to learn it.


    Many companies sell USB experimenter's kits that are designed specifically
    for cases like yours. Many of them can be extended with LEDs, relays,
    microprocessors, PICs, and other things that allow you to experiment with
    external device control.

    Google for "usb experimenters kits".
    --
    Tim Roberts,
    Providenza & Boekelheide, Inc.
     
    Tim Roberts, Apr 20, 2010
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    0
    Views:
    1,031
  2. John

    Device Upper Filter usbstor.sys

    John, Nov 23, 2004, in forum: Windows Vista Drivers
    Replies:
    1
    Views:
    700
    Calvin Guan
    Nov 23, 2004
  3. michelle

    Verbose tracing for usbstor.sys

    michelle, Dec 22, 2004, in forum: Windows Vista Drivers
    Replies:
    1
    Views:
    514
    Eliyas Yakub [MSFT]
    Dec 27, 2004
  4. Atul H.
    Replies:
    0
    Views:
    463
    Atul H.
    Feb 8, 2005
  5. Chad

    USBSTOR.sys 5.1.2600.1106

    Chad, May 27, 2005, in forum: Windows Vista Drivers
    Replies:
    1
    Views:
    533
Loading...

Share This Page