Maverick Research Inc: The professional device driver solutions company
        A Division of Optasia Systems Pte Ltd, SingaporeKRFTech - Technical Issues  

WinDriver - FAQ

General starters
What is WinDriver? 
Do I need WinDriver ISA or PCI? 
Can I try before I buy? 
WinDriver advantages
What are the advantages over similar products? 
Licensing Issues
How do I order my WinDriver license? 
What will I receive with my license? 
Must I pay royalties? 
Technical information
How do I port a DOS driver to Windows? 
How many cards can WinDriver handle at one time? 
... More technical questions 
PLX Specific
... PLX API related questions 
General Starters.. 

What is WinDriver? 
WinDriver is a C/C++ toolkit which allows easy access to hardware from the user mode. WinDriver is ideal for PCI / EISA / ISA device driver development, it supports I/O operations, access to memory mapped cards, handling hardware interrupts, DMA transfers, Plug and Play support and Multi-board handling. Using WinDriver, the same device driver code you write will work on all Windows platforms! 
WinDriver also supports the major PCI Bridge chip-sets, thereby hiding most of the PCI detail from you, and allowing you to concentrate on your device specific logic.  

Must I have experience in device driver programming or kernel programming? 
Not at all. With WinDriver, coding your device driver is done in user - mode, i.e. you can use your favorite developing environment to program and debug your driver, thereby drastically decreasing your device driver developing time. 

Do I need the 'WinDriver ISA', 'WinDriver PCI' or the 'WinDriver PCI Bundle' package?  

  • If you are developing a driver for a non-PCI card, and do not need DMA - you need the 'WinDriver ISA'.  'WinDriver ISA' handles memory mapping, I/O, and interrupts.
  • If you are developing a PCI card which is to run on either Win95 / 98 OR WinNT 3.51 / 4.0 / 5.0 - You need the 'WinDriver PCI'.  'WinDriver PCI' Supports PCI cards, Bus-Master DMA, handles memory mapping, I/O and interrupts. 
  • If you are developing a PCI card which is to run all Windows platforms (Win95 / 98 / WinNT3.51 / WinNT4.0 / WinNT5.0) - You need the 'WinDriver PCI Bundle'.  The 'WinDriver PCI Bundle' enables you to use all of the features of the 'WinDriver PCI', on both Windows 95/98 AND Windows NT. Using the 'WinDriver PCI Bundle', the executable you create will run on both Win95/98 and WinNT . 
Can I try before I buy? 
Visit our download page to download a 30 day full featured evaluation copy of WinDriver.  
Using the evaluation copy you will be able go through the whole driver development process (see below), and to create your working driver / hardware access application in no time. 

Recommended development steps  

  • Fire up the WinDriver Wizard (Start/Programs/WinDriver/WinDriver Wizard) 
  • Diagnose your hardware through the Wizard by reading / writing to your board, watching the interrupts fire, reading / writing to the registers on your card, ... - and all through a Windows user interface! 
  • Press "Generate code". The Wizard will create the skeleton of your device driver for you. This will include functions which access all of the resources you defined in the diagnostics stage. 
  • Use the on-line help and manual to add the rest of the functionality you need (if any). 
  • Compile your code using your favorite C/C++ compiler (from the user mode!). 
  • DONE! 
Back 
WinDriver advantages 
What are the advantages over similar products?  
  • WinDriver Supports the new Windows OSs (NT5.0 / 98) transparently.
  • WinDriver hides the kernel / OS from the programmer - Programming is done in user mode.
  • WinDriver supports the main PCI bridge chips (PLX / AMCC / V3) - Thereby hiding the intricacies of the PCI bus.
  • Supports multi-CPU machines!
  • Supports multi-PCI bus machines!
  • DMA support
  • Kernel allocated contiguous buffers
  • Multi-board support
  • User-mode programming, Kernel mode performance
  • Same code you write works on Win95 / WinNT3.51 / WinNT4.0 / Win98 / WinNT5.0.
Back 
License Issues 
How many copies of my driver can I distribute, after developing it with WinDriver? Must I pay royalties? 
After purchasing the license, you own your driver. The executable that is created is yours to distribute freely in as many copies as you wish. No royalties are to be paid. The only exception to this is if you are creating a driver development kit with the WinDriver. If this is the case, please contact KRFTech (sales@krftech.com) for more information. 

 What will I receive with my license? 
Your paid license will include the registered WinDriver, official documentation, 6 months of free product upgrades and same-business-day support. 

How do I purchase my WinDriver license? 
Fill in the order form from our Sales page, and email it to maverick@singapore.com, or fax it along with your purchase 
order (if applicable) to +65-471 3938 

Back 

