NdisWrapper
Encyclopedia
NDISwrapper, is a free software
driver wrapper
that enables the use of Windows XP
drivers for network devices (PCI cards, USB modems, and routers), on Linux only operating systems. NDISwrapper works by implementing the Windows kernel and NDIS
APIs, and dynamically linking the Windows drivers to this implementation. It therefore works only on systems based on the architectures supported by Windows, namely IA-32
or x86-64
.
Native NDIS drivers for Linux are not available for some network adapters, as manufacturers supply neither drivers nor the information required to write them. NDISwrapper allows to use Windows drivers available for virtually all adapters under Linux.
rather than console commands.
It was useful at a time where there were no Linux WIFI drivers for common WIFI cards.
It works only on X86 computers because it uses Windows drivers which are only developed for X86 at the moment.
It is composed of:
It's possible from a Linux driver (NDISwrapper is a Linux driver) to call a Windows driver because they both execute in the same address space (the same as the Linux kernel).
If the Windows driver is composed of layered drivers (for example one for Ethernet above one for USB) it's the upper layer driver which is called, and this upper layer will create new calls (IRP in Windows parlance) by calling the "mini ntoskrnl". So the "mini ntoskrnl" must know there are other drivers, it must have registered them in its internal database a priori by reading the Windows ".inf" files.
Independently of but roughly simultaneously with the NDISwrapper project, Bill Paul of Wind River Systems
developed a similar system, known as Project Evil or The NDISulator, for FreeBSD
. It has since been ported to DragonFly BSD
and NetBSD
.
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...
driver wrapper
Driver wrapper
A driver wrapper is software that functions as an adapter between an operating system and a driver, such as a device driver, that was not designed for that operating system. It can enable the use of devices for which no drivers for the particular operating system are available...
that enables the use of Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...
drivers for network devices (PCI cards, USB modems, and routers), on Linux only operating systems. NDISwrapper works by implementing the Windows kernel and NDIS
Network Driver Interface Specification
The Network Driver Interface Specification is an application programming interface for network interface cards . It was jointly developed by Microsoft and 3Com Corporation, and is mostly used in Microsoft Windows, but the open-source NDISwrapper and Project Evil driver wrapper projects allow...
APIs, and dynamically linking the Windows drivers to this implementation. It therefore works only on systems based on the architectures supported by Windows, namely IA-32
IA-32
IA-32 , also known as x86-32, i386 or x86, is the CISC instruction-set architecture of Intel's most commercially successful microprocessors, and was first implemented in the Intel 80386 as a 32-bit extension of x86 architecture...
or x86-64
X86-64
x86-64 is an extension of the x86 instruction set. It supports vastly larger virtual and physical address spaces than are possible on x86, thereby allowing programmers to conveniently work with much larger data sets. x86-64 also provides 64-bit general purpose registers and numerous other...
.
Native NDIS drivers for Linux are not available for some network adapters, as manufacturers supply neither drivers nor the information required to write them. NDISwrapper allows to use Windows drivers available for virtually all adapters under Linux.
Use
NDISwrapper requires at least the ".inf" and the ".sys" files invariably supplied as parts of the Windows driver. For example, if the driver is called "mydriver", with the files mydriver.inf and mydriver.sys and vendorid:productid 0000:0000, then NDISwrapper installs the driver to /etc/ndiswrapper/mydriver/. This directory contains three files:- 0000:0000.conf, which contains information extracted from the inf file
- mydriver.inf (the original inf file)
- mydriver.sys (the driver file)
Graphical frontends
There are graphical frontends to NDISwrapper, such as Ndisgtk and NdisConfig, which allow NDISwrapper to be installed using a graphical user interfaceGraphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...
rather than console commands.
Architecture
NDISwrapper enables a Unix-like system to use Windows drivers of type NDIS and WIFI.It was useful at a time where there were no Linux WIFI drivers for common WIFI cards.
It works only on X86 computers because it uses Windows drivers which are only developed for X86 at the moment.
It is composed of:
- An NDIS driver, which is a kind of overlay for Ethernet drivers.
- A WIFI manager, to control the radio and security part of the WIFI card.
- A USB manager and a PnP manager to make it possible to use WIFI card embedded in USB sticks. The USB manager is composed of two parts, first a tiny USBD implementation (USB stack) then a simple WDM USB driver that is itself composed of two parts: The front part will receive calls from the NDISWrapper USB stack (in fact from calls coming from the original Windows driver that were normally intended to go to the Windows USB stack) and the rear part is using Linux USB stack.
- A minimal Ntoskrnl simulating the DDK for:
- managing calls from the Windows driver.
- managing IRP to the Windows driver (WDM only at the moment)
- managing filter drivers in a simplistic way
- loading/unloading Windows drivers
- A wrapper converting Linux calls to Windows and the other way round, also managing results and error codes
How it works
When a Linux application calls a device which is registered on Linux as an NDISwrapper device, the NDISwrapper determines which Windows driver is targeted. It then converts the Linux query into Windows parlance, it calls the Windows driver, waits for the result and translates it into Linux parlance then sends the result back to the Linux application.It's possible from a Linux driver (NDISwrapper is a Linux driver) to call a Windows driver because they both execute in the same address space (the same as the Linux kernel).
If the Windows driver is composed of layered drivers (for example one for Ethernet above one for USB) it's the upper layer driver which is called, and this upper layer will create new calls (IRP in Windows parlance) by calling the "mini ntoskrnl". So the "mini ntoskrnl" must know there are other drivers, it must have registered them in its internal database a priori by reading the Windows ".inf" files.
Similar programs
DriverLoader is a commercial tool produced by Linuxant for Linux which seems to provide the same functionality as NDISwrapper.Independently of but roughly simultaneously with the NDISwrapper project, Bill Paul of Wind River Systems
Wind River Systems
Wind River Systems, Inc. is a company providing embedded systems, development tools for embedded systems, middleware, and other types of software. The company was founded in Berkeley, California in 1981 by Jerry Fiddler and David Wilner. On June 4, 2009, Wind River announced that Intel had bought...
developed a similar system, known as Project Evil or The NDISulator, for FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...
. It has since been ported to DragonFly BSD
DragonFly BSD
DragonFly BSD is a free Unix-like operating system created as a fork of FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and a FreeBSD developer between 1994 and 2003, began work on DragonFly BSD in June 2003 and announced it on the FreeBSD mailing lists on July...
and NetBSD
NetBSD
NetBSD is a freely available open source version of the Berkeley Software Distribution Unix operating system. It was the second open source BSD descendant to be formally released, after 386BSD, and continues to be actively developed. The NetBSD project is primarily focused on high quality design,...
.
Limitations
- Since NDISWrapper relies on Windows drivers it only supports i386 and x86_64 architectures.
- NDISwrapper does not implement NDIS Network Driver Interface SpecificationThe Network Driver Interface Specification is an application programming interface for network interface cards . It was jointly developed by Microsoft and 3Com Corporation, and is mostly used in Microsoft Windows, but the open-source NDISwrapper and Project Evil driver wrapper projects allow...
6 (Windows Vista version) yet, limiting drivers to Windows XP. While it is not a major problem for the x86 architecture because of the popularity of Windows XP x86-32, many vendors choose to make 64-bit driver versions only for Windows Vista — which means that Linux systems using the x86-64 architecture are unable to use such networking devices (either NDIS5 32 bits because they are 64bits systems or NDIS6 64bit drivers because they can't use NDIS6). It's possible to use Windows XP 64 bit drivers which implement NDIS5, however, there are fewer available drivers for xp64 (NDIS5/64 bit) than for XP32(NDIS5/32 bit). An implementation of NDIS 6 is underway, under the name of ndis6wrapper, but it is not close to being functional.
External links
- The NDISwrapper wiki
- NDISwrapper Download Area
- NDISwrapper Installation – An easy to follow video showing how to install NDISwrapper and get started with it.
- Ndisgtk
- NdisConfig
- Project Evil: The Evil Continues, 2004-01-24, Bill Paul on a FreeBSDFreeBSDFreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...
mailing list - Too Evil, Too Furious, 2005-04-25, Bill Paul on a FreeBSDFreeBSDFreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...
mailing list - NetBSD NDIS Driver Port