Crossplatform SCSI miniport driver - howto ?

Hi All,

I’m implementing a virtual SCSI miniport driver which allows the user to mount/unmount
disk volume images and use them as normal disk devices.

The driver should work on Win NT/2000/XP/+, Win 9x/Me.

So my questions are:

  1. Which model of disk drives should I use - removable or non-removable ?
    I see problems with removable disks in Win NT, so I suppose I have to use non-removable device model ?

  2. Is it possible to have several partitions on such a virtual disk device ?
    Can it be formatted to NTFS or FAT only ??

  3. I use a dummy SCSI device of type PROCESSOR_DEVICE on my virtual adapter’s bus to provide
    an interface with my usermode application.
    But Win 2000/XP try to install drivers for the device. How can I disable such a behavior of the system ?

  4. After the driver installed it is marked as non-loaded in the Device Manager (but the driver loads OK) - what
    can I do to make the system happy ? (I set AdapterInterfaceType=PCIBus)

Any help or suggestions are welcome.

Best regards,
Valeriy Glushkov

>Hi All,

I’m implementing a virtual SCSI miniport driver which allows the user to mount/unmount
disk volume images and use them as normal disk devices.

The driver should work on Win NT/2000/XP/+, Win 9x/Me.

So my questions are:

  1. Which model of disk drives should I use - removable or non-removable ?
    I see problems with removable disks in Win NT, so I suppose I have to use non-removable device model ?

both are OK on 2K/XP
however it seems that XP always send TEST UNIT READY down if U choose
removable disk type.

  1. Is it possible to have several partitions on such a virtual disk device ?
    Can it be formatted to NTFS or FAT only ??

Sure, but U need pay attention to image size for repective partition type :wink: eg. FAT32 image should be larger than 33MB

  1. I use a dummy SCSI device of type PROCESSOR_DEVICE on my virtual adapter’s bus to provide
    an interface with my usermode application.
    But Win 2000/XP try to install drivers for the device. How can I disable such a behavior of the system ?

Maybe U can use some setup API to install a dummy driver for U?

  1. After the driver installed it is marked as non-loaded in the Device Manager (but the driver loads OK) - what
    can I do to make the system happy ? (I set AdapterInterfaceType=PCIBus)
    well, for a virtual miniport, that should be ISA.

Any help or suggestions are welcome.

Best regards,
Valeriy Glushkov


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

  1. i’d suggest non-removable. Among other things, removable disks are
    limited to a single partition.

  2. multiple partitions shouldn’t be a problem. Neither should the
    format.

  3. put an INF in the system with your device’s hardwareID to indicate
    that no driver need be installed. The system searches for a driver
    because PROCESSOR_DEVICE is also used for many scsi printers (long
    story)

  4. is your miniport a PNP miniport?

-p

-----Original Message-----
From: Valeriy Glushkov [mailto:gvvua@ua.fm]
Sent: Tuesday, April 01, 2003 4:17 AM
To: NT Developers Interest List

Hi All,

I’m implementing a virtual SCSI miniport driver which allows
the user to mount/unmount disk volume images and use them as
normal disk devices.

The driver should work on Win NT/2000/XP/+, Win 9x/Me.

So my questions are:

  1. Which model of disk drives should I use - removable or
    non-removable ?
    I see problems with removable disks in Win NT, so I suppose I
    have to use non-removable device model ?

  2. Is it possible to have several partitions on such a
    virtual disk device ?
    Can it be formatted to NTFS or FAT only ??

  3. I use a dummy SCSI device of type PROCESSOR_DEVICE on my
    virtual adapter’s bus to provide an interface with my
    usermode application.
    But Win 2000/XP try to install drivers for the device. How
    can I disable such a behavior of the system ?

  4. After the driver installed it is marked as non-loaded in
    the Device Manager (but the driver loads OK) - what can I do
    to make the system happy ? (I set AdapterInterfaceType=PCIBus)

Any help or suggestions are welcome.

Best regards,
Valeriy Glushkov


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

Peter,

Thank you for the answer.

  1. Now my miniport is a legacy one, but I have to make it PnP aware for Win2000/XP+.

From the list I’ve learned that a virtual miniport should register itself for ISA bus usage,
after that it’s HwScsiFindAdapter routine will be called by scsiport to enumerate virtual adapters.

