From: flyingfly on
Hi:

I have a ML505 evaluation board with FPGA and DDR RAM on it.
The board is using PCIe.

How can I write a driver to present the DDR RAM as a RAM disk on PC?

I think it's not difficult to write a driver for PCIe and the DMA operation
between host computer and the DDR RAM.

But I've no idea how to combine the driver with file system or anything
necessary that i don't involve?

Thanks a lot
From: Don Burn on
Go to http://www.osronline.com and look at their virtual storport articles
and sample. This is not a small piece of work.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr



> -----Original Message-----
> From: flyingfly [mailto:flyingfly(a)discussions.microsoft.com]
> Posted At: Tuesday, June 29, 2010 3:51 AM
> Posted To: microsoft.public.development.device.drivers
> Conversation: How to write a RAM disk based on a evaluation board
> Subject: How to write a RAM disk based on a evaluation board
>
> Hi:
>
> I have a ML505 evaluation board with FPGA and DDR RAM on it.
> The board is using PCIe.
>
> How can I write a driver to present the DDR RAM as a RAM disk on PC?
>
> I think it's not difficult to write a driver for PCIe and the DMA
> operation
> between host computer and the DDR RAM.
>
> But I've no idea how to combine the driver with file system or anything
> necessary that i don't involve?
>
> Thanks a lot
>
>
> __________ Information from ESET Smart Security, version of virus
> signature
> database 5236 (20100629) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>

From: Maxim S. Shatskih on
> I think it's not difficult to write a driver for PCIe and the DMA operation
> between host computer and the DDR RAM.

DMA will only be available if your FPGA supports it.

I would write a SCSIPORT's mininport driver, which will present your board as a SCSI controller with 1 disk LUN to the rest of the OS.

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

From: flyingfly on
Thanks for your help!

I've just studied driver development for 2 months and I'm not quite familiar
with all the details.
Plz don't mind if my question involve some stupid or confusing ideas.

From your help, I think I need to write a virtual SCSI port to communicate
with OS and PCIe&DMA driver to communicate with device.

I have some troubles:
1.Storport is only supported for Vista and later OS. So for XP, I need to
write the SCSI port in a more complex way?
2.Is a file system driver needed upon the virtual SCSI port?
3.Is the transmission speed limited to SISI procotol? It must be much slower
than PCIe. That should be a waste.
4.Do i really need a virtual port? Can't I just tell OS that this is a
storage device and the driver can handle the operations needed for a normal
hard disk. For example, If OS send a READ request, the driver will get the
HOST memory address and the device disk address, it then start a DMA
transaction for the device. After the DMA transaction, the READ request is
finished.
Or the OS just know certain storage device such as SCSI,IDE...

Thanks again for your help, much appreciate!
From: Sven Kreamer on
> I think I need to write a virtual SCSI port to communicate
> with OS and PCIe&DMA driver to communicate with device.

No, all you need is a miniport. The file systems are above the
miniport and the miniport controls the device by calling miniport
functions.

> 1.Storport is only supported for Vista and later OS.

Correct, though technically it can be supported in Server 2003 which
is older than Vista. You need to write a SCSI miniport to support XP.
A SCSI miniport can support all Windows versions including Windows 7,
but should not be preferred unless you need XP or earlier.

> So for XP, I need to write the SCSI port in a more complex way?

This is simpler than a storport miniport as there are function calls
in and out. More or less a subset but not too large a difference.

> 2.Is a file system driver needed upon the virtual SCSI port?

This is totally abstracted from a miniport, no need to be concerned
with file systems.

> 3.Is the transmission speed limited to SISI procotol?

No.

> 4.Do i really need a virtual port?

No, Virtual is not needed in this case because you can live within the
miniport model and hence should not need to call any DDK functions
directly. Here is another sample source code to evaluate for RamDisk:
http://www.perisoft.net/miniport

> Thanks again for your help, much appreciate!

You are welcome.