Training seminar on SCSI port driver

Does anyone know if there are training seminars or information on writing a
SCSI port driver?

Thanks,
Joe


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Joe,

Do you mean just the mini-port that provides callbacks to ScsiPort, or a
full-blown replacement for ScsiPort? If the former, it is fairly simple and
the samples in the DDKs fairly well cover the subject. If the later, the
best, and in the long run cheapest, is to go to someone that already has
one. Storage Craft is one such, at storagecraft.com, and one I can
recommend. There may be others, such as OSR.

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Monday, September 24, 2001 12:08 PM
To: NT Developers Interest List
Subject: [ntdev] Training seminar on SCSI port driver

Does anyone know if there are training seminars or information on writing a
SCSI port driver?

Thanks,
Joe


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Joe,

I’ve personally helped to write own SCSI port driver to at least 2 members
of this list. For free -) If you need own SCSI port - just start writing
it. Searching this list on the topic you’re interested with will provide
you enough information you need to complete the project. And I think a lot
of people will be happy to help you. In any case you can just license the
sample SCSI port code from somebody who’ve already wrote it (maybe it will
be the easiest and simpleist way if you’re paying for your research
yourself). There are at least 3 companies who sell this code (I’ll not tell
the names you should know them yourself).

Regards,
Anton Kolomyeytsev

CoolDev.Com - Toolkits for Network & Storage Kernel Software Developers
“KoolSockets” & “KoolStorage” - TDI Client, Kernel Sockets, iSCSI port
www.CoolDev.Com xxxxx@CoolDev.Com xxxxx@CoolDev.Com

Does anyone know if there are training seminars or information on writing a
SCSI port driver?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

We have the toolkit of doing this and can license it to you.

----- Original Message -----
From: “Joe Moriarty”
To: “NT Developers Interest List”
Sent: Monday, September 24, 2001 11:07 PM
Subject: [ntdev] Training seminar on SCSI port driver

> Does anyone know if there are training seminars or information on writing
a
> SCSI port driver?
>
> Thanks,
> Joe
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

So your writing your own SCSI port driver that handle disk & cdrom drives.
The device object for the SCSI port driver?

Does the device type = FILE_DEVICE_CONTROLLER?
Does the device name = //Device/ScsiPortX?
Does the dos name = //Device/ScsiX?

I noticed that the Atapi.sys ide miniport driver caused the MS port driver
to create an ‘IDE’ name space subdirectory in the ‘device’ name space
directory. They created a device name of ‘ideport0’ in the \device\ide name
space. They then created symbolic links to this device name of
\device\ScsiPort0 and ??\Scsi0. Does it really have to be this complicated
with the names?

Thanks,
Joe


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Does the device type = FILE_DEVICE_CONTROLLER?

Does the device name = //Device/ScsiPortX?
Does the dos name = //Device/ScsiX?

Yes, yes, and no.
The DOS name is ??\Scsi%d:
Note the colon.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks,

Next question?

I need to register the interface of “StoragePortClassGuid” via
IoRegisterDeviceInterface correct?

Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Tuesday, September 25, 2001 8:33 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI port driver

> Does the device type = FILE_DEVICE_CONTROLLER?
> Does the device name = //Device/ScsiPortX?
> Does the dos name = //Device/ScsiX?

Yes, yes, and no.
The DOS name is ??\Scsi%d:
Note the colon.

Max


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

May I ask you? Why do you need to register it?

Next question?
I need to register the interface of “StoragePortClassGuid” via
IoRegisterDeviceInterface correct?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Obvious answer:

  • to work properly. To be 100% compatible with native SCSIPORT.

From your neglectance of such issues, I can conclude that your code is not
100% compatible with SCSIPORT.

Max

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Tuesday, September 25, 2001 4:00 PM
Subject: [ntdev] Re: SCSI port driver

> May I ask you? Why do you need to register it?
>
> > Next question?
> > I need to register the interface of “StoragePortClassGuid” via
> > IoRegisterDeviceInterface correct?
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You’re confused. If somebody writes a monolithis SCSI port driver (for own
IDE RAID contoller, for own FC controller for example) he does not need
complete repleacement of SCSIPORT from Microsoft. If you wrote the driver
that replaces SCSIPORT (I think that’s what you did) my congratulations!
But not a lot of people need this… Monolithic SCSI port != Microsoft
SCSIPORT.