Is that the only way to create an adapter for a virtual miniport ? Or maybe are there other methods ?

  1. In Win 2000/XP I send IO requests to the miniport from my app to mount/unmount disk images.
    In the driver after creating or deleting a target I call ScsiPortNotification with BusChangeDetected command
    to say the scsiport to enumerate my buses.

Is it possible to implement this in Win NT4 (there isn’t BusChangeDetected there) ?

  1. There is Internal bus in definitions for AdapterInterfaceType in HW_INITIALIZATION_DATA.
    But scsiport seems to ignore a miniport which try to register itself using this type of adapter. :frowning:

I supposed it is an natural way for a virtual miniport to use the type Internal, but it looks like I’m not right ?

Thanks in advance.

Best Regards,
Valeriy Glushkov

----- Original Message -----
From: “Peter Wieland”
To: “NT Developers Interest List”
Sent: Tuesday, April 01, 2003 10:08 PM
Subject: [ntdev] RE: Crossplatform SCSI miniport driver - howto ?

1) i’d suggest non-removable. Among other things, removable disks are
limited to a single partition.

2) multiple partitions shouldn’t be a problem. Neither should the
format.

3) put an INF in the system with your device’s hardwareID to indicate
that no driver need be installed. The system searches for a driver
because PROCESSOR_DEVICE is also used for many scsi printers (long
story)

4) is your miniport a PNP miniport?

-p

>
> -----Original Message-----
> From: Valeriy Glushkov [mailto:gvvua@ua.fm]
> Sent: Tuesday, April 01, 2003 4:17 AM
> To: NT Developers Interest List
>
> Hi All,
>
> I’m implementing a virtual SCSI miniport driver which allows
> the user to mount/unmount disk volume images and use them as
> normal disk devices.
>
> The driver should work on Win NT/2000/XP/+, Win 9x/Me.
>
> So my questions are:
>
> 1) Which model of disk drives should I use - removable or
> non-removable ?
> I see problems with removable disks in Win NT, so I suppose I
> have to use non-removable device model ?
>
> 2) Is it possible to have several partitions on such a
> virtual disk device ?
> Can it be formatted to NTFS or FAT only ??
>
> 3) I use a dummy SCSI device of type PROCESSOR_DEVICE on my
> virtual adapter’s bus to provide an interface with my
> usermode application.
> But Win 2000/XP try to install drivers for the device. How
> can I disable such a behavior of the system ?
>
> 4) After the driver installed it is marked as non-loaded in
> the Device Manager (but the driver loads OK) - what can I do
> to make the system happy ? (I set AdapterInterfaceType=PCIBus)
>
> Any help or suggestions are welcome.
>
> Best regards,
> Valeriy Glushkov
>

>

  1. There is Internal bus in definitions for
    AdapterInterfaceType in HW_INITIALIZATION_DATA. But scsiport
    seems to ignore a miniport which try to register itself using
    this type of adapter. :frowning:

I supposed it is an natural way for a virtual miniport to use
the type Internal, but it looks like I’m not right ?

While natural, scsiport essentially refuses to configure an internal bus
adapter. (It is possible to hack around this ‘feature’, but the hack is
ridiculous, as it requires you to register as an ISA adapter anyway.)

  1. there are other people on this list with more experience helping
    people build virtual miniports.

  2. there is no BusChangeDetected on NT4. You can send IOCTL_SCSI_RESCAN
    to the adapter though to add a LUN. There is no solid support for
    removing devices on NT4.

-----Original Message-----
From: Valeriy Glushkov [mailto:gvvua@ua.fm]
Sent: Tuesday, April 01, 2003 1:14 PM
To: NT Developers Interest List

Peter,

Thank you for the answer.

  1. Now my miniport is a legacy one, but I have to make it PnP aware for
    Win2000/XP+.

From the list I’ve learned that a virtual miniport should register
itself for ISA bus usage, after that it’s HwScsiFindAdapter routine will
be called by scsiport to enumerate virtual adapters.

Is that the only way to create an adapter for a virtual miniport ? Or
maybe are there other methods ?

  1. In Win 2000/XP I send IO requests to the miniport from my app to
    mount/unmount disk images.
    In the driver after creating or deleting a target I call
    ScsiPortNotification with BusChangeDetected command to say the scsiport
    to enumerate my buses.