Technical Information 
I have a DOS device driver that uses "inp" and "outp" calls to access my card. How can I get it to work on Win95 and WinNT? 
Simple! Include the sample source code "BASIC_IO.C" in your code. Define the I/O range your card uses in MY_IO_BASE and MY_IO_SIZE. For example: 
to use range 0x378-0x37a define MY_IO_BASE=0x378 and MY_IO_SIZE=3. Call IO_init() at the begining of the driver, and IO_end() before exit. Replace any inp() and outp() in your code to IO_inp() and IO_outp() respectively. Compile and run! 

How many I/O spaces and memory spaces does WinDriver support on a single board? 
The number of I/O spaces is not really limited. Each card can have up to 20 elements (i.e. I/O, memory and interrupt elements), but if you need more, - you can simply register another card. 

How many cards can WinDriver handle at one time? 
WinDriver is not limited to the number of cards it can handle. 

Can WinDriver group I/O and memory transfers? 
Using WinDriver, you can group I/O transfers by calling WD_TransferMulti(), which can perform multiple transfers at one call. 

Can WinDriver handle multiple boards of different types at the same time? 
YES! Each board receives a unique handle when calling the WD_CardRegister() function. This enables different cards with device driver written with WinDriver to co-exist on the same machine.  

Can I debug code easily using MSVC++? 
YES! The code of the device driver you write runs in normal Win32 user mode. Therefore you can compile and debug your code using MSVC++. 

What are the differences between device drivers for Windows 3.x, Windows 95, and Windows NT? 
Windows 3.x user mode code runs as 16Bit (as in DOS), and therefor it does not utilize 32Bit proccessor power. 

In Windows 95, which runs 32Bit code, running applications that access the I/O ports directly is possible, unlike in Windows-NT - where performing an I/O read/write will cause a general Application Fault.  

  • With WinDriver, performing I/O on all Windows platforms is easily done with one API call.
If your program needs to perform interrupt handling and accessing of memory mapped cards, writing a kernel-mode driver is a must in both 95 and NT.  
  • With WinDriver, all this can be done in the user mode, and still run on both operating systems.
Another visible difference between the two operating systems, is that the kernel mode device drivers for Windows-95 use the '.VXD' extension, while on Windows-NT they carry the '.SYS' extension. 
In order to support Both Win-95 and NT two separate kernel-mode drivers need to be written.  
  • Using WinDriver, you don't have to write two separate drivers. WinDriver lets you write your device driver ONCE as a normal Win32 Application, and it will work for BOTH Win-95 and NT.
WinDriver accomplishes this by having the WinDriver 'agent' driver present in the Win95 (windrvr.VxD) and in WinNT (windrvr.SYS) kernel modes. This 'agent' communicates with your code which resides in the user mode. 

I have run into a problem accessing 32MB of memory on a PCI card. With a 16MB window it works fine. What's the problem? 
In order for you not to run out of page table entries, you should increase: 

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management\SystemPages 

in the registry. (Use REGEDIT.EXE for Win-95 and NT4.0, or REGEDT32.EXE for NT3.51). 

It is recommended to use a smaller window to access the memory on the board. 

The card I want to drive currently has an interrupt service routine in DOS/16-bit. How do I create an interrupt routine? 
I need to be able to count the number of interrupts occurring and possibly call a routine every time an interrupt occurs. Is this possible with Windriver? 
YES! Use the sample code "INT.C" available with your evaluation or registered package. This will install an interrupt, and put a thread that waits on it. The number of interrupts are returned by 'Intrp.dwCounter'. 

Does WinDriver poll the interrupt (Busy Wait)? 
NO. When calling WD_IntWait() the thread that called is put to sleep. CPU cycles are not wasted on waiting! When an interrupt occurs the thread is awakened and you may perform your interrupt. 

Can I write to disk files during an interrupt routine? 
YES! WinDriver allows you to perform all library function calls within an interrupt routine. Just remember to keep it short so you wont miss the next interrupt. 

We are currently developing NT4.0 drivers and I would like to know if your product supports PNP in NT4.0... 
In order for the Device Drivers you write using WinDriver to be PNP (WIN95 and NT40), you will need to deal with WM_DEVICECHANGE (in WM_COMMAND) message, with different DBT_DEVTYP_xxxx event codes. 
Your device driver (EXE or DLL) will have to react to the changes dynamically. WinDriver will allow you to detect, install and remove hardware dynamically (and not only during boot phase). 

How do I perform PCI memory access Read/Writes to/from our card using WinDriver? 
First, locate the slot where your card is in using WD_PciScanCards(); Then get card information using WD_PciGetCardInfo(). This information includes the IRQ chosen for this card by the Plug And Play system. Now call WD_CardRegister() to install this interrupt. 

