Hello,

I have a PCI adapter that has flash memory on it. I know everythings about this card, including the PCI manuf device ID, the PCI config register, and how to read and write from/to the flash memory.

I want to write a driver for it such that when I open windows explorer I will see my card shown as drive D: (or E: if there is a CD rom in the system). I have been reading books, including Programming the MS WDM 2nd, Oney, and the DDK documentation from the lastest DDK for Window 2000/XP. Too much information has made me confused.

1. Should I write the SCSI mimiport driver that will layer below the scsi port driver?
I read about this SCSI miniport things but it's really confused. I have thought about this but when I look at the functions that I have to implement shown in the DDK, it is too complicated. My PCI card does not use DMA and IRQ. It only need two 32-bit registers and a 4k memory range and an IO port that is part of the PCI config space.

2. What are the alternatives?
Port driver? I thought my driver must be a port driver, since it must tell the system how to read and write to the PCI register. But it must contain a layer that tell the system that my drive is a D: drive.

Anyhow, this whole thing is a mess in me right now. Can someone explain or show me what the best approach to this? Thank you so very much.

Long

Re: Writing storage device driver for a flash PCI card by Eliyas

Eliyas
Fri Feb 27 15:52:34 CST 2004

I'm not an expert in storage drivers but my guess is that you can take the
ramdisk sample driver from our support site and modify it to talk to the PCI
device. Instead of allocating system ram and using it as disk, you will map
your flash memory to system address space.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx



Re: Writing storage device driver for a flash PCI card by Maxim

Maxim
Sat Feb 28 11:19:05 CST 2004

> 1. Should I write the SCSI mimiport driver that will layer below the scsi
port driver?

Yes. This is the best case, and will cause no problems. Create a virtual SCSI
controller with 1 disk LUN hanging off it.

> I read about this SCSI miniport things but it's really confused. I have
thought about this but
>when I look at the functions that I have to implement shown in the DDK, it is
too complicated.

One of the simplest places in all Windows kernel programming.

Let's hope that SCSIPORT will tolerate a PCI device without interrupt, since
otherwise you will need to write a full port driver, which is a very major
task.

Toolkits are available on the market to do this though, like ours :-) The
toolkit is very, very much similar to SCSIPORT, but without the SCSIPORT's
limitations.

> 2. What are the alternatives?

They are much more complex.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: Writing storage device driver for a flash PCI card by anonymous

anonymous
Mon Mar 01 17:26:05 CST 2004

Thank you very much for the info and the driver. I will try that.