Is it possible to implement this in Win NT4 (there isn’t
BusChangeDetected there) ?

  1. There is Internal bus in definitions for AdapterInterfaceType in
    HW_INITIALIZATION_DATA.
    But scsiport seems to ignore a miniport which try to register itself
    using this type of adapter. :frowning:

I supposed it is an natural way for a virtual miniport to use the type
Internal, but it looks like I’m not right ?

Thanks in advance.

Best Regards,
Valeriy Glushkov

----- Original Message -----
From: “Peter Wieland”
To: “NT Developers Interest List”
Sent: Tuesday, April 01, 2003 10:08 PM
Subject: [ntdev] RE: Crossplatform SCSI miniport driver - howto ?

1) i’d suggest non-removable. Among other things, removable disks are
limited to a single partition.

2) multiple partitions shouldn’t be a problem. Neither should the
format.

3) put an INF in the system with your device’s hardwareID to indicate
that no driver need be installed. The system searches for a driver
because PROCESSOR_DEVICE is also used for many scsi printers (long
story)

4) is your miniport a PNP miniport?

-p

>
> -----Original Message-----
> From: Valeriy Glushkov [mailto:gvvua@ua.fm]
> Sent: Tuesday, April 01, 2003 4:17 AM
> To: NT Developers Interest List
>
> Hi All,
>
> I’m implementing a virtual SCSI miniport driver which allows
> the user to mount/unmount disk volume images and use them as
> normal disk devices.
>
> The driver should work on Win NT/2000/XP/+, Win 9x/Me.
>
> So my questions are:
>
> 1) Which model of disk drives should I use - removable or
> non-removable ?
> I see problems with removable disks in Win NT, so I suppose I
> have to use non-removable device model ?
>
> 2) Is it possible to have several partitions on such a
> virtual disk device ?
> Can it be formatted to NTFS or FAT only ??
>
> 3) I use a dummy SCSI device of type PROCESSOR_DEVICE on my
> virtual adapter’s bus to provide an interface with my
> usermode application.
> But Win 2000/XP try to install drivers for the device. How
> can I disable such a behavior of the system ?
>
> 4) After the driver installed it is marked as non-loaded in
> the Device Manager (but the driver loads OK) - what can I do
> to make the system happy ? (I set AdapterInterfaceType=PCIBus)
>
> Any help or suggestions are welcome.
>
> Best regards,
> Valeriy Glushkov
>


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

Valeriy,

Looks llike you have the loading and unloding issues taken care of.

The rule of thumb I found was where you complete an SRB. If all SRBs will be
completed before you leave HwStartIo then SCSI/STORPORT will probably
suffice. If you want to pend a few SRBs, delay completing them, and do not
mind a 10 ms delay for a SCSI timer, then SCSI/STORPORT is still fine. If
however, you want to queue and delay SRB compltetion until some event takes
place, such as an interrupt handled in another driver, your best bet is to
go to a third part SCSI support library, because SCSI/STORPORT will not
handle that situation.


Gary G. Little
Have Computer, Will Travel …
909-698-3191
909-551-2105
http://www.wd-3.com
“Peter Wieland” wrote in message
news:xxxxx@ntdev…

1) there are other people on this list with more experience helping
people build virtual miniports.

2) there is no BusChangeDetected on NT4. You can send IOCTL_SCSI_RESCAN
to the adapter though to add a LUN. There is no solid support for
removing devices on NT4.

-----Original Message-----
From: Valeriy Glushkov [mailto:gvvua@ua.fm]
Sent: Tuesday, April 01, 2003 1:14 PM
To: NT Developers Interest List

Peter,

Thank you for the answer.

1) Now my miniport is a legacy one, but I have to make it PnP aware for
Win2000/XP+.

From the list I’ve learned that a virtual miniport should register
itself for ISA bus usage, after that it’s HwScsiFindAdapter routine will
be called by scsiport to enumerate virtual adapters.

Is that the only way to create an adapter for a virtual miniport ? Or
maybe are there other methods ?

2) In Win 2000/XP I send IO requests to the miniport from my app to
mount/unmount disk images.
In the driver after creating or deleting a target I call
ScsiPortNotification with BusChangeDetected command to say the scsiport
to enumerate my buses.

Is it possible to implement this in Win NT4 (there isn’t
BusChangeDetected there) ?

3) There is Internal bus in definitions for AdapterInterfaceType in
HW_INITIALIZATION_DATA.
But scsiport seems to ignore a miniport which try to register itself
using this type of adapter. :frowning:

I supposed it is an natural way for a virtual miniport to use the type
Internal, but it looks like I’m not right ?

Thanks in advance.

Best Regards,
Valeriy Glushkov

----- Original Message -----
From: “Peter Wieland”
To: “NT Developers Interest List”
Sent: Tuesday, April 01, 2003 10:08 PM
Subject: [ntdev] RE: Crossplatform SCSI miniport driver - howto ?

1) i’d suggest non-removable. Among other things, removable disks are
limited to a single partition.

2) multiple partitions shouldn’t be a problem. Neither should the
format.

3) put an INF in the system with your device’s hardwareID to indicate
that no driver need be installed. The system searches for a driver
because PROCESSOR_DEVICE is also used for many scsi printers (long
story)

4) is your miniport a PNP miniport?

-p

>
> -----Original Message-----
> From: Valeriy Glushkov [mailto:gvvua@ua.fm]
> Sent: Tuesday, April 01, 2003 4:17 AM
> To: NT Developers Interest List
>
> Hi All,
>
> I’m implementing a virtual SCSI miniport driver which allows
> the user to mount/unmount disk volume images and use them as
> normal disk devices.
>
> The driver should work on Win NT/2000/XP/+, Win 9x/Me.
>
> So my questions are:
>
> 1) Which model of disk drives should I use - removable or
> non-removable ?
> I see problems with removable disks in Win NT, so I suppose I
> have to use non-removable device model ?
>
> 2) Is it possible to have several partitions on such a
> virtual disk device ?
> Can it be formatted to NTFS or FAT only ??
>
> 3) I use a dummy SCSI device of type PROCESSOR_DEVICE on my
> virtual adapter’s bus to provide an interface with my
> usermode application.
> But Win 2000/XP try to install drivers for the device. How
> can I disable such a behavior of the system ?
>
> 4) After the driver installed it is marked as non-loaded in
> the Device Manager (but the driver loads OK) - what can I do
> to make the system happy ? (I set AdapterInterfaceType=PCIBus)
>
> Any help or suggestions are welcome.
>
> Best regards,
> Valeriy Glushkov
>


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

The correct way for writing such drivers is implementing the
full-blown SCSI port driver, possibly with the help of some toolkit
library (we provide one and some other people IIRC too).

SCSIPORT/STORPORT does not support hardware-less miniports properly,
period. You can only do some hacks with timer or second LUN pinged by
IOCTLs from the app, but all of these hacks are absolutely unsuitable
for a decent product, and nobody can guarantee any reliability of
those.

Max

----- Original Message -----
From: “Valeriy Glushkov”
To: “NT Developers Interest List”
Sent: Tuesday, April 01, 2003 4:16 PM
Subject: [ntdev] Crossplatform SCSI miniport driver - howto ?

> Hi All,
>
> I’m implementing a virtual SCSI miniport driver which allows the
user to mount/unmount
> disk volume images and use them as normal disk devices.
>
> The driver should work on Win NT/2000/XP/+, Win 9x/Me.
>
> So my questions are:
>
> 1) Which model of disk drives should I use - removable or
non-removable ?
> I see problems with removable disks in Win NT, so I suppose I have
to use non-removable device model ?
>
> 2) Is it possible to have several partitions on such a virtual disk
device ?
> Can it be formatted to NTFS or FAT only ??
>
> 3) I use a dummy SCSI device of type PROCESSOR_DEVICE on my virtual
adapter’s bus to provide
> an interface with my usermode application.
> But Win 2000/XP try to install drivers for the device. How can I
disable such a behavior of the system ?
>
> 4) After the driver installed it is marked as non-loaded in the
Device Manager (but the driver loads OK) - what
> can I do to make the system happy ? (I set
AdapterInterfaceType=PCIBus)
>
> Any help or suggestions are welcome.
>
> Best regards,
> Valeriy Glushkov
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>