Sample code that performs all this is found in "PCI.C" in the WinDriver package. 

What happens if another piece of hardware in someone's machine is also using a driver that was written using WinDriver... does it handle it gracefully? Has it been tested? 
Yes. WinDriver has multi-board handling, therefore enabling many different applications working simultaneously with WinDriver. Since WinDriver is always backwards compatible, If one application uses WINDRVR.VXD from V3.04, and yours uses V3.10, the installation program will leave the file with the newest time stamp in the drivers directory, and the older code will be supported.  

How do I perform PCI Interrupt handling using WinDriver? 
First, locate the slot where your card is at using WD_PciScanCards(); Then get card information using WD_PciGetCardInfo(). This information includes the memory range chosen for this card by the Plug And Play system. Now call WD_CardRegister() to install the memory range. 

Sample code that performs all this is found at "PCI.C" in the WinDriver package. 

How do I perform PCI Burst Writes (DMA) from system memory to our card using WinDriver? 
Your device needs to be PCI DMA Master Capable. After locating and registering your PCI card (using WD_PciScanCards(), WD_PciGetCardInfo() and WD_CardRegister()), you need to lock your memory buffer. 

To do this, call WD_DMALock(), giving your buffer's linear address as the parameter. WD_DMALock() will lock this buffer in physical memory and give you a list of pages representing the physical addresses of your buffer. 

Now it is up to you to program your BUS-MASTER device with the page list, and send a command for your card to start transfer. Programing a PCI device for DMA transfer is device specific. If you have any questions, contact us for help with your specific device. At the end of the transfer you should call WD_DMAUnlock() to release your buffer from locked physical memory. 

A sample can be found in "PCI.C" in the WinDriver package, in the function IO_DMATransferBuffer(). 

How do I perform Direct Block transfers from one PCI card to another? 
Locate and register both cards (using WD_PciScanCards(), WD_PciGetCardInfo() and WD_CardRegister()). 

At least one of the cards must be PCI DMA Master Capable. Program it with the physical address of the Slave card. Obtaining this address is possible by using 'I.Mem.dwPhysicalAddr' set by WD_PciGetCardInfo(). 

A sample can be found in "PCI2PCI.C" in the WinDriver package. 

How do I prevent two processes from attaching to the card? 
Marking the resources (Interrupts, I/O, Memory) as NON-SHARABLE, will prevent two processes registering and using the card twice. 

What is the interrupt latency of WinDriver? 
The interrupt latency may be divided into two parts as follows:  

  1. Kernel latency: Which is the time from which the interrupt occurs until the time that the OS calls the interrupt handler.

  2. This is OS dependent. As a general rule: the more complex the OS the longer the latency. (i.e. DOS is fastest, Win95 slower and WinNT slowest.) 
  3. The transfer from the kernel mode to the user mode: Which is the time from which the kernel is called, until the time that the user mode thread is released) This latency depends on specific factors of your machine and software. You need to experiment with your software to test its speed.
The Beta version of WinDriver V3.1, implements the crucial parts of your code (such as the interrupt handlers) in the kernel mode, thereby increasing the overall performance of your driver to that of a kernel driver. If you are interested in Beta testing the new WinDriver version, please write to us at marketing@krftech.com  

Back 

PLX API 
I am using the PLX-MON (The monitor software which is included in the PLX design Kit). 
The Read/Write functions are working correctly. 
The WinDriver Wizard can also access memory on the PLX9050. But when I use the WinDriver's PLX9050 Diagnostics utility, I cannot read/write data on the board's memory. 
What is the problem?  

WinDriver's PLX 9050 API automatically sets the re-map register on the PLX 9050 prior to reading/writing data from the local bus. 

This means the you MUST set the values of the re-map register in the p50lib.c (this depends on your hardware), the card may HANG if the wait-states are not set correctly. 

Since many developers are not aware of this feature, and they prefer to set the re-map register in the EEPROM init (when the computer is turned on), we have created new functions in the V3.03 that access the PLX address ranges without changing the re-map register. These functions are P9050_ReadSpaceByte() and friends. Please download and install WinDriver V3.03 or higher, and use Option 5 (not 6) from the main menu of the WinDriver's PLX diagnostics utility (read/write address spaces). 

This option uses P9050_ReadSpaceByte() instead of P9050_ReadByte(). P9050_ReadByte() first sets the re-map register, then calls P9050_ReadSpaceByte(). Since you do not want WinDriver to set the re-map register, but prefers a low-level access (like WinDriver Wizard and PLX-MON do), please call the P9050_ReadSpaceByte() functions. 

Back

 Copyright KRFTech