From: flyingfly on
HI:
I am writing a SCSI miniport driver to present a ram disk using FPGA
based platform, and there are some problems I need to solve:
1. For bus master DMA with scatter/gather supported, is there a way to
make the start address of each physical segment aligned to 4KB? I find in
http://support.microsoft.com/kb/153264/en-us/ that only a maximun of Double
Dword alignment is supoorted, but I think that may not be the limitation..
2. Following the 1st question, can each data segment be a multiple of
512bytes? I find in WDK docs that the related parameters are
MaximunTransferLength and NumberOfPhysicalBreaks in
PORT_CONFIGURATION_INFORMATION, which can not help to solve my problem.
3. In Windows XP, how many SCSI commands are mandatory for OS to use
the ram disk? I implemented INQUIRY, READ CAPACITY, READ, WRITE, FORMAT UNIT
in my driver, and leave other command to SCSI_INVALID_REQUEST. But in the
implementation, OS failed to format the disk. And during the initialization
process, OS sends INQUIRY vital data, and MODE SENSE command which I reply
with SCSI_INVALID_REQUEST. What is the problem in my driver and what else I
need to do to make the disk work properly.

Thanks a lot!
From: hitesh on
On Aug 17, 6:46 am, flyingfly <flying...(a)discussions.microsoft.com>
wrote:
> HI:
>    I am writing a SCSI miniport driver to present a ram disk using FPGA
> based platform, and there are some problems I need to solve:
>    1. For bus master DMA with scatter/gather supported, is there a way to
> make the start address of each physical segment aligned to 4KB?  I find inhttp://support.microsoft.com/kb/153264/en-us/ that only a maximun of Double
> Dword alignment is supoorted, but I think that may not be the limitation...
>     2. Following the 1st question, can each data segment be a multiple of
> 512bytes? I find in WDK docs that the related parameters are
> MaximunTransferLength and NumberOfPhysicalBreaks in
> PORT_CONFIGURATION_INFORMATION, which can not help to solve my problem.
>      3. In Windows XP, how many SCSI commands are mandatory for OS to use
> the ram disk? I implemented INQUIRY, READ CAPACITY, READ, WRITE, FORMAT UNIT
> in my driver, and leave other command to SCSI_INVALID_REQUEST. But in the
> implementation, OS failed to format the disk. And during the initialization
> process, OS sends INQUIRY vital data, and MODE SENSE command which I reply
> with SCSI_INVALID_REQUEST. What is the problem in my driver and what else I
> need to do to make the disk work properly.
>
> Thanks a lot!

answer to your 3rd q: add Report luns command which is required. (i
dont think you need format unit).
~hitesh
From: Maxim S. Shatskih on
> 1. For bus master DMA with scatter/gather supported, is there a way to
> make the start address of each physical segment aligned to 4KB? I find in
> http://support.microsoft.com/kb/153264/en-us/ that only a maximun of Double
> Dword alignment is supoorted, but I think that may not be the limitation..
> 2. Following the 1st question, can each data segment be a multiple of
> 512bytes? I find in WDK docs that the related parameters are
> MaximunTransferLength and NumberOfPhysicalBreaks in
> PORT_CONFIGURATION_INFORMATION, which can not help to solve my problem.

No. Windows DMA API cannot provide these guarantees. So, the hardware must be smart enough to never require them.

> 3. In Windows XP, how many SCSI commands are mandatory for OS to use
> the ram disk?

Just look at what commands arrive to your code and fail.

I think that at least some mode pages (MODE SENSE) are mandatory.

FORMAT UNIT is not used by Windows "format" command. VERIFY is used.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: Maxim S. Shatskih on
>answer to your 3rd q: add Report luns command which is required.

REPORT LUNS is only required IIRC if you have non-contiguous LUN numbering.

If you have contiguous LUNs, or only LUN0 - then it is not needed.

Well, STORPORT have probably changed the rules and made REPORT LUNS mandatory.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: eagersh on
On Aug 17, 4:59 am, "Maxim S. Shatskih"
<ma...(a)storagecraft.com.no.spam> wrote:
> >answer to your 3rd q: add Report luns command which is required.
>
> REPORT LUNS is only required IIRC if you have non-contiguous LUN numbering.
>
> If you have contiguous LUNs, or only LUN0 - then it is not needed.
>
> Well, STORPORT have probably changed the rules and made REPORT LUNS mandatory.
>
> --
> Maxim S. Shatskih
> Windows DDK MVP
> ma...(a)storagecraft.comhttp://www.storagecraft.com

Yes, STORPORT sends REPORT LUNS on each Bus/Target pair.

Igor Sharovar