How to Migrate a Windows-based Desktop NDIS Miniport Driver to Windows CE
You can migrate a Windows-based desktop Network Driver Interface Specification (NDIS) miniport driver to Windows CE with a minimal amount of changes. Many of the changes involve build-time filtering of Windows-based desktop NDIS miniport driver functionality that Windows CE does not support. For portability between Windows-based desktop OSs and Windows CE, Microsoft recommends making certain changes to your driver to enable it to build in Platform Builder and with a Windows-based desktop driver development kit (DDK). The NDIS wrapper is a dynamic-link library (DLL) that facilitates developing and migrating NDIS miniport drivers by abstracting portions of the OS and by providing supporting functions.
To complete the following procedure, Microsoft used a Windows-based desktop driver that supports the Intel EtherExpress PRO/100+** Ethernet PCI adapter and Intel EtherExpress PRO/100B** PCI adapter (E100BEX). Obtain the sample source code for the E100BEX driver by installing the Windows XP DDK.
The following list shows the major differences between the NDIS miniport drivers for the Windows-based desktop and Windows CE:
- Windows-based desktop NDIS miniports are .sys files.
- Windows CE NDIS miniports are .dll files.
- Windows CE NDIS miniports must expose the DriverEntry function.
- Windows CE does not use the lower 64 KB of the I/O address space; do not use 16 bit values for I/O port addresses.
- The Windows CE NDIS implementation does not support the EISA or MCA busses. Do not use the NdisOverRideBusNumber and NdisReadMcaPosInformation functions.
- The Windows CE NDIS implementation does not support direct memory access (DMA). Do not use the NdisSetupDmaTransfer, NdisCompleteDmaTransfer, NdisMRegisterDmaChannel, NdisMDeregisterDmaChannel, NdisMAllocateMapRegisters, NdisMFreeMapRegisters, NdisMReadDmaCounter, and NdisGetSharedDataAlignment functions. Use the NdisMAllocateSharedMemory and NdisMFreeSharedMemory for PCI bus master DMA transfers.
- In Windows CE, the NdisInitializeEvent function requires the NdisFreeEvent function, and the NdisInitializeReadWriteLock function requires the NdisFreeReadWriteLock function.
- In Windows CE, avoid unaligned I/O and memory access. You may need to rearrange structures, or conditionally define another type with the
UNALIGNED
keyword. - In Windows CE, for delays greater than 50 microseconds, use the NdisMSleep function, rather than NdisStallExecution. NdisStallExecution requires a QueryPerformanceCounter implementation for your target device.
Hardware and Software Assumptions
- You have a Windows-based desktop NDIS miniport driver. For more information, see Miniports, Intermediate Drivers, and Protocol Drivers.
- You have created a configuration within Platform Builder. For more information, see How to Use the IDE to Create, Customize, and Build a Platform.
- Your target device has one Ethernet card for downloading the OS image, and one Ethernet card for product Ethernet, and you intend to use the NDIS miniport driver for the product Ethernet card. For more information, see Ethernet Connection Options.
- You are familiar with downloading OS images to a target device. For more information, see How to Configure a CEPC to Download an OS Image.
To track your progress in the following table, select the check box next to each step.
Step | Topic | |
---|---|---|
1. Add the Wired Local Area Network feature to your platform configuration.
|
Adding a Feature from the Catalog | |
2. Exclude Vmini.dll from the OS image by setting the BSP_NOSHAREETH and IMGNOSHAREETH environment variables. | Setting or Clearing an Environment Variable | |
3. Add the Windows-based Desktop NDIS miniport driver to your OS image build. | Adding the Windows-based Desktop NDIS Miniport Driver to the OS Image Build | |
4. Add debug zones to the NDIS miniport driver initialization functions. | Adding Debug Zones to the NDIS Miniport Driver Initialization Functions | |
5. Remove DMA support from the NDIS miniport driver initialization functions. | Removing DMA Support from the NDIS Miniport Driver Initialization Functions | |
6. Remove unused local variables from the NDIS miniport driver core functions. | Removing Unused Local Variables from the NDIS Miniport Driver Core Functions | |
7. Add a DllMain entry point to the NDIS miniport driver core functions. | Adding a DllMain Entry Point to the NDIS Miniport Driver Core Functions | |
8. Remove DMA support from the NDIS miniport driver send and receive functions. | Removing DMA Support from the NDIS Miniport Driver Send and Receive Functions | |
9. Remove Windows Management Instrumentation (WMI) support from and conditionally defining power management for the NDIS miniport driver object identifier functions. | Removing WMI Support from and Conditionally Defining Power Management for the NDIS Miniport Driver Object Identifier Functions | |
10. Conditionally define power management in the NDIS miniport driver object identifier functions. | Conditionally Defining Power Management in the NDIS Miniport Driver Object Identifier Functions | |
11. Filter local variables in the NDIS miniport driver PhyDetect and SetupPhy functions. | Filtering Local Variables in the NDIS Miniport Driver PhyDetect and SetupPhy Functions | |
12. Build the OS image. | Building a Platform | |
13. Download the OS image to the target device. | Downloading an OS Image to a Target Device | |
14. Test the NDIS miniport driver with the CETK.
If you also want to check the network connection through the NDIS miniport driver, you can do so by browsing the Web or another type of network. You may have to configure your Internet settings to use a proxy server. |
How to Use the CETK to Test a Driver |
**The non-Microsoft software and hardware referenced in these documents are included for illustrative purposes only. Illustrations that use such third-party software and hardware as examples are not intended to be an endorsement or recommendation of any of these products. We provide this information only as a convenience for our customers for purposes of explaining a practical application and do not provide warranties of any kind, whether express, implied or statutory, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
See Also
Device Driver How-to Topics | Migration How-to Topics | Miniports, Intermediate Drivers, and Protocol Drivers | Network Drivers | Troubleshooting a Device Driver | How to Develop a Connectionless NDIS Miniport Driver
Last updated on Tuesday, May 18, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.