From your neglectance of such issues, I can conclude that your code is not
100% compatible with SCSIPORT.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Right. A port driver simply replaces the scsiport/miniport with A MUCH
SIMPLER monolithic driver. More complicated than a miniport, far less
complicated than a scsiport replacement. I believe that older ddks had
samples of such drivers for the non-scsi side of the disk controller
world, although I could be wrong.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, September 26, 2001 6:16 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI port driver

You’re confused. If somebody writes a monolithis SCSI port
driver (for own
IDE RAID contoller, for own FC controller for example) he
does not need
complete repleacement of SCSIPORT from Microsoft. If you
wrote the driver
that replaces SCSIPORT (I think that’s what you did) my
congratulations!
But not a lot of people need this… Monolithic SCSI port !=
Microsoft
SCSIPORT.

> From your neglectance of such issues, I can conclude that
your code is
> not 100% compatible with SCSIPORT.


You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I’m going to give it a shot because my SCSIPORT driver is enumerated by a
parent driver (I’m a PNP driver model). It’s probably only used for all
their WMI crap, but if it doesn’t hurt to bad why not do it.

Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, September 26, 2001 6:16 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI port driver

You’re confused. If somebody writes a monolithis SCSI port driver
(for own
IDE RAID contoller, for own FC controller for example) he does not need
complete repleacement of SCSIPORT from Microsoft. If you wrote the driver
that replaces SCSIPORT (I think that’s what you did) my congratulations!
But not a lot of people need this… Monolithic SCSI port != Microsoft
SCSIPORT.

> From your neglectance of such issues, I can conclude that your
code is not
> 100% compatible with SCSIPORT.


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Alright, here’s were I’m at with my SCSIPORT driver. One instance of the
SCSIPORT driver is enumerated by the parent driver. WinXP sees it and loads
my SCSIPORT driver. I do the following piece of code in my AddDevice
routine to create the Device. I get device 1. Device 0 is assigned to the
onboard PCI/IDE controller.

do
{
swprintf(wcBuffer, L"\Device\ScsiPort%d", ulDeviceCount);

RtlInitUnicodeString(&UniDevName, wcBuffer);
Status = IoCreateDevice(pDriverObject,
sizeof(EMDISK_CONTROLLER_EXTENSION),
&UniDevName, FILE_DEVICE_CONTROLLER,
0, FALSE, &pNewDeviceObject);
ulDeviceCount++;
}while((Status == STATUS_OBJECT_NAME_COLLISION) || (Status ==
STATUS_OBJECT_NAME_EXISTS));

if(Status == STATUS_SUCCESS)
{
ulDeviceCount–;

later on in my AddDevice routine I create the symbolic link name by doing
the following piece of code.

//
// create the symbolic link
//
swprintf(pEmDiskCntrlExt->wcName, L"\??\scsi%d:", ulDeviceCount);
RtlInitUnicodeString(&pEmDiskCntrlExt->UniDevSymbolicName,
pEmDiskCntrlExt->wcName);
Status = IoCreateSymbolicLink(&pEmDiskCntrlExt->UniDevSymbolicName,
&UniDevName);

My Major Functions that I support are
//
// Fill in all the dispatch entry points with the pass through function
// and the explicitly fill in the functions we are going to intercept
//
for(i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
{
pDriverObject->MajorFunction[i] = PnpDefaultHandler;
}

pDriverObject->DriverUnload = DriverUnload;
pDriverObject->DriverExtension->AddDevice = EmDiskAddDevice;
pDriverObject->MajorFunction[IRP_MJ_CLEANUP] = DriverCleanupIO;
pDriverObject->MajorFunction[IRP_MJ_CREATE] = DriverCreateIO;
pDriverObject->MajorFunction[IRP_MJ_CLOSE] = DriverCloseIO;
pDriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
DriverInternalDeviceIO;
pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
DriverDeviceControlIO;
pDriverObject->MajorFunction[IRP_MJ_READ] = DriverReadWriteIO;
pDriverObject->MajorFunction[IRP_MJ_WRITE] = DriverReadWriteIO;
pDriverObject->MajorFunction[IRP_MJ_PNP] = DriverPnPControlIO;
pDriverObject->MajorFunction[IRP_MJ_POWER] = DriverPowerControlIO;
pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
DriverSystemControlIO;
pDriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] =
DriverFlushBuffersIO;
pDriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = DriverShutdownIO;

After all the PnP operations are sent to my SCSIPORT driver, I get an
Inaccessible Boot Device BSOD. I have set a breakpoint in each of my Major
function routines. None of them get hit. The only one that gets called is
the PnP major function for starting up the device.

The following is my INF file that loads the SCSIPORT driver.
[Version]
Signature = “$Windows NT$”
Class = System
ClassGUID = {4D36E97D-E325-11CE-BFC1-08002BE10318}
DriverVer = 08/22/2001, 5.2.2.0
Provider = %SUN_MFG%

[Strings]
SUN_MFG = “Sun Microsystems”
SUNEMDK.DESC = “Sun Emulated Disk Controller”
REG_DWORD = 0x00010001
REG_EXPAND_SZ = 0x00020000
REG_MULTI_SZ = 0x00010000
SPSVCINST_ASSOCSERVICE = 0x00000002

[DestinationDirs]
SunEmDk.Driver.Copy = 12

[SunEmDk.Driver.Copy]
sunemdk.sys

[ControlFlags]
ExcludeFromSelect = BRIDGE\EmulatedDiskCntrl

[Manufacturer]
%SUN_MFG% = SunDevices

[SunDevices]
%SUNEMDK.DESC% = SunEmDkDriver, BRIDGE\EmulatedDiskCntrl

[SunEmDkDriver]
CopyFiles = SunEmDk.Driver.Copy

[SunEmDkDriver.Services]
AddService = sunemdk, %SPSVCINST_ASSOCSERVICE%, SunEmDk.Service,
SunEmDk.Eventlog.Inst

[SunEmDk.Service]
DisplayName = %SUNEMDK.DESC%
ServiceType = 1
StartType = 0
ErrorControl = 1
ServiceBinary = %12%\sunemdk.sys
LoadOrderGroup = port
AddReg = SunEmDk.Reg

[SunEmDk.Eventlog.Inst]
AddReg = SunEmDk.AddEventLog

[SunEmDk.AddEventLog]
HKR, , EventMessageFile, %REG_EXPAND_SZ%,
“%%SystemRoot%%\System32\iologmsg.dll”
HKR, , TypesSupported, %REG_DWORD%, 7

[SunEmDk.Reg]
HKLM, “System\CurrentControlSet\Services\sunemdk\parameters”,
“DiskVolumeKey”, %REG_DWORD%, 0x01

Any ideas of why this is not being recognized by WinXP that it’s not a SCSI
port driver?

Thanks,
Joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Joe Moriarty
Sent: Wednesday, September 26, 2001 6:57 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI port driver

I’m going to give it a shot because my SCSIPORT driver is enumerated by a
parent driver (I’m a PNP driver model). It’s probably only used for all
their WMI crap, but if it doesn’t hurt to bad why not do it.

Joe

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of
> xxxxx@hotmail.com
> Sent: Wednesday, September 26, 2001 6:16 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: SCSI port driver
>
>
> You’re confused. If somebody writes a monolithis SCSI port driver
> (for own
> IDE RAID contoller, for own FC controller for example) he does not need
> complete repleacement of SCSIPORT from Microsoft. If you wrote
the driver
> that replaces SCSIPORT (I think that’s what you did) my congratulations!
> But not a lot of people need this… Monolithic SCSI port != Microsoft
> SCSIPORT.
>
> > From your neglectance of such issues, I can conclude that your
> code is not
> > 100% compatible with SCSIPORT.
>
> —
> You are currently subscribed to ntdev as: xxxxx@east.sun.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: xxxxx@east.sun.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

It must still function like SCSIPORT at the interface level and at the
PNP level.

Jamey
xxxxx@storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Wednesday, September 26, 2001 6:16 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI port driver

You’re confused. If somebody writes a monolithis SCSI port driver (for
own
IDE RAID contoller, for own FC controller for example) he does not need
complete repleacement of SCSIPORT from Microsoft. If you wrote the
driver
that replaces SCSIPORT (I think that’s what you did) my congratulations!

But not a lot of people need this… Monolithic SCSI port != Microsoft
SCSIPORT.

From your neglectance of such issues, I can conclude that your code is

not 100% compatible with SCSIPORT.


You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> You’re confused. If somebody writes a monolithis SCSI port driver (for own

IDE RAID contoller, for own FC controller for example) he does not need
complete repleacement of SCSIPORT from Microsoft.

Wrong.
The rest of the OS - and the apps - expect the SCSI port driver to have some
set of upper-level interfaces because SCSIPORT supports them.
Providing a “simplified” SCSIPORT will break there apps/OS components.
You will end up with code which “usually works” but has lots of all kinds of
issues in non-trivial environments